p

# language 

Ordering
1. Alphabetic
Visibility
1. Public
2. All

### Type Members

1. class Aggregate [T, U] extends ReferenceElement[T, U] with ValuesMaker[U]

Aggregate elements based on multi-valued references.

Aggregate elements based on multi-valued references. Note that the values aggregated over are all the values of all elements that are referred to by the reference. If the same element is reachable by more than one path in the reference, its value is only included once. However, if two different referred to elements have the same value, the value is included multiple times. Since the order of these values is immaterial, we use a multiset to represent them.

2. abstract class Apply [U] extends Deterministic[U] with IfArgsCacheable[U]

Abstract base class for elements representing function application.

Abstract base class for elements representing function application. The function is cached to force different applications of the function to the same argument to result in equal values.

3. class Apply1 [T1, U] extends Apply[U]

Application of a function to one argument.

4. class Apply2 [T1, T2, U] extends Apply[U]

Application of a function to two arguments.

5. class Apply3 [T1, T2, T3, U] extends Apply[U]

Application of a function to three arguments.

6. class Apply4 [T1, T2, T3, T4, U] extends Apply[U]

Application of a function to four arguments.

7. class Apply5 [T1, T2, T3, T4, T5, U] extends Apply[U]

Application of a function to five arguments.

8. trait ArrayParameter extends Element[Array[Double]] with Parameter[Array[Double]]
9. trait Atomic [T] extends Element[T] with HasDensity[T]

The Atomic trait characterizes elements that do not depend on any related elements.

10. class AtomicDist [T] extends Dist[Double, T]

A distribution in which the probabilities are constants and the outcomes are Elements.

11. class AtomicFlip extends Element[Boolean] with Atomic[Boolean] with Flip

A coin toss in which the weight is a fixed constant.

12. class AtomicSelect [T] extends Select[Double, T] with Atomic[T]

A distribution in which both the probabilities and the outcomes are values.

A distribution in which both the probabilities and the outcomes are values. Each outcome is chosen with the corresponding probability.

13. trait Cacheable [V] extends Element[V]

Elements whose values can be cached and reused.

14. class CachingChain [T, U] extends Chain[T, U]

A CachingChain is an implementation of Chain with a 1000 element cache.

15. class Chain [T, U] extends Deterministic[U]

A Chain(parent, fcn) represents the process that first generates a value for the parent, then applies fcn to get a new Element, and finally generates a value from that new Element.

A Chain(parent, fcn) represents the process that first generates a value for the parent, then applies fcn to get a new Element, and finally generates a value from that new Element.

Chain is the common base class for caching and non-caching chains. There is no functional difference between caching and non-caching chains. Algorithms can use the distinction to implement a caching procedure.

16. class CompoundDist [T] extends Dist[Element[Double], T]

A distribution in which both the probabilities and outcomes are Elements.

17. class CompoundFlip extends Element[Boolean] with Flip

A coin toss where the weight is itself an element.

18. class CompoundSelect [T] extends Select[Element[Double], T]

A distribution in which the probabilities are Elements and the outcomes are values.

19. case class Condition [T](predicate: (T) ⇒ Boolean) extends Evidence[T] with Product with Serializable

Evidence representing a condition on an element.

Evidence representing a condition on an element.

predicate

The predicate that must be satisfied by the element.

20. class Constant [T] extends Deterministic[T] with Cacheable[T]

Elements that always produce the same value.

21. case class Constraint [T](function: (T) ⇒ Double) extends Evidence[T] with Product with Serializable

Evidence representing a constraint on an element.

Evidence representing a constraint on an element.

function

The constraint to be applied to the element.

22. trait Continuous [T] extends Element[T]

Trait of elements representing continuous probability distributions

23. trait Creatable extends AnyRef

Figaro's reflection allows you to create a Figaro element by providing the name of the element class as a string and its arguments as elements.

Figaro's reflection allows you to create a Figaro element by providing the name of the element class as a string and its arguments as elements. This can be useful, e.g., for compilers. In order to be able to create an instance of a particular element class, the class must implement the Creatable trait.

