Skip to content

MarginalDistribution ​

The kk-th marginal factor of a ProductDistribution — or the joint marginal of several.

MarginalDistribution(ProductDistribution(d1, ..., dn), k)the k-th factor, dk, directly.
MarginalDistribution(ProductDistribution(d1, ..., dn), {k1, k2, ...})ProductDistribution(dk1, dk2, ...), the joint marginal of the named factors.
Typed signatures
TypePackageApplies
(expression<ProductDistribution>, integer | list<integer>) -> distributionstatisticsalways

Domain: Statistics

Details
  • Reduces away entirely at evaluation — the result IS the plain factor (or a ProductDistribution of the selected factors), so PDF/CDF/Mean/Variance/RandomVariate on it are just whatever that reduced distribution already answers.
  • Only defined over a ProductDistribution base (independence is what makes "the k-th marginal" simply "the k-th factor") — any other first argument stays unevaluated.

Examples

Basic #
live ↗
InMarginalDistribution(ProductDistribution(NormalDistribution⁡(0,1),NormalDistribution⁡(5,2)),2)\mathrm{MarginalDistribution}(\mathrm{ProductDistribution}(\operatorname{NormalDistribution}(0, 1), \operatorname{NormalDistribution}(5, 2)), 2)OutNormalDistribution⁡(5,2)\operatorname{NormalDistribution}(5, 2)
live ↗
Inmean(MarginalDistribution(ProductDistribution(NormalDistribution⁡(0,1),NormalDistribution⁡(5,2)),2))\mathrm{mean}(\mathrm{MarginalDistribution}(\mathrm{ProductDistribution}(\operatorname{NormalDistribution}(0, 1), \operatorname{NormalDistribution}(5, 2)), 2))Out55
live ↗
InMarginalDistribution(ProductDistribution(NormalDistribution⁡(0,1),NormalDistribution⁡(5,2),NormalDistribution⁡(9,1)),[1,3])\mathrm{MarginalDistribution}(\mathrm{ProductDistribution}(\operatorname{NormalDistribution}(0, 1), \operatorname{NormalDistribution}(5, 2), \operatorname{NormalDistribution}(9, 1)), \bigl\lbrack1, 3\bigr\rbrack)OutProductDistribution(NormalDistribution⁡(0,1),NormalDistribution⁡(9,1))\mathrm{ProductDistribution}(\operatorname{NormalDistribution}(0, 1), \operatorname{NormalDistribution}(9, 1))
About
Examples3

See also: ProductDistribution, Mean