openest.models.model module

class openest.models.model.Attribute(title, description, reference, subtitle, value, comments, source)[source]

Bases: object

An attribute is an arbitrary piece of information about a model, available from the attribute functions on Model.

class openest.models.model.Model(scaled=True)[source]

Bases: object

Model class

Top level Model class, from which all specific model derive. All models should implement most of these functions (with the notable exceptions of merge and combine).

attribute_list()[source]
static combine(models, factors)[source]

Construct a weighted sum over the shared values of x

Each form provides methods for constructing the distribution of the sum of multiple parameters, which is generally constructed by performing the convolution: $p(y + z | x) = p_y(y | x) * p_z(z | x)$.

combiners = {'bin_model+bin_model': <function combine at 0x7fc8b76f1758>, 'bin_model+ddp_model': <function <lambda> at 0x7fc8b76f1848>, 'bin_model+spline_model': <function <lambda> at 0x7fc8b76f18c0>, 'ddp_model+ddp_model': <function combine at 0x7fc8b76f2848>, 'delta_model+ddp_model': <function combine at 0x7fc8b32e5140>, 'delta_model+delta_model': <function combine at 0x7fc8b32e5140>, 'delta_model+spline_model': <function combine at 0x7fc8b32e5140>, 'mean_size_model+mean_size_model': <function combine at 0x7fc8b31ec578>, 'spline_model+ddp_model': <function <lambda> at 0x7fc8b76f28c0>, 'spline_model+spline_model': <function combine at 0x7fc8b76e97d0>}
copy()[source]
draw_sample(x=None)[source]

Produce a sample value of y from the conditional distribution.

eval_pval(x, p, threshold=0.001)[source]

Inverse CDF Evaluation

Returns the value of $y$ that corresponds to a given p-value: $F^{-1}(p | x)$.

get_attribute(title)[source]
get_mean(x=None)[source]

E[Y | X]

get_sdev(x=None)[source]

sqrt Var[Y | X]

kind()[source]
static merge(models)[source]

Pooling Merging

Each form provides methods for producing a pooled parameter estimate from multiple parameter estimates. These could all be parameter estimates with the same form, or with two different forms: $p_1(y | x) p_2(y | x)$.

mergers = {'bin_model': <function merge at 0x7fc8b76f16e0>, 'bin_model+ddp_model': <function <lambda> at 0x7fc8b76f2aa0>, 'bin_model+spline_model': <function <lambda> at 0x7fc8b76f17d0>, 'ddp_model': <function merge at 0x7fc8b76f27d0>, 'delta_model': <function merge at 0x7fc8b32e50c8>, 'delta_model+ddp_model': <function merge at 0x7fc8b32e50c8>, 'delta_model+spline_model': <function merge at 0x7fc8b32e50c8>, 'mean_size_model': <function merge at 0x7fc8b31ec500>, 'spline_model': <function merge at 0x7fc8b76e9758>, 'spline_model+ddp_model': <function <lambda> at 0x7fc8b76e78c0>}
scale_p(a)[source]

Raise the distribution to the power ‘a’ and rescales.

Returns:modifies this model and returns it
Return type:self
scale_y(a)[source]

Rescaling of the Parameter Dimension

Produces a new conditional PDF with the $y$ dimension scaled by a constant: $p(z | x) = p(

rac{y}{a} | x)$.

to_points_at(x, ys)[source]

Conditional Probability Density Evaluation

Returns unscaled probability density values for given values of $x$ and $y$: $f(y | x)$.