Evaluate a prior distribution density over parameter values.

PriorDensity(prior, vecParams, log = TRUE, returnVector = TRUE...)

Arguments

prior

a Prior object.

vecParams

a numerical vector.

log

logical indicating if a log-prior should be returned (default: TRUE).

returnVector

logical indicating if a vector of length length(vecParams) should be returned. Default: TRUE.

...

additional arguments passed to methods.

Value

The returned value depends on returnVector:

  • If returnVector is TRUE (default) it should be a numeric vector of length equal to length(vecParams). If the prior distributions for the elements in vecParams, are independent, then each element in the returned vector corresponds to the (log-)prior density of the corresponding element in vecParams. Otherwise, the first element in the returned vector corresponds to the joint (log-)prior density and the other elements are set to 1 (if log=FALSE) or to 0 (if log=TRUE).

  • If returnVector is FALSE, this should be a single real number corresponding to the joint prior (log-)density of the elements in vecParams.

Details

This is an S3 generic function. Call methods("PCMPriorDensity") to see implementing methods.