Macaulay2 » Documentation
Packages » Probability » ProbabilityDistribution
next | previous | forward | backward | up | index | toc

# ProbabilityDistribution -- probability distribution class

## Description

This is the class of which all probability distribution objects belong. ProbabilityDistribution is an abstract class defining the interface and should not be used directly. Instead, its subclasses DiscreteProbabilityDistribution and ContinuousProbabilityDistribution should be used.

ProbabilityDistribution objects are hash tables containing six key-value pairs:

DensityFunction
  The probability mass or density function (for discrete or continuous distributions, respectively). Do not use this directly. Instead, use density.
DistributionFunction
  The cumulative distribution function. Do not use this directly. Instead, use probability.
QuantileFunction
  The quantile function. Do not use this directly. Instead, use quantile.
RandomGeneration
  A function to generate random samples of the distribution. Do not use this directly. Instead, use random(ProbabilityDistribution).
Support
  A sequence of two numbers, the lower and upper bound of the support of the distribution.
Description
  A string containing a description of the distribution. This is the return value when a ProbabilityDistribution object is passed to net.

    i1 : Z = normalDistribution()

    o1 = N(0,1)

    o1 : ContinuousProbabilityDistribution

    i2 : ancestors class Z

    o2 = {ContinuousProbabilityDistribution, ProbabilityDistribution, HashTable,
         ------------------------------------------------------------------------
         Thing}

    o2 : List

    i3 : peek Z

    o3 = ContinuousProbabilityDistribution{DensityFunction => FunctionClosure[../Probability.m2:348:8-348:74]      }
                                           Description => N(0,1)
                                           DistributionFunction => FunctionClosure[../Probability.m2:349:32-350:56]
                                           QuantileFunction => FunctionClosure[../Probability.m2:351:28-352:55]
                                           RandomGeneration => FunctionClosure[../Probability.m2:355:12-355:50]
                                           Support => (-infinity, infinity)

To create a ProbablityDistribution object, use one of the constructor methods, discreteProbabilityDistribution, continuousProbabilityDistribution, or any of the various built-in methods for common distributions.

### Menu

#### Keys

- DensityFunction -- probability density function
- DistributionFunction -- cumulative distribution function
- QuantileFunction -- quantile function
- RandomGeneration -- random generation function
- Support -- support for probability distribution

#### Constructor methods

- discreteProbabilityDistribution -- construct a discrete probability distribution
- continuousProbabilityDistribution -- construct a continuous probability distribution

## Types of probability distribution:

- `ContinuousProbabilityDistribution`
- `DiscreteProbabilityDistribution`

## Methods that use a probability distribution:

- `density(ProbabilityDistribution,Number)` -- see density -- probability density (or mass) function
- `probability(ProbabilityDistribution,Number)` -- see probability -- cumulative distribution function
- `net(ProbabilityDistribution)`
- `quantile(ProbabilityDistribution,Number)` -- see quantile -- quantile function
- random(ProbabilityDistribution) -- randomly generate samples from probability distribution

## For the programmer

The object ProbabilityDistribution is a type, with ancestor classes HashTable < Thing.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Probability.m2:537:0.