calc_prior: Compute the log-prior for a paremeter set

Description Usage Arguments Details Value

View source: R/bayesian.R

Description

The land model parameters are extracted from the ScenarioInfo object supplied. The xi parameter isn't stored in the ScenarioInfo structure, so it must be supplied separately. Multiple xi values in a vector are allowed. The prior must also be supplied as a function. It should take a named list of parameter vectors and compute the log prior for those parameters

Usage

1
calc_prior(aScenarioInfo, xi, lprior)

Arguments

aScenarioInfo

ScenarioInfo structure for the scenario.

xi

Vector of xi parameter values

lprior

Function that calculates the log-prior (see details). Default applies a uniform prior.

Details

The design of the prior function is trying to walk a tightrope between convenience, flexibility, and extensibility. Right now the parameters are expectation.type (character), share.old and linear.years (double, only defined for certain types), logit.agforest, logit.afnonpast, logit.crop, and xi (all double, and all defined for all models). The purpose of passing them in a list is to ensure that we can easily add new parameters if we want to.

Also note that because a couple of the parameters are defined only for certain expectation types, a prior function will have to handle those cases correctly.

Finally, note that the list actually passed to the prior function may contain extra junk variables (to avoid having to waste time dropping columns that aren't needed.) The prior function should ignore these.

Value

Vector of log-prior values


JGCRI/gcamland documentation built on Oct. 6, 2020, 5:30 p.m.