24. abstract class Deterministic [Value] extends Element[Value]

Elements with no randomness.

25. abstract class Dist [P, T] extends Element[T] with IfArgsCacheable[T]

Distributions with randomly chosen outcomes that are themselves specified by Elements.

Distributions with randomly chosen outcomes that are themselves specified by Elements. The probabilities can either be simple (Doubles) or complex (Elements).

P

The type of the probability specification.

T

The type of values of this element.

26. trait DoubleParameter extends Element[Double] with Parameter[Double]
27. abstract class Element [T] extends AnyRef

An Element is the core component of a probabilistic model.

An Element is the core component of a probabilistic model. Elements can be understood as defining a probabilistic process. Elements are parameterized by the type of Value the process produces.

Each Element is a mix of a random component and a deterministic component. The random component has type Randomness. The generateRandomness method generates the Randomness according to a probability distribution. The generateValue method is a deterministic function that generates the output Value of the Element from the Randomness. Thus, Elements can be understood as defining a generative process in which first the Randomness is generated and then the output Value is generated given the Randomness.

Elements also have a current outcome, represented by the value field. Naturally, the generateValue function can refer to the current value of related Elements. However, generateValue is not allowed to call generateValue on another Element. We use the notation generateValue(r | w) to denote the value it produces given randomness r when the current value of related Elements is w.

Elements can have hard conditions and soft constraints. A condition is a predicate on Values that must be satisfied by the output of the Element. Values that violate the condition have probability zero. A constraint is a function that maps Values to Doubles. The probability of a Value is multiplied by the constraint, and then normalized. Conditions and constraints can be contingent on other elements taking on particular values. Ordinarily, these contingencies will not be specified by the user, but automatically by other Figaro code. In particular, specifying named evidence on a reference can result in contingencies.

Thus, an Element represents a conditional probability distribution over Values given the current values w of related Elements. The probability of an outcome v is defined by:

P(v | w) is proportional to (\sum_{r: generateValue(r | w) = v} P(generateRandomness() = r) * constraint(v)) if condition(v); 0 otherwise

An element has a name and belongs to an element collection that is used to find the element the name.

Elements can be cacheable or non-cacheable, which determines what type of Chain will be created for them. If you create a new Element class that you want to be cached, you should declare it to implement the Cacheable or IfArgsCacheable traits.

28. trait ElementCollection extends AnyRef

An element collection contains elements.

An element collection contains elements. It can be used to find the elements in it by reference.

29. class ElementState extends AnyRef

Saves the mutable state of a single element.

Saves the mutable state of a single element. This only saves and restores the mutable information found in the Element class; it does not propagate this information to the universe level. Immutable.

30. sealed abstract class Evidence [T] extends AnyRef

Evidence that can be associated with an element.

31. class EvidenceNotAllowedException extends RuntimeException
32. trait Flip extends Element[Boolean] with Cacheable[Boolean]

Weighted coin tosses, where the weight itself might be random.

33. trait HasDensity [T] extends Element[T]

Trait of elements for which a density method is defined.

34. trait IfArgsCacheable [V] extends Element[V]

Elements whose values can be cached and reused as long as the arguments are cacheable.

35. case class Indirect [+T](head: Name[ElementCollection], tail: Reference[T]) extends Reference[T] with Product with Serializable

An indirect reference to an element, first using the head to refer to an element collection, and then referring to the tail from within the element collection.

An indirect reference to an element, first using the head to refer to an element collection, and then referring to the tail from within the element collection.

The name of the element whose value is the element collection that resolves the tail.

tail

The remaining reference to be resolved.

36. class Inject [T] extends Deterministic[List[T]] with IfArgsCacheable[List[T]]

Element that converts a sequence of elements into an element over sequences.

37. class InvalidEvidenceException extends IllegalArgumentException
38. case class LogConstraint [T](function: (T) ⇒ Double) extends Evidence[T] with Product with Serializable

Evidence representing a log constraint on an element.

