calibr8.contrib.studentt
This module implements reusable calibration models with Students-t distributions for the dependent variable.
- class calibr8.contrib.studentt.BaseAsymmetricLogisticT(*, independent_key: str, dependent_key: str, scale_degree: int = 0, theta_names: Sequence[str] | None = None)
Bases:
ContinuousUnivariateModel
,StudentTNoise
- Attributes:
- pymc_dist
theta_fitted
The parameter vector that describes the fitted model.
theta_guess
Initial guess that was used to fit the model.
theta_names
Names of model parameters in a fixed order.
theta_timestamp
The timestamp when theta_fitted was set.
Methods
infer_independent
(y, *, lower, upper[, ...])Infer the posterior distribution of the independent variable given the observations of the dependent variable.
likelihood
(*, y, x[, theta, scan_x])Likelihood of observation (dependent variable) given the independent variable.
load
(filepath)Instantiates a model from a JSON file of key properties.
loglikelihood
(*, y, x[, name, replicate_id, ...])Loglikelihood of observation (dependent variable) given the independent variable.
objective
(independent, dependent[, minimize])Creates an objective function for fitting to data.
predict_dependent
(x, *[, theta])Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
predict_independent
(y, *[, theta])Predict the independent variable using the inverse trend model.
save
(filepath)Save key properties of the calibration model to a JSON file.
scipy_dist
to_pymc
to_scipy
- predict_dependent(x, *, theta=None)
Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
- Parameters:
- xarray-like
values of the independent variable
- thetaoptional, array-like
- parameter vector of the calibration model:
5 parameters of asymmetric logistic model for mu [scale_degree] parameters for scale (lowest degree first) 1 parameter for degree of freedom
- Returns:
- muarray-like
values for the mu parameter of a Student-t distribution describing the dependent variable
- scalearray-like or float
values for the scale parameter of a Student-t distribution describing the dependent variable
- dffloat
degree of freedom of Student-t distribution
- predict_independent(y, *, theta=None)
Predict the independent variable using the inverse trend model.
- Parameters:
- yarray-like
observations
- thetaoptional, array-like
- parameter vector of the calibration model:
5 parameters of asymmetric logistic model for mu [scale_degree] parameters for scale (lowest degree first) 1 parameter for degree of freedom
- Returns:
- xarray-like
predicted independent values given the observations
- class calibr8.contrib.studentt.BaseExponentialModelT(*, independent_key: str, dependent_key: str, scale_degree: int = 0, fixed_intercept: float | None = None, theta_names: Sequence[str] | None = None)
Bases:
ContinuousUnivariateModel
,StudentTNoise
- Attributes:
- pymc_dist
theta_fitted
The parameter vector that describes the fitted model.
theta_guess
Initial guess that was used to fit the model.
theta_names
Names of model parameters in a fixed order.
theta_timestamp
The timestamp when theta_fitted was set.
Methods
infer_independent
(y, *, lower, upper[, ...])Infer the posterior distribution of the independent variable given the observations of the dependent variable.
likelihood
(*, y, x[, theta, scan_x])Likelihood of observation (dependent variable) given the independent variable.
load
(filepath)Instantiates a model from a JSON file of key properties.
loglikelihood
(*, y, x[, name, replicate_id, ...])Loglikelihood of observation (dependent variable) given the independent variable.
objective
(independent, dependent[, minimize])Creates an objective function for fitting to data.
predict_dependent
(x, *[, theta])Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
predict_independent
(y, *[, theta])Predict the independent variable using the inverse trend model.
save
(filepath)Save key properties of the calibration model to a JSON file.
scipy_dist
to_pymc
to_scipy
- predict_dependent(x, *, theta=None)
Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
- Parameters:
- xarray-like
Values of the independent variable.
- thetaoptional, array-like
Parameter vector of the calibration model. Depending on the
fixed_intercept
setting these are [I, L, k] or [L, k] parameters of exponential model for mu. Followed by parameters for the model for scale (lowest degree first). Followed by the degree of freedom parameter.
- Returns:
- muarray-like
Values for the mu parameter of a Student-t distribution describing the dependent variable.
- scalearray-like or float
Values for the scale parameter of a Student-t distribution describing the dependent variable.
- dffloat
Degree of freedom of Student-t distribution.
- predict_independent(y, *, theta=None)
Predict the independent variable using the inverse trend model.
- Parameters:
- yarray-like
Observations
- thetaoptional, array-like
Parameter vector of the calibration model. Depending on the
fixed_intercept
setting these are [I, L, k] or [L, k] parameters of exponential model for mu. Followed by parameters for the model for scale (lowest degree first). Followed by the degree of freedom parameter.
- Returns:
- xarray-like
Predicted independent values given the observations.
- class calibr8.contrib.studentt.BaseLogIndependentAsymmetricLogisticT(*, independent_key: str, dependent_key: str, scale_degree: int = 0, theta_names: Sequence[str] | None = None)
Bases:
ContinuousUnivariateModel
,StudentTNoise
- Attributes:
- pymc_dist
theta_fitted
The parameter vector that describes the fitted model.
theta_guess
Initial guess that was used to fit the model.
theta_names
Names of model parameters in a fixed order.
theta_timestamp
The timestamp when theta_fitted was set.
Methods
infer_independent
(y, *, lower, upper[, ...])Infer the posterior distribution of the independent variable given the observations of the dependent variable.
likelihood
(*, y, x[, theta, scan_x])Likelihood of observation (dependent variable) given the independent variable.
load
(filepath)Instantiates a model from a JSON file of key properties.
loglikelihood
(*, y, x[, name, replicate_id, ...])Loglikelihood of observation (dependent variable) given the independent variable.
objective
(independent, dependent[, minimize])Creates an objective function for fitting to data.
predict_dependent
(x, *[, theta])Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
predict_independent
(y, *[, theta])Predict the independent variable using the inverse trend model.
save
(filepath)Save key properties of the calibration model to a JSON file.
scipy_dist
to_pymc
to_scipy
- predict_dependent(x, *, theta=None)
Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
- Parameters:
- xarray-like
values of the independent variable
- thetaoptional, array-like
- parameter vector of the calibration model:
5 parameters of log-independent asymmetric logistic model for mu [scale_degree] parameters for scale (lowest degree first) 1 parameter for degree of freedom
- Returns:
- muarray-like
values for the mu parameter of a Student-t distribution describing the dependent variable
- scalearray-like or float
values for the scale parameter of a Student-t distribution describing the dependent variable
- dffloat
degree of freedom of Student-t distribution
- predict_independent(y, *, theta=None)
Predict the independent variable using the inverse trend model.
- Parameters:
- yarray-like
observations
- thetaoptional, array-like
- parameter vector of the calibration model:
5 parameters of log-independent asymmetric logistic model for mu [scale_degree] parameters for scale (lowest degree first) 1 parameter for degree of freedom
- Returns:
- xarray-like
predicted independent values given the observations
- class calibr8.contrib.studentt.BaseModelT(independent_key: str, dependent_key: str, *, theta_names: Tuple[str])
Bases:
ContinuousUnivariateModel
,StudentTNoise
- Attributes:
- pymc_dist
theta_fitted
The parameter vector that describes the fitted model.
theta_guess
Initial guess that was used to fit the model.
theta_names
Names of model parameters in a fixed order.
theta_timestamp
The timestamp when theta_fitted was set.
Methods
infer_independent
(y, *, lower, upper[, ...])Infer the posterior distribution of the independent variable given the observations of the dependent variable.
likelihood
(*, y, x[, theta, scan_x])Likelihood of observation (dependent variable) given the independent variable.
load
(filepath)Instantiates a model from a JSON file of key properties.
loglikelihood
(*, y, x[, name, replicate_id, ...])Loglikelihood of observation (dependent variable) given the independent variable.
objective
(independent, dependent[, minimize])Creates an objective function for fitting to data.
predict_dependent
(x, *[, theta])Predicts the parameters of a probability distribution which characterises
predict_independent
(y, *[, theta])Predict the independent variable using the inverse trend model.
save
(filepath)Save key properties of the calibration model to a JSON file.
scipy_dist
to_pymc
to_scipy
- class calibr8.contrib.studentt.BasePolynomialModelT(*, independent_key: str, dependent_key: str, mu_degree: int, scale_degree: int = 0, theta_names: Sequence[str] | None = None)
Bases:
ContinuousUnivariateModel
,StudentTNoise
- Attributes:
- pymc_dist
theta_fitted
The parameter vector that describes the fitted model.
theta_guess
Initial guess that was used to fit the model.
theta_names
Names of model parameters in a fixed order.
theta_timestamp
The timestamp when theta_fitted was set.
Methods
infer_independent
(y, *, lower, upper[, ...])Infer the posterior distribution of the independent variable given the observations of the dependent variable.
likelihood
(*, y, x[, theta, scan_x])Likelihood of observation (dependent variable) given the independent variable.
load
(filepath)Instantiates a model from a JSON file of key properties.
loglikelihood
(*, y, x[, name, replicate_id, ...])Loglikelihood of observation (dependent variable) given the independent variable.
objective
(independent, dependent[, minimize])Creates an objective function for fitting to data.
predict_dependent
(x, *[, theta])Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
predict_independent
(y, *[, theta])Predict the independent variable using the inverse trend model.
save
(filepath)Save key properties of the calibration model to a JSON file.
scipy_dist
to_pymc
to_scipy
- predict_dependent(x, *, theta=None)
Predicts the parameters mu and scale of a Student-t distribution which characterizes the dependent variable given values of the independent variable.
- Parameters:
- xarray-like
values of the independent variable
- thetaoptional, array-like
- parameter vector of the calibration model:
[mu_degree] parameters for mu (lowest degree first) [scale_degree] parameters for scale (lowest degree first) 1 parameter for degree of freedom
- Returns:
- muarray-like
values for the mu parameter of a Student-t distribution describing the dependent variable
- scalearray-like or float
values for the scale parameter of a Student-t distribution describing the dependent variable
- dffloat
degree of freedom of Student-t distribution
- predict_independent(y, *, theta=None)
Predict the independent variable using the inverse trend model.
- Parameters:
- yarray-like
observations
- thetaoptional, array-like
- parameter vector of the calibration model:
[mu_degree] parameters for mu (lowest degree first) [scale_degree] parameters for scale (lowest degree first) 1 parameter for degree of freedom
- Returns:
- xarray-like
predicted independent values given the observations