Adding a new model to fitPS2 months ago
When to add a new model | What a model must provide | Why MCMC needs unconstrained parameters | [\log p(z\mid x) | P and S surveys shift the probability sequence | Example 1: an external Poisson model | Construct the model | Supply the observation mapping | Supply probabilities | Supply the log likelihood | Add the Bayesian mathematics | Register the external S3 methods | Fit and use the model | Example 2: a Poisson-normal model with mu and sigma | [P(Y = y \mid \mu, \sigma) | [g(k; \mu, \sigma) | [\ell(\mu,\sigma) | Construct the two-parameter descriptor | Map the data and choose starting values | [\operatorname{Var}(Y) | Evaluate the marginal probability by numerical integration | Add Bayesian methods for the Poisson-normal model | Register the Poisson-normal methods | Fit the two-parameter model | Bayesian fitting of the external two-parameter model | Serialization and retained model objects | What an extension package should contain | Practical lessons from the two examples
fitPS 1.1.4James Curran extending.Rmd