reno.ops.Observation#
- class reno.ops.Observation(ref, sigma=1.0, data=None)#
Bases:
DistributionRepresents a Normal distribution around an observed value.
Should only be used for supplying observational data with likelihoods to bayesian models constructed with model.pymc()
- Parameters:
ref (reno.components.Reference) – The equation to supply an observed value for.
sigma (float) – The std dev to use for the likelihood Normal distribution.
data (list) – The actual observed data to apply.
Methods
__init__(ref[, sigma, data])Create a distribution equation part, this is likely being called from a subclass.
add_tensors(pymc_model)astype(dtype)Returns a symbolic operation to convert the output of this equation to the specified type.
clean_part_repr(part_index)Get a non-"Scalar()" string version of a particular sub equation part.
clip(min, max)Returns a symbolic operation for enforcing the output is between the passed min and max.
equal(obj)Returns a symbolic operation for checking equality with passed object.
eval([t, save, force])Get the vector of samples pulled from the probability distribution.
find_parts_of_type(search_type[, ...])Recursively search for all EquationParts in the tree of the specified type.
get_shape()Get the size of the additional "data" dimension.
get_type()Get the type of the target output of this equation expression.
is_static()Convenience shortcut for
reno.utils.is_static()- True if this equation doesn't rely on any dynamic values (thus constant), False if it does.latex(**kwargs)Construct a string representation of this portion of the equation for use in a latex display.
mean([axis])Returns a symbolic operation to find the series-wise mean of the array.
not_equal(obj)Returns a symbolic operation for checking inequality with passed object.
populate(n[, steps, dim])Generate n x dim samples based on this probability distribution, assigns as a vector/matrix to
self.value.pt(**refs)Get a pytensor graph representing this piece of an equation.
pt_str(**refs)Construct a string containing relevant pytensor code for this piece of the equation.
seek_refs([include_ref_types])Recursively find a list of all References immediately underneath this part.
series_max()Returns a symbolic operation to find the series-wise maximum of the array.
series_min()Returns a symbolic operation to find the series-wise minimum of the array.
sum([axis])Returns a symbolic operation to find the series-wise sum of the array.
Attributes
dtypeThe type of each underlying value.
shapeThe size of the data dimension, 1 by default.
timeseriesReturns symbolic operation for getting a timeseries view of the data.
- __annotations__ = {}#
- __module__ = 'reno.ops'#
- add_tensors(pymc_model)#
- Parameters:
pymc_model (Model)
- Return type:
None
- pt(**refs)#
Get a pytensor graph representing this piece of an equation.
- Parameters:
refs (dict[str, TensorVariable])
- Return type:
TensorVariable
- pt_str(**refs)#
Construct a string containing relevant pytensor code for this piece of the equation. This is useful for “compiling” into pymc code.
- Parameters:
refs (dict[str, str])
- Return type:
str