TransformationDist#
- class liesel_ptm.TransformationDist(coef, bspline, parametric_distribution=None, reference_distribution=None, validate_args=False, allow_nan_stats=True, name='TransformationDist', centered=False, scaled=False, batched=True, **parametric_distribution_kwargs)[source]#
Bases:
Distribution
Transformation distribution using a spline and optional parametric component.
This combines a spline-based monotonically increasing transformation with a parametric distribution, using a reference distribution (default: standard normal) for mapping and likelihoods.
- Parameters:
coef (
Any
) – Coefficients for the spline basis.bspline (
PTMSpline
|OnionSpline
) – Spline object providing transformation and its inverse/derivative.parametric_distribution (
type
[Distribution
] |None
) – Parametric distribution class to include in the model. (default:None
)reference_distribution (
Distribution
|None
) – Reference distribution used for transformations; defaults to Normal(0, 1). (default:None
)validate_args (
bool
) – Whether to validate input arguments. (default:False
)allow_nan_stats (
bool
) – Whether to allow NaN statistics. (default:True
)name (
str
) – Name of the distribution. (default:'TransformationDist'
)centered (
bool
) – If True, the transformation is centered such that any side-effect the spline transformation might have on the location of the distribution is negated. (default:False
)scaled (
bool
) – If True, the transformation is scaled such that any side-effect the spline transformation might have on the scale of the distribution is negated. (default:False
)batched (
bool
) – If True, allow for batched computations (might be slightly less efficient in the scalar case). (default:True
)**parametric_distribution_kwargs – Additional keyword arguments passed to the parametric distribution.
- coef#
Coefficients for the spline basis.
- bspline#
Spline object used for transformations.
- reference_distribution#
Reference distribution used for mapping and likelihoods.
- parametric_distribution#
Instantiated parametric distribution if provided, else None.
- parametric_distribution_kwargs#
Keyword arguments used to construct the parametric distribution.
- centered#
Indicates whether centering is applied.
- scaled#
Indicates whether scaling is applied.
Methods
CDF under the spline-only transformation.
Inverse transformation combining parametric and spline parts.
Inverse of the parametric transformation.
Inverse of the spline transformation.
Log probability under the spline-only transformation.
Probability under the spline-only transformation.
Quantile function using only the spline transformation.
Apply parametric then spline transforms; return value and logdet.
Apply the parametric transformation and its log determinant.
Apply spline transformation with centering/scaling and compute logdet.
Expected value under the spline transformation.
Variance under the spline transformation.
Attributes