openest.models.bin_model module¶
-
class
openest.models.bin_model.BinModel(xx=None, model=None)[source]¶ Bases:
openest.models.univariate_model.UnivariateModel,openest.models.memoizable.MemoizableUnivariateBin Model
A bin model represents bins of different spans, where the distribution is constant over each bin. It is a combination of information describing the bins and an underlying categorical model of one of the other types.
The underlying model is always categorical, with categories starting at 1. 0 is reserved for a future version that allows an out-of-sample distribution
The format is:
bin1 <x0>,<x1>,<x2>, ... <underlying model>
Parameters: - xx (list-like) – List-like array of bin edges. len(xx) should be one more than the number of bins.
- model (object) – Statistical model used in each bin
-
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_bin_at(x)[source]¶ Returns bin containing value x
Parameters: x (numeric) – Value to search for in binned axis Returns: Returns index of bin containing x. If bin is not contained in the bin range, returns -1.Return type: int
-
init_from_bin_file(file, delimiter, status_callback=None, init_submodel=<function <lambda>>)[source]¶
-
scale_p(a)[source]¶ Scales p-values of underlying bin models (in log_p format)
Interface to self.model.scale_p.
-
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)$.