lamatrix.distributions
Classes to hold distributions, either of priors or of fit values.
Classes
-
class lamatrix.distributions.Distribution(mean, std=None)[source]
Bases: tuple
Special tuple with the ability to “freeze”, i.e. set standard deviation to 0.
-
as_tuple()[source]
Return the distribution as a standard tuple.
-
count(value, /)
Return number of occurrences of value.
-
freeze()[source]
Freeze the distribution by setting the standard deviation to 0.
-
index(value, start=0, stop=sys.maxsize, /)
Return first index of value.
Raises ValueError if the value is not present.
-
property mean
-
sample()[source]
-
property std
-
thaw()[source]
Unfreeze the distribution to restore the original standard deviation.
-
class lamatrix.distributions.DistributionsContainer(distributions: List[Tuple])[source]
Bases: object
Holds distributions
-
freeze()[source]
Freeze all the distributions by setting its standard deviation to 0.
-
static from_dict(dict)[source]
-
static from_number(number_of_distributions: int)[source]
Make a set of empty distributions with a given length
-
get_distributions()[source]
Returns a copy of the distributions.
-
property mean
-
sample()[source]
-
property std
-
thaw()[source]
Thaw all the distributions by setting its standard deviation back to a value.
-
to_dict()[source]