PTMLocScalePredictions

PTMLocScalePredictions#

class liesel_ptm.PTMLocScalePredictions(samples, model, y=None, **kwargs)[source]#

Bases: object

Posterior predictions for a penalized transformation model.

Parameters:
  • samples (dict[str, Any]) – Dictionary of posterior samples.

  • model (PTMLocScale) – The model object.

  • y (Optional[Any]) – Response observations to use in predictions. If None``(default), the observed values are extracted from the model object. (default: ``None)

  • **kwargs – Values to use for all terms in the location and scale model parts. Must have appropriate shapes. For terms that are not explicitly specified, the observed values are extracted from the model object.

Methods

predict_cdf

Predicts the response's conditional cumulative distribution function.

predict_loc

Predicts the location.

predict_log_prob

Predicts the response's conditional log probability.

predict_normalization_and_deriv

Predicts the transformed residuals and the derivative of the normalization.

predict_normalization_deriv

Predicts the derivative of the normalization.

predict_normalization_inverse

Predicts the inverse of the normalization function.

predict_pdf

Predicts the response's conditional probability density.

predict_quantile

Predicts the conditional response quantiles at probability level p.

predict_resid_quantile

Predicts the residual quantiles at probability level p.

predict_residual_cdf

Evaluates the residual's posterior cumulative distribution function.

predict_residual_log_prob

Evaluates the residual's posterior log probability function.

predict_residual_pdf

Evaluates the residual's posterior density function.

predict_residuals

Predicts the residuals.

predict_scale

Predicts the location.

predict_transformation

Predicts the transformed residuals.

predict_transformation_deriv

Predicts the derivative of the transformation.

predict_transformation_inverse

Predicts the inverse of the normalization function.

predict_z

Predicts the transformed residuals.

predict_z_deriv

Predicts the derivative of the transformation.

sample

Generates random samples from the posterior predictive distribution.

summarise_density_by_quantiles

Returns a summary dataframe to quickly assess the response's conditional distribution.

summarise_density_by_samples

Returns a summary dataframe to quickly assess the response's conditional distribution based on a random sample from the posterior.

summarise_transformation_by_quantiles

Returns a summary dataframe to quickly assess the transformation function.

Attributes

samples

The posterior samples.

model

The model object.