Data Fitting and Model Calibration

EasyModelAnalysis.datafitFunction
datafit(prob, p, t, data)
datafit(prob, p, data)

Fit parameters p to data measured at times t.

Arguments

  • prob: ODEProblem
  • p: Vector of pairs of symbolic parameters and initial guesses for the parameters.
  • t: Vector of time-points
  • data: Vector of pairs of symbolic states and measurements of these states at times t.

Keyword Arguments

- `loss`: the loss function used for fitting. Defaults to `EasyModelAnalysis.l2loss`,
  with an alternative being `EasyModelAnalysis.relative_l2loss` for relative weighted error.

p does not have to contain all the parameters required to solve prob, it can be a subset of parameters. Other parameters necessary to solve prob default to the parameter values found in prob.p. Similarly, not all states must be measured.

Data Definition

The data definition is given as a vctor of pairs. If t is specified globally for the datafit, then those time series correspond to the time points specified. For example,

[x => [11.352378507900013, 11.818374125301172, -10.72999081810307]
 z => [2.005502877055581, 13.626953144513832, 5.382984515620634, 12.232084518374545]]

then if datafit(prob, p, t, data), t must be length 3 and these values correspond to x(t[i]).

If datafit(prob, p, data), then the data must be a tuple of (t, timeseries), for example:

[x => ([1.0, 2.0, 3.0], [11.352378507900013, 11.818374125301172, -10.72999081810307])
 z => ([0.5, 1.5, 2.5, 3.5],
     [2.005502877055581, 13.626953144513832, 5.382984515620634, 12.232084518374545])]

where this means x(2.0) == 11.81...

source
EasyModelAnalysis.global_datafitFunction
global_datafit(prob, pbounds, t, data; maxiters = 10000)
global_datafit(prob, pbounds, data; maxiters = 10000)

Fit parameters p to data measured at times t.

Arguments

  • prob: ODEProblem
  • pbounds: Vector of pairs of symbolic parameters to vectors of lower and upper bounds for the parameters.
  • t: Vector of time-points
  • data: Vector of pairs of symbolic states and measurements of these states at times t.

Keyword Arguments

  • maxiters: how long to run the optimization for. Defaults to 10000. Larger values are slower but more robust.
  • loss: the loss function used for fitting. Defaults to EasyModelAnalysis.l2loss, with an alternative being EasyModelAnalysis.relative_l2loss for relative weighted error.

p does not have to contain all the parameters required to solve prob, it can be a subset of parameters. Other parameters necessary to solve prob default to the parameter values found in prob.p. Similarly, not all states must be measured.

Data Definition

The data definition is given as a vctor of pairs. If t is specified globally for the datafit, then those time series correspond to the time points specified. For example,

[x => [11.352378507900013, 11.818374125301172, -10.72999081810307]
 z => [2.005502877055581, 13.626953144513832, 5.382984515620634, 12.232084518374545]]

then if datafit(prob, p, t, data), t must be length 3 and these values correspond to x(t[i]).

If datafit(prob, p, data), then the data must be a tuple of (t, timeseries), for example:

[x => ([1.0, 2.0, 3.0], [11.352378507900013, 11.818374125301172, -10.72999081810307])
 z => ([0.5, 1.5, 2.5, 3.5],
     [2.005502877055581, 13.626953144513832, 5.382984515620634, 12.232084518374545])]

where this means x(2.0) == 11.81...

source
EasyModelAnalysis.bayesian_datafitFunction
bayesian_datafit(prob, p, t, data)
bayesian_datafit(prob, p, data)

Calculate posterior distribution for parameters p given data measured at times t.

Data Definition

The data definition is given as a vctor of pairs. If t is specified globally for the datafit, then those time series correspond to the time points specified. For example,

[x => [11.352378507900013, 11.818374125301172, -10.72999081810307]
 z => [2.005502877055581, 13.626953144513832, 5.382984515620634, 12.232084518374545]]

then if datafit(prob, p, t, data), t must be length 3 and these values correspond to x(t[i]).

If datafit(prob, p, data), then the data must be a tuple of (t, timeseries), for example:

[x => ([1.0, 2.0, 3.0], [11.352378507900013, 11.818374125301172, -10.72999081810307])
 z => ([0.5, 1.5, 2.5, 3.5],
     [2.005502877055581, 13.626953144513832, 5.382984515620634, 12.232084518374545])]

where this means x(2.0) == 11.81...

source