# Data Likelihoods

`ProbNumDiffEq.fenrir_data_loglik`

— Function```
fenrir_data_loglik(
prob::SciMLBase.AbstractODEProblem,
alg::ProbNumDiffEq.AbstractEK,
args...;
observation_matrix,
observation_noise_cov,
data,
kwargs...
)
```

Compute the Fenrir [3] approximate negative log-likelihood (NLL) of the data.

This is a convenience function that

- Solves the ODE with a
`ProbNumDiffEq.EK1`

of the specified order and with a diffusion as provided by the`diffusion_var`

argument, 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 interest`alg::AbstractEK`

: 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`observation_noise_cov::Union{Number,AbstractMatrix}`

: the scalar observation noise variance

**Reference**

- [3] Tronarp et al, "Fenrir: Physics-Enhanced Regression for Initial Value Problems", ICML (2022)

`ProbNumDiffEq.dalton_data_loglik`

— Function```
dalton_data_loglik(
prob::SciMLBase.AbstractODEProblem,
alg::ProbNumDiffEq.AbstractEK,
args...;
observation_matrix,
observation_noise_cov,
data,
kwargs...
)
```

Compute the DALTON [10] 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::AbstractEK`

: 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`observation_noise_cov::Union{Number,AbstractMatrix}`

: the scalar observation noise variance

**Reference**

- [10] Wu et al, "Data-Adaptive Probabilistic Likelihood Approximation for Ordinary Differential Equations", arXiv (2023)