probabilistic_model.monte_carlo_estimator#
Classes#
This is a wrapper class for using monte carlo estimations of a model that can be sampled from and where the |
Module Contents#
- class probabilistic_model.monte_carlo_estimator.MonteCarloEstimator(model: probabilistic_model.probabilistic_model.ProbabilisticModel, sample_size: int = 100)#
This is a wrapper class for using monte carlo estimations of a model that can be sampled from and where the likelihood can be evaluated.
- model: probabilistic_model.probabilistic_model.ProbabilisticModel#
The wrapped model.
- sample_size: int#
The number of samples to use for the estimation.
- l1_metric_but_with_uniform_measure(other: probabilistic_model.probabilistic_model.ProbabilisticModel)#
Calculate the L1 metric between the model and another model using a uniform measure over the union of both distributions to sample from.
- Parameters:
other – The other model to compare to.
- Returns:
The L1 metric between the two models.
- l1_metric(other: probabilistic_model.probabilistic_model.ProbabilisticModel, tolerance: float = 1e-07) float#
Estimates the L1 metric between to models.
- Other:
the other model.
- Tolerance:
Tolerance to use for the comparison of likelihoods.
Samples that have a likelihood in both models that differs by less than this tolerance are considered to have an equal likelihood.