Data Likelihoods
ProbNumDiffEq.fenrir_data_loglik — Function
fenrir_data_loglik(
prob::SciMLBase.AbstractODEProblem,
alg::ODEFilter,
args...;
observation_matrix,
observation_noise_cov,
data,
kwargs...
)
Compute the Fenrir Tronarp et al. (2022) approximate negative log-likelihood (NLL) of the data.
This is a convenience function that
- Solves the ODE with a
ProbNumDiffEq.EK1of the specified order and with a diffusion as provided by thediffusion_varargument, and - Fits the ODE posterior to the data via Kalman filtering and thereby computes the log-likelihood of the data on the way.
You can control the step-size behaviour of the solver as you would for a standard ODE solve, but additionally the solver always steps through the data.t locations by adding them to tstops.
You can also choose steps adaptively by setting adaptive=true, but this is not well-tested so use at your own risk!
Arguments
prob::SciMLBase.AbstractODEProblem: the initial value problem of interestalg::ODEFilter: the probabilistic ODE solver to be used; useEK1for best results.data::NamedTuple{(:t, :u)}: the data to be fittedobservation_matrix::Union{AbstractMatrix,UniformScaling}: the matrix which maps the ODE state to the measurements; typically a projection matrix. For second-order ODEs, it acts onuonly, not ondu. Its rows must not be zero. Observation matrices other thanI(or a multiple of it), e.g. for partial observations (o < d), work with all solvers except theEK0with anIWPprior and a scalar diffusion, as by default. With a block-diagonal covariance (theDiagonalEK1, or theEK0with a multivariate diffusion), observation matrices must select dimensions, i.e. each row must have exactly one nonzero entry (any scaling is fine) and no dimension may be observed twice.observation_noise_cov::Union{Number,UniformScaling,AbstractMatrix}: the observation noise covariance, or a scalar variance. With a block-diagonal covariance it must be a scalar, aUniformScalingor aDiagonal, and with theEK0with anIWPprior and a scalar diffusion a scalar, aUniformScalingor anEye.
Reference
- Tronarp et al. (2022) "Fenrir: Physics-Enhanced Regression for Initial Value Problems", ICML
ProbNumDiffEq.dalton_data_loglik — Function
dalton_data_loglik(
prob::SciMLBase.AbstractODEProblem,
alg::ODEFilter,
args...;
observation_matrix,
observation_noise_cov,
data,
kwargs...
)
Compute the DALTON Wu & Lysy (2023) approximate negative log-likelihood (NLL) of the data.
You can control the step-size behaviour of the solver as you would for a standard ODE solve, but additionally the solver always steps through the data.t locations by adding them to tstops. You can also choose steps adaptively by setting adaptive=true, but this is not well-tested so use at your own risk!
Arguments
prob::SciMLBase.AbstractODEProblem: the initial value problem of interestalg::ODEFilter: the probabilistic ODE solver to be used; useEK1for best results.data::NamedTuple{(:t, :u)}: the data to be fittedobservation_matrix::Union{AbstractMatrix,UniformScaling}: the matrix which maps the ODE state to the measurements; typically a projection matrix. For second-order ODEs, it acts onuonly, not ondu. Its rows must not be zero. Observation matrices other thanI(or a multiple of it), e.g. for partial observations (o < d), work with all solvers except theEK0with anIWPprior and a scalar diffusion, as by default. With a block-diagonal covariance (theDiagonalEK1, or theEK0with a multivariate diffusion), observation matrices must select dimensions, i.e. each row must have exactly one nonzero entry (any scaling is fine) and no dimension may be observed twice.observation_noise_cov::Union{Number,UniformScaling,AbstractMatrix}: the observation noise covariance, or a scalar variance. With a block-diagonal covariance it must be a scalar, aUniformScalingor aDiagonal, and with theEK0with anIWPprior and a scalar diffusion a scalar, aUniformScalingor anEye.
Reference
- Wu & Lysy (2023) "Data-Adaptive Probabilistic Likelihood Approximation for Ordinary Differential Equations"