Compute a Monte-Carlo estimate of the log-likelihood of theta for a stochastic model defined in a fitmodel object, using particleFilter

margLogLikeSto(fitmodel, theta, initState, data, nParticles)

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".

nParticles

number of particles

Value

Monte-Carlo estimate of the marginal log-likelihood of theta

See also

particleFilter