calcprior {MQMF} | R Documentation |
calcprior return the sum of a vector of constant values as priors
Description
calcprior is used to include a prior probability into Bayesian calculations. calcprior is a template for generating such priors. The default given here is to return a constant small number for the prior probability, it needs to sum to 1.0 across the replicates returned by do_MCMC. If non-uniform priors are required write a different function and in do_MCMC point priorcalc at it. Whatever function you define needs to have the same input parameters as this calcprior, i.e. the parameters and N. If something else if required then do_MCMC will need modification in the two places where priorcalc is used. Alternatively, the ellipsis, ..., might be used.
Usage
calcprior(pars, N)
Arguments
pars |
the parameters of the model being examined by the MCMC |
N |
the number of replicate parameter vectors to be returned from do_MCMC, remember to include the burn-in replicates |
Value
the sum of a vector of small constant values to act as priors.
Examples
param <- log(c(0.4,9400,3400,0.05))
calcprior(pars=param,N=20000) # should give -39.61395