Evidence representing a log constraint on an element.

function

The constraint (in log form) to be applied to the element.

39. class MultiValuedReferenceElement [T] extends ReferenceElement[T, MultiSet[T]] with ValuesMaker[MultiSet[T]]

Element representing the values of a reference that can have multiple values.

40. case class Name [+T](string: String) extends Reference[T] with Product with Serializable

A direct reference to an element by its name.

A direct reference to an element by its name.

string

A string representation of the name

41. case class NamedEvidence [T](reference: Reference[T], evidence: Evidence[T], contingency: Contingency = List()) extends Product with Serializable

Association of evidence with a reference.

Association of evidence with a reference.

reference

The reference to apply the evidence.

contingency

Optional contingency that must be satisfied for this evidence to be applied.

42. class NonCachingChain [T, U] extends Chain[T, U]

A NonCachingChain is an implementation of Chain with a single element cache.

43. case class Observation [T](value: T) extends Evidence[T] with Product with Serializable

Evidence representing observing a particular value for the element.

Evidence representing observing a particular value for the element. Note that using an Observation on a reference is not the same as calling observe on the element directly. This version applies a condition to the element, thus bypassing some specialized operations that can be accomplished by calling the observe on the element directly (such as Likelihood weighting).

value

The observed value of the element.

44. trait Parameter [T] extends Element[T] with Atomic[T]

Trait of learnable parameters.

Trait of learnable parameters. Parameters are elements which can learn their value from data.

45. trait Parameterized [T] extends Element[T] with HasDensity[T]

Trait of elements which accept learnable parameters.

Trait of elements which accept learnable parameters. Parameterized elements are compound elements whose outcome is determined by a learnable parameter.

46. class ParameterizedFlip extends Element[Boolean] with Flip with SingleParameterized[Boolean]

A coin toss where the weight is specified by a learnable parameter.

47. class ParameterizedSelect [T] extends Select[Double, T] with SingleParameterized[T]

A distribution in which the probabilities are learnable parameters and the outcomes are values.

48. trait Pragma [T] extends AnyRef

Pragmas are hints to algorithms that are associated with elements.

Pragmas are hints to algorithms that are associated with elements. A Pragma is parameterized by the type parameter of the element to which it is attached. Pragmas are added to elements using Element's addPragma method. More recently added pragmas can shadow older pragmas of the same type. Pragmas can be removed using Element's removePragma method.

49. sealed trait Reference [+T] extends AnyRef

A reference to an element.

50. abstract class ReferenceElement [T, U] extends Deterministic[U] with IfArgsCacheable[U]

Element representing the value of a reference.

51. abstract class Select [P, T] extends Element[T] with Cacheable[T]

Distributions with randomly chosen outcomes.

Distributions with randomly chosen outcomes. The probabilities can either be simple (Doubles) or complex (Elements).

P

The type of the probability specification.

T

The type of values of this element.

52. trait SingleParameterized [T] extends Element[T] with Parameterized[T]
53. class SingleValuedReferenceElement [T] extends ReferenceElement[T, T] with ValuesMaker[T]

Element representing a single-valued reference.

Element representing a single-valued reference. Its value in a state is generated by following the reference in the state and taking the value of the resulting element.

54. class Universe extends ElementCollection

A universe is a collection of elements that can be used by a reasoning algorithm.

A universe is a collection of elements that can be used by a reasoning algorithm.

Ordinarily, the arguments of elements in a universe must also belong to the universe. You can optionally supply a list of parent elements that contains other elements that can be arguments.

55. class UniverseState extends AnyRef

Saves the mutable state of a universe.

Saves the mutable state of a universe. This is useful for algorithms that need to maintain a state over elements, but involve a sub-procedure that mutates the state of the universe. This class provides the functionality for restoring the previous state. Immutable.

### Value Members

1. object
2. object
3. object
4. object
5. object
6. object
7. object
8. object
9. object
10. object
11. object Flip extends Creatable
12. object
13. object Name extends Serializable
14. object
15. object
16. object
17. object