This function evaluates the posterior distribution at theta and returns the result in a suitable format for mcmcMh.

dLogPosterior(fitmodel, theta, initState, data, margLogLike = dTrajObs, ...)

Arguments

fitmodel

a fitmodel object

theta

named numeric vector. Values of the parameters. Names should match fitmodel$thetaNames.

initState

named numeric vector. Initial values of the state variables. Names should match fitmodel$stateNames.

data

data frame. Observation times and observed data. The time column must be named "time" and the observation column must be named "obs".

margLogLike

R-function to compute the marginal log-likelihood of theta.

...

further arguments to be passed to margLogLike

Value

a list of two elements

  • logDensity numeric, logged value of the posterior density evaluated at theta

  • trace named vector with trace information (theta, logPrior, margLogLike, logPosterior)