diameter_synthesis.distribution_fitting

Functions to fit distributions to parameters of diameter models.

Functions

evaluate_distribution(value, distribution, ...)

Evaluate the fit of a distribution.

fit_distribution(all_data, distribution[, ...])

Fit a distribution from data.

sample_distribution(model[, rng])

Sample from a distribution.

diameter_synthesis.distribution_fitting.evaluate_distribution(value, distribution, params)

Evaluate the fit of a distribution.

Parameters:
  • value (float) – the position at which the distribution is evaluated.

  • distribution (str) – the name of the distribution.

  • params (dict) – the parameters of the distributions.

Returns:

the value of the distribution at the given position.

Return type:

float

diameter_synthesis.distribution_fitting.fit_distribution(all_data, distribution, attribute_name=None, extra_params=None)

Fit a distribution from data.

Parameters:
  • all_data (list/array) – list of data points to fit a distribution to.

  • distribution (str) – Distribution name.

  • attribute_name (str) – Name of additional attribute to fit.

  • extra_params (dict) – Possible additional parameters for the fit.

Returns:

parameters of the fit.

Return type:

dict

diameter_synthesis.distribution_fitting.sample_distribution(model, rng=numpy.random)

Sample from a distribution.

Parameters:
Returns:

the value of the distribution at the given position.

Return type:

float