petab.v1.priors

Functions related to prior handling.

Functions

priors_to_measurements(problem)

Convert priors to measurements.

Classes

Prior(type_, parameters[, bounds, ...])

A PEtab parameter prior.

petab.v1.priors.priors_to_measurements(problem: Problem)[source]

Convert priors to measurements.

Reformulate the given problem such that the objective priors are converted to measurements. This is done by adding a new observable prior_{parameter_id} for each estimated parameter that has an objective prior, and adding a corresponding measurement to the measurement table. The new measurement is the prior distribution itself. The resulting optimization problem will be equivalent to the original problem. This is meant to be used for tools that do not support priors.

The conversion involves the probability density function (PDF) of the prior, the parameters (e.g., location and scale) of that prior PDF, and the scale and value of the estimated parameter. Currently, uniform priors are not supported by this method. This method creates observables with:

  • observableFormula: the parameter value on the parameterScale

  • observableTransformation: log for logNormal/logLaplace distributions, lin otherwise

and measurements with:

  • measurement: the PDF location

  • noiseFormula: the PDF scale

Warning

This function does not account for the truncation of the prior by the bounds in the parameter table. The resulting observable will not be truncated, and the PDF will not be rescaled.

Parameters:

problem – The problem to be converted.

Return type:

The new problem with the priors converted to measurements.