The type of conditions on the element.
The type of conditions on the element. A condition is a function from a value to a Boolean.
The type of soft constraints on the element.
The type of soft constraints on the element. A constraint is a function from a value to a Double.
The type of randomness content of the element.
The type of randomness content of the element.
The type of values over which the element is defined.
The type of values over which the element is defined.
The arguments on which the element depends.
The arguments on which the element depends.
The probability density of a value.
The probability density of a value.
Convert a distribution from this element into sufficient statistics
Generate the randomness content.
Generate the randomness content.
Generate the value of the element deterministically given its randomness and the values of its arguments.
Generate the value of the element deterministically given its randomness and the values of its arguments.
The element that tests inequality of this element with another element.
The element that tests inequality of this element with another element.
The element that tests whether the value of this element is equal to a particular value.
The element that tests whether the value of this element is equal to a particular value.
The element that tests equality of this element with another element.
The element that tests equality of this element with another element.
Activate the element in its universe.
Activate the element in its universe.
Flag indicating whether the element is currently active in its universe.
Flag indicating whether the element is currently active in its universe.
Add the given condition to the existing conditions of the element.
Add the given condition to the existing conditions of the element. By default, the contingency is empty.
Add a contingent constraint to the element.
Add a contingent constraint to the element. By default, the contingency is empty.
Add a log contingent constraint to the element.
Add a log contingent constraint to the element. By default, the contingency is empty.
Add a pragma to the element.
Add a pragma to the element.
All the conditions defined on this element.
All the conditions defined on this element.
The current soft constraints on the element.
The current soft constraints on the element.
Clears all the temporary elements associated with this element (all elements created in it's context).
Clears all the temporary elements associated with this element (all elements created in it's context).
The element collection to which this element belongs
The element collection to which this element belongs
Tests whether all the element's contingent conditions are satisfied for the given value.
Tests whether all the element's contingent conditions are satisfied for the given value.
Determines whether the condition on the element is satisfied by the current value.
Determines whether the condition on the element is satisfied by the current value.
Gets the result of all the element's contingent constraints for the given value.
Gets the result of all the element's contingent constraints for the given value.
Determines the value of the constraint on the element applied to the current value.
Determines the value of the constraint on the element applied to the current value.
The elements on which the existence of this element depends.
The elements on which the existence of this element depends.
Deactivate the element in its universe.
Deactivate the element in its universe.
Returns the set of elements directly created in the context of this element.
Returns the set of elements directly created in the context of this element.
Convert a distribution from this element into sufficient statistics for the specified parameter
Convert a distribution from this element into sufficient statistics for the specified parameter
Returns the elements that this element is contingent on.
Returns the elements that this element is contingent on. These are elements that are required to have a certain value for a condition or constraint to be relevant to this element. The contingency is required because conditions and constraints can be applied to references that are uncertain. Every possible element that could be pointed to by a reference must be given the condition or constraint, but the condition or constraint only applies if the elements earlier in the reference have the required value.
Figaro takes care of handling all this under the hood. However, some algorithms may need to know which elements an element is contingent on. For example, sampling algorithms may need to sample those other elements first. This method is supplied to support this use case.
First generate the randomness, then generate the value given the randomness.
First generate the randomness, then generate the value given the randomness. Store the results in randomness and value.
The cacheability of the element.
The cacheability of the element. Chains create caches of their parent values, and it is useful to know when these values can be effectively cached and reused. In general, continuous distributions are not cacheable.
Returns true if this element is temporary, that is, was created in the context of another element.
Returns true if this element is temporary, that is, was created in the context of another element.
The name of the element
The name of the element
Generate the next randomness given the current randomness.
Generate the next randomness given the current randomness. Returns three values: The next randomness, the Metropolis-Hastings proposal probability ratio, which is:
P(new -> old) / P(old -> new)
and the model probability ratio, which is:
P(new) / P(old)
The default implementation is to use generateRandomness and returns ones for the proposal and model probability ratios.
Condition the element by observing a particular value.
Condition the element by observing a particular value. Propagates the effect to dependent elements and ensures that no other value for the element can be generated.
The parameter for this element.
The parameter for this element.
The pragmas attached to the element.
The pragmas attached to the element.
The current randomness content of the element.
The current randomness content of the element.
Remove all conditions associated with the given contingency.
Remove all conditions associated with the given contingency. By default, the contingency is empty.
Remove all constraints associated with the given contingency.
Remove all constraints associated with the given contingency. By default, the contingency is empty.
Remove a pragma from the element.
Remove a pragma from the element.
Compute the constraints on the new value divided by the constraints on the old value.
Compute the constraints on the new value divided by the constraints on the old value.
Set the value of this element and propagate the effects to elements that depend on it without changing their randomness.
Set the value of this element and propagate the effects to elements that depend on it without changing their randomness. Also disallows the value of the element to change until unobserve or unset is called.
Set the condition associated with the contingency.
Set the condition associated with the contingency. Removes previous conditions associated with the contingency. By default, the contingency is empty.
Set the constraint associated with the contingency.
Set the constraint associated with the contingency. Removes previous constraints associated with the contingency. By default, the contingency is empty.
Set the log constraint associated with the contingency.
Set the log constraint associated with the contingency. Removes previous constraints associated with the contingency. By default, the contingency is empty.
Set the randomness of this element.
Set the randomness of this element.
Will generate its value using the new randomness and propagate the effects to elements that depend on it without changing their randomness.
A string that is the element's name, if it has a non-empty one, otherwise the result of the element's toString.
A string that is the element's name, if it has a non-empty one, otherwise the result of the element's toString.
The universe in which the element is defined.
The universe in which the element is defined.
Removes conditions on the element and allows different values of the element to be generated.
Removes conditions on the element and allows different values of the element to be generated.
Allows different values of the element to be generated.
Allows different values of the element to be generated.
The current value of the element.
The current value of the element.