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

  1. Solves the ODE with a ProbNumDiffEq.EK1 of the specified order and with a diffusion as provided by the diffusion_var argument, and
  2. 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 interest
  • alg::ODEFilter: the probabilistic ODE solver to be used; use EK1 for best results.
  • data::NamedTuple{(:t, :u)}: the data to be fitted
  • observation_matrix::Union{AbstractMatrix,UniformScaling}: the matrix which maps the ODE state to the measurements; typically a projection matrix. For second-order ODEs, it acts on u only, not on du. Its rows must not be zero. Observation matrices other than I (or a multiple of it), e.g. for partial observations (o < d), work with all solvers except the EK0 with an IWP prior and a scalar diffusion, as by default. With a block-diagonal covariance (the DiagonalEK1, or the EK0 with 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, a UniformScaling or a Diagonal, and with the EK0 with an IWP prior and a scalar diffusion a scalar, a UniformScaling or an Eye.

Reference

source
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 interest
  • alg::ODEFilter: the probabilistic ODE solver to be used; use EK1 for best results.
  • data::NamedTuple{(:t, :u)}: the data to be fitted
  • observation_matrix::Union{AbstractMatrix,UniformScaling}: the matrix which maps the ODE state to the measurements; typically a projection matrix. For second-order ODEs, it acts on u only, not on du. Its rows must not be zero. Observation matrices other than I (or a multiple of it), e.g. for partial observations (o < d), work with all solvers except the EK0 with an IWP prior and a scalar diffusion, as by default. With a block-diagonal covariance (the DiagonalEK1, or the EK0 with 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, a UniformScaling or a Diagonal, and with the EK0 with an IWP prior and a scalar diffusion a scalar, a UniformScaling or an Eye.

Reference

  • Wu & Lysy (2023) "Data-Adaptive Probabilistic Likelihood Approximation for Ordinary Differential Equations"
source