Skip to content

← distributions package

DistributionMedian

Calculate the median (robust location) 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 the median is defined in terms of the icdf and is only available for combinations of distributions and backends that have an icdf defined (your best bets are scipy (all distributions), numpyro (most), and torch (a few)). For sampling-based distributions (e.g., those obtained from one of the Inference nodes), this will generally be an approximation. For distributions defined over multiple named random variables (e.g., posterior distributions), the result will be a Packet whose chunks are named after the random variables. 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)