Compute the distance (using distanceAbc) between the observed time series and a simulated time series of observations obtained by running the model with parameters theta.

computeDistanceAbc(sumStats, distanceAbc, fitmodel, theta, initState, data)

Arguments

sumStats

a list of functions to calculate summary statistics. Each of these takes one argument (a trajectory with an "obs" column) and returns a number (the summary statistic given the trajectory)

distanceAbc

a function that take three arguments: sumStats, a list of summary statistics, dataObs (the data trajectory of observations) and modelObs (a model trajectory of observations), and returns the distance between the model run and the data in terms of the summary statistics

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

Value

a sampled distance between