amici.gradient_check

Finite Difference Check

This module provides functions to automatically check correctness of amici computed sensitivities using finite difference approximations

Functions

check_derivatives(model, solver[, edata, ...])

Finite differences check for likelihood gradient.

check_finite_difference(x0, model, solver, ...)

Checks the computed sensitivity based derivatives against a finite difference approximation.

amici.gradient_check.check_derivatives(model, solver, edata=None, atol=0.0001, rtol=0.0001, epsilon=0.001, check_least_squares=True, skip_zero_pars=False)[source]

Finite differences check for likelihood gradient.

Parameters:
  • model (amici.amici.Model) – amici model

  • solver (amici.amici.Solver) – amici solver

  • edata (amici.amici.ExpData | None) – exp data

  • atol (float | None) – absolute tolerance for comparison

  • rtol (float | None) – relative tolerance for comparison

  • epsilon (float | None) – finite difference step-size

  • check_least_squares (bool) – whether to check least squares related values.

  • skip_zero_pars (bool) – whether to perform FD checks for parameters that are zero

Return type:

None

amici.gradient_check.check_finite_difference(x0, model, solver, edata, ip, fields, atol=0.0001, rtol=0.0001, epsilon=0.001)[source]

Checks the computed sensitivity based derivatives against a finite difference approximation.

Parameters:
Return type:

None