Skip to contents

This returns a function f(simulations), which maps simulation results to log(likelihood) values. The experiments are used implicitly; simulations is a list as returned by rgsl::r_gsl_odeiv2_outer().

Usage

logLikelihoodFunc(experiments, perExpLLF = NULL, simpleUserLLF = NULL)

Arguments

perExpLLF

(optional) a user supplied function with the interface perExpLLF(p,s,e), where p are the parameters, s are the simulations and e are the experiments (with data). Supply this function if some of your experiments need to be normalized by the other experiments (and other complex cases).

simpleUserLLF

(optional) a user supplied function that is used instead of the default sum of ((y-h)/stdv)^2 terms. The interface is: simpleUserLLF(y,h,stdv), where each of them is an N-M-matrix where N is the dimensionality of the model output and M the number of data time-points. Here, y is t(experiments[[i]]$outputValues) and may contain NA values.

experiment

will be compared tp the simulation results

Value

llf(p), a closure (function) of the mcmc-variable: parMCMC; returns a scalar logLikelihood value