Skip to content

← distributions package

DistributionVariance

Calculate the variance (expected value) of a provided (wired-in) probability distribution.

For univariate distributions, this is a scalar, but the value will be an array if the distribution's event space is multivariate, and/or if the distribution itself is batched, as in, is parameterized by a batch of parameters (e.g., multiple sets of locations or scales). In these cases, the shape of the result is (batch_shape, event_shape). For the distributions defined in the distributions package, this yields generally the analytic, i.e. exact, result, but for sampling-based distributions (e.g., those output by one of the Inference nodes), this will be an approximation. For distributions defined over multiple named random variables (e.g., posterior distributions), the result will be a Packet with chunks named after the random variables, and the blocks containing the respective array. More Info... Version 1.0.0

Ports/Properties

dist

Distribution to use.

  • verbose name: Dist
  • default value: None
  • port type: DataPort
  • value type: Distribution (can be None)
  • data direction: IN

value

Resulting value.

  • verbose name: Value
  • default value: None
  • port type: DataPort
  • value type: object (can be None)
  • data direction: OUT

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)