prior_spec: prior specification

Description Details Default behavior See Also

Description

Specify the prior distribution

Details

A prior distribution on parameters is specified by means of the rprior and/or dprior arguments to pomp. As with the other basic model components, it is preferable to specify these using C snippets. In writing a C snippet for the prior sampler (rprior), keep in mind that:

  1. Within the context in which the snippet will be evaluated, only the parameters will be defined.

  2. The goal of such a snippet is the replacement of parameters with values drawn from the prior distribution.

  3. Hyperparameters can be included in the ordinary parameter list. Obviously, hyperparameters should not be replaced with random draws.

In writing a C snippet for the prior density function (dprior), observe that:

  1. Within the context in which the snippet will be evaluated, only the parameters and give_log will be defined.

  2. The goal of such a snippet is computation of the prior probability density, or the log of same, at a given point in parameter space. This scalar value should be returned in the variable lik. When give_log == 1, lik should contain the log of the prior probability density.

  3. Hyperparameters can be included in the ordinary parameter list.

Alternatively, one can furnish R functions for one or both of these arguments. In this case, rprior must be a function of prototype

1
  f(params, \dots)

that makes a draw from the prior distribution given params and returns a named vector of the same length and with the same set of names, as params. The dprior function must be of prototype

1
  f(params, log = FALSE, \dots).

Its role is to evaluate the prior probability density (or log density if log == TRUE) and return that single scalar value.

Default behavior

By default, the prior is assumed flat and improper. In particular, dprior returns 1 (0 if log = TRUE) for every parameter set. Since it is impossible to simulate from a flat improper prior, rprocess returns missing values (NAs).

See Also

Other information on model implementation: Csnippet, accumulators, covariate_table, distributions, dmeasure_spec, dprocess_spec, parameter_trans, pomp2-package, rinit_spec, rmeasure_spec, rprocess_spec, skeleton_spec, transformations, userdata


kidusasfaw/pomp documentation built on May 20, 2019, 2:59 p.m.