This is Probability.info, produced by Macaulay2, version 1.20

Probability -- basic probability functions
******************************************

Description
===========

This package provides a number of basic probability functions.  In particular,
for both discrete and continuous probability distributions, there are the
following four functions:

  * density,:  probability density (or mass) function
  * probability,:  cumulative distribution function
  * quantile,:  quantile function
  * random(ProbabilityDistribution),:
    generate random samples

A variety of common probability distributions are supported.

Discrete distributions
----------------------

  * binomial
  * Poisson
  * geometric
  * negative binomial
  * hypergeometric

Continuous distributions
------------------------

  * uniform
  * exponential
  * normal
  * gamma
  * chi-squared
  * Student's t
  * F
  * beta

You may also define your own probability distributions using
discreteProbabilityDistribution, and
continuousProbabilityDistribution.

Author
======

  * Doug Torrance (see https://webwork.piedmont.edu/~dtorrance )
    <dtorrance@piedmont.edu>

Version
=======

This documentation describes version 0.1 of Probability.

Source code
===========

The source code from which this documentation is derived is in the file
Probability.m2 (see common/share/Macaulay2/Probability.m2 ).

Exports
=======

  * Types
      * "ContinuousProbabilityDistribution" -- see
        ProbabilityDistribution, -- probability
        distribution class
      * "DiscreteProbabilityDistribution" -- see ProbabilityDistribution,
        -- probability distribution class
      * ProbabilityDistribution -- probability
        distribution class
  * Functions and commands
      * betaDistribution -- beta distribution
      * "bernoulliDistribution" -- see binomialDistribution,
        -- binomial distribution
      * binomialDistribution -- binomial
        distribution
      * chiSquaredDistribution -- chi-squared
        distribution
      * continuousProbabilityDistribution
        -- construct a continuous
        probability distribution
      * density -- probability density (or mass) function
      * discreteProbabilityDistribution,
        -- construct a discrete probability distribution
      * exponentialDistribution -- exponential
        distribution
      * fDistribution -- F-distribution
      * gammaDistribution -- gamma distribution
      * geometricDistribution -- geometric
        distribution
      * hypergeometricDistribution, --
        hypergeometric distribution
      * negativeBinomialDistribution, --
        negative binomial distribution
      * normalDistribution -- normal distribution
      * poissonDistribution -- Poisson distribution
      * probability -- cumulative distribution function
      * quantile -- quantile function
      * tDistribution -- Student's t-distribution
      * uniformDistribution -- continuous uniform
        distribution
  * Methods
      * "betaDistribution(Constant,Constant)" -- see betaDistribution,
        -- beta distribution
      * "betaDistribution(Constant,Number)" -- see betaDistribution,
        -- beta distribution
      * "betaDistribution(Number,Constant)" -- see betaDistribution,
        -- beta distribution
      * "betaDistribution(Number,Number)" -- see betaDistribution,
        -- beta distribution
      * "bernoulliDistribution(Constant)" -- see binomialDistribution,
        -- binomial distribution
      * "bernoulliDistribution(Number)" -- see binomialDistribution,
        -- binomial distribution
      * "binomialDistribution(ZZ,Constant)" -- see binomialDistribution,
        -- binomial distribution
      * "binomialDistribution(ZZ,Number)" -- see binomialDistribution,
        -- binomial distribution
      * "chiSquaredDistribution(Constant)" -- see chiSquaredDistribution,
        -- chi-squared distribution
      * "chiSquaredDistribution(Number)" -- see chiSquaredDistribution,
        -- chi-squared distribution
      * "continuousProbabilityDistribution(Function)" -- see
        continuousProbabilityDistribution,
        -- construct a continuous probability distribution
      * "density(DiscreteProbabilityDistribution,Constant)" -- see
        density, -- probability density (or mass) function
      * "density(DiscreteProbabilityDistribution,Number)" -- see density,
        -- probability density (or mass) function
      * "density(ProbabilityDistribution,Constant)" -- see density,
        -- probability density (or mass) function
      * "density(ProbabilityDistribution,Number)" -- see density,
        -- probability density (or mass) function
      * "discreteProbabilityDistribution(Function)" -- see
        discreteProbabilityDistribution, --
        construct a discrete probability distribution
      * "exponentialDistribution(Constant)" -- see
        exponentialDistribution, -- exponential
        distribution
      * "exponentialDistribution(Number)" -- see exponentialDistribution,
        -- exponential distribution
      * "fDistribution(Constant,Constant)" -- see fDistribution,
        -- F-distribution
      * "fDistribution(Constant,Number)" -- see fDistribution,
        -- F-distribution
      * "fDistribution(Number,Constant)" -- see fDistribution,
        -- F-distribution
      * "fDistribution(Number,Number)" -- see fDistribution,
        -- F-distribution
      * "gammaDistribution(Constant,Constant)" -- see gammaDistribution,
        -- gamma distribution
      * "gammaDistribution(Constant,Number)" -- see gammaDistribution,
        -- gamma distribution
      * "gammaDistribution(Number,Constant)" -- see gammaDistribution,
        -- gamma distribution
      * "gammaDistribution(Number,Number)" -- see gammaDistribution,
        -- gamma distribution
      * "geometricDistribution(Constant)" -- see geometricDistribution,
        -- geometric distribution
      * "geometricDistribution(Number)" -- see geometricDistribution,
        -- geometric distribution
      * "hypergeometricDistribution(ZZ,ZZ,ZZ)" -- see
        hypergeometricDistribution, --
        hypergeometric distribution
      * "negativeBinomialDistribution(Constant,Constant)" -- see
        negativeBinomialDistribution, -- negative
        binomial distribution
      * "negativeBinomialDistribution(Constant,Number)" -- see
        negativeBinomialDistribution, -- negative
        binomial distribution
      * "negativeBinomialDistribution(Number,Constant)" -- see
        negativeBinomialDistribution, -- negative
        binomial distribution
      * "negativeBinomialDistribution(Number,Number)" -- see
        negativeBinomialDistribution, -- negative
        binomial distribution
      * "normalDistribution(Constant,Constant)" -- see
        normalDistribution, -- normal distribution
      * "normalDistribution(Constant,Number)" -- see normalDistribution,
        -- normal distribution
      * "normalDistribution(Number,Constant)" -- see normalDistribution,
        -- normal distribution
      * "normalDistribution(Number,Number)" -- see normalDistribution,
        -- normal distribution
      * "poissonDistribution(Constant)" -- see poissonDistribution,
        -- Poisson distribution
      * "poissonDistribution(Number)" -- see poissonDistribution,
        -- Poisson distribution
      * "probability(DiscreteProbabilityDistribution,Constant)" -- see
        probability, -- cumulative distribution function
      * "probability(DiscreteProbabilityDistribution,Number)" -- see
        probability, -- cumulative distribution function
      * "probability(ProbabilityDistribution,Constant)" -- see
        probability, -- cumulative distribution function
      * "probability(ProbabilityDistribution,Number)" -- see probability,
        -- cumulative distribution function
      * "net(ProbabilityDistribution)" -- see ProbabilityDistribution,
        -- probability distribution class
      * "quantile(DiscreteProbabilityDistribution,Constant)" -- see
        quantile, -- quantile function
      * "quantile(DiscreteProbabilityDistribution,Number)" -- see
        quantile, -- quantile function
      * "quantile(ProbabilityDistribution,Constant)" -- see quantile,
        -- quantile function
      * "quantile(ProbabilityDistribution,Number)" -- see quantile,
        -- quantile function
      * random(ProbabilityDistribution)
        -- randomly generate samples from
        probability distribution
      * "tDistribution(Constant)" -- see tDistribution, --
        Student's t-distribution
      * "tDistribution(Number)" -- see tDistribution, --
        Student's t-distribution
      * "uniformDistribution(Constant,Constant)" -- see
        uniformDistribution, -- continuous uniform
        distribution
      * "uniformDistribution(Constant,Number)" -- see
        uniformDistribution, -- continuous uniform
        distribution
      * "uniformDistribution(Number,Constant)" -- see
        uniformDistribution, -- continuous uniform
        distribution
      * "uniformDistribution(Number,Number)" -- see uniformDistribution,
        -- continuous uniform distribution
  * Symbols
      * DensityFunction -- probability density function
      * DistributionFunction -- cumulative density
        function
      * LowerTail -- whether to computer lower tail
        probabilities
      * QuantileFunction -- quantile function
      * RandomGeneration -- random generation function
      * Support -- support for probability distribution

For the programmer
==================

The object Probability, is a package (Macaulay2Doc).

betaDistribution -- beta distribution
*************************************

Synopsis
========

  * Usage:
        betaDistribution(alpha, beta)
  * Inputs:
      * alpha, a number (Macaulay2Doc), shape parameter
        (positive);
      * beta, a number (Macaulay2Doc), shape parameter
        (positive);
  * Outputs:
      * a continuous probability distribution,

Description
===========

The beta distribution (see https://en.wikipedia.org/wiki/beta_distribution ).

+--------------------------------------+
|i1 : X = betaDistribution(5, 6)       |
|                                      |
|o1 = Beta(5,6)                        |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 0.2                    |
|                                      |
|o2 = .66060288                        |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 0.3                |
|                                      |
|o3 = .1502683326                      |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.4                   |
|                                      |
|o4 = .41306909869648                  |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = .639954804875878                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

Ways to use betaDistribution :
==============================

  * "betaDistribution(Constant,Constant)"
  * "betaDistribution(Constant,Number)"
  * "betaDistribution(Number,Constant)"
  * "betaDistribution(Number,Number)"

For the programmer
==================

The object betaDistribution, is a method function (Macaulay2Doc).

binomialDistribution -- binomial distribution
*********************************************

Synopsis
========

  * Usage:
        binomialDistribution(n, p)
        bernoulliDistribution p
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * p, a number (Macaulay2Doc), between 0 and 1;
  * Outputs:
      * a discrete probability distribution,

Description
===========

The binomial distribution (see
https://en.wikipedia.org/wiki/binomial_distribution ), the distribution of the
number of successes in a sequence of n Bernoulli trials, where the probability
of success is p.

+--------------------------------------+
|i1 : X = binomialDistribution(10, 0.1)|
|                                      |
|o1 = B(10,.1)                         |
|                                      |
|o1 : DiscreteProbabilityDistribution  |
+--------------------------------------+
|i2 : density_X 2                      |
|                                      |
|o2 = .1937102445                      |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 3                  |
|                                      |
|o3 = .9872048016                      |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.4                   |
|                                      |
|o4 = 1                                |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 2                                |
+--------------------------------------+

A special case is the Bernoulli distribution (see
https://en.wikipedia.org/wiki/Bernoulli_distribution ), where n is 1.

+------------------------------------+
|i6 : Y = bernoulliDistribution 0.1  |
|                                    |
|o6 = B(1,.1)                        |
|                                    |
|o6 : DiscreteProbabilityDistribution|
+------------------------------------+

Ways to use binomialDistribution :
==================================

  * "binomialDistribution(ZZ,Constant)"
  * "binomialDistribution(ZZ,Number)"

For the programmer
==================

The object binomialDistribution, is a method function (Macaulay2Doc).

chiSquaredDistribution -- chi-squared distribution
**************************************************

Synopsis
========

  * Usage:
        chiSquaredDistribution n
  * Inputs:
      * n, a number (Macaulay2Doc), the degrees of freedom
        (positive);
  * Outputs:
      * a continuous probability distribution,

Description
===========

The chi-squared distribution (see
https://en.wikipedia.org/wiki/chi-squared_distribution ), the distribution of
the sum of n squares of independent normally distributed,
random variables.

+--------------------------------------+
|i1 : X = chiSquaredDistribution 5     |
|                                      |
|o1 = χ²(5)                          |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 2                      |
|                                      |
|o2 = .138369165806865                 |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 3                  |
|                                      |
|o3 = .300014164121372                 |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.4                   |
|                                      |
|o4 = 3.65549962314159                 |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 9.04486020245785                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

Ways to use chiSquaredDistribution :
====================================

  * "chiSquaredDistribution(Constant)"
  * "chiSquaredDistribution(Number)"

For the programmer
==================

The object chiSquaredDistribution, is a
method function (Macaulay2Doc).

continuousProbabilityDistribution -- construct a continuous probability distribution
************************************************************************************

Synopsis
========

  * Usage:
        continuousProbabilityDistribution f
  * Inputs:
      * f, a function (Macaulay2Doc), the probability density
        function of X, to be used by density.
  * Optional inputs (Macaulay2Doc),:
      * DistributionFunction => a function (Macaulay2Doc),
        default value null, the cumulative distribution function of X, to be
        used by probability.  If null, then obtained by
        numerically integrating f.
      * QuantileFunction => a function (Macaulay2Doc), default
        value null, the quantile function of X, to be used by quantile.
        If null, then obtained by using the bisection method (see
        https://en.wikipedia.org/wiki/bisection_method ).
      * RandomGeneration => a function (Macaulay2Doc), default
        value null, a function for generating random samples from X, to be used
        by random(ProbabilityDistribution).
        If null, then obtained using
        inverse transform sampling (see
        https://en.wikipedia.org/wiki/inverse_transform_sampling ).
      * Support => a sequence (Macaulay2Doc), default value
        (0,infinity), containing the lower and upper bounds, respectively, of
        the support (see https://en.wikipedia.org/wiki/Support_(mathematics) )
        of X.
      * Description => a string (Macaulay2Doc), default value "a
        continuous probability distribution", describing the probability
        distribution.
  * Outputs:
      * X, a continuous probability distribution,

Description
===========

To construct a continuous probability distribution, provide the probability
density function and, if different than the default of \([0, \infty\]), the
support.

+-------------------------------------------------------------------------+
|i1 : X = continuousProbabilityDistribution(x -> 2 * x, Support => (0, 1))|
|                                                                         |
|o1 = a continuous probability distribution                               |
|                                                                         |
|o1 : ContinuousProbabilityDistribution                                   |
+-------------------------------------------------------------------------+
|i2 : density_X 0.75                                                      |
|                                                                         |
|o2 = 1.5                                                                 |
|                                                                         |
|o2 : RR (of precision 53)                                                |
+-------------------------------------------------------------------------+

Values outside the support are automatically sent to 0.

+----------------+
|i3 : density_X 2|
|                |
|o3 = 0          |
+----------------+

The cumulative distribution, quantile, and random generation functions are set
to defaults based on the probability density function.

+-------------------------+
|i4 : probability_X 0.75  |
|                         |
|o4 = .5625               |
|                         |
|o4 : RR (of precision 53)|
+-------------------------+
|i5 : quantile_X 0.5625   |
|                         |
|o5 = .75                 |
|                         |
|o5 : RR (of precision 53)|
+-------------------------+
|i6 : random X            |
|                         |
|o6 = .944834293327094    |
|                         |
|o6 : RR (of precision 53)|
+-------------------------+

However, if possible, it is good to provide these directly to improve
performance.  A description may also be provided.

+-------------------------------------------------------------------------+
|i7 : X = continuousProbabilityDistribution(x -> 2 * x, Support => (0, 1),|
|         DistributionFunction => x -> x^2,                               |
|         QuantileFunction => p -> sqrt p,                                |
|         Description => "triangular distribution")                       |
|                                                                         |
|o7 = triangular distribution                                             |
|                                                                         |
|o7 : ContinuousProbabilityDistribution                                   |
+-------------------------------------------------------------------------+

Ways to use continuousProbabilityDistribution :
===============================================

  * "continuousProbabilityDistribution(Function)"

For the programmer
==================

The object continuousProbabilityDistribution,
is a method function with options (Macaulay2Doc).

density -- probability density (or mass) function
*************************************************

Synopsis
========

  * Usage:
        density_X x
  * Inputs:
      * X, a probability distribution,
      * x, a real number (Macaulay2Doc),
  * Outputs:
      * a real number (Macaulay2Doc),

Description
===========

For a discrete probability distribution, this returns values of of the
probability mass function (see
https://en.wikipedia.org/wiki/probability_mass_function ) of the distribution,
i.e., \(f_X(x) = P(X = x)\).

+--------------------------------------+
|i1 : X = binomialDistribution(5, 0.25)|
|                                      |
|o1 = B(5,.25)                         |
|                                      |
|o1 : DiscreteProbabilityDistribution  |
+--------------------------------------+
|i2 : density_X 2                      |
|                                      |
|o2 = .263671875                       |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : binomial(5, 2) * 0.25^2 * 0.75^3 |
|                                      |
|o3 = .263671875                       |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+

For a continuous probability distribution, this returns values of the
probability density function (see
https://en.wikipedia.org/wiki/probability_density_function ) of the
distribution, i.e., the integrand in \(\int_a^b f_X(x)\,dx = P(a\leq X \leq
b)\).

+--------------------------------------+
|i4 : Z = normalDistribution()         |
|                                      |
|o4 = N(0,1)                           |
|                                      |
|o4 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i5 : density_Z 0                      |
|                                      |
|o5 = .398942280401433                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+
|i6 : 1/sqrt(2 * pi)                   |
|                                      |
|o6 = .398942280401433                 |
|                                      |
|o6 : RR (of precision 53)             |
+--------------------------------------+
|i7 : integrate(density_Z, -1, 1)      |
|                                      |
|o7 = .682689492137086                 |
|                                      |
|o7 : RR (of precision 53)             |
+--------------------------------------+
|i8 : integrate(density_Z, -2, 2)      |
|                                      |
|o8 = .95449973610347                  |
|                                      |
|o8 : RR (of precision 53)             |
+--------------------------------------+
|i9 : integrate(density_Z, -3, 3)      |
|                                      |
|o9 = .997300204130616                 |
|                                      |
|o9 : RR (of precision 53)             |
+--------------------------------------+

Ways to use density :
=====================

  * "density(DiscreteProbabilityDistribution,Constant)"
  * "density(DiscreteProbabilityDistribution,Number)"
  * "density(ProbabilityDistribution,Constant)"
  * "density(ProbabilityDistribution,Number)"

For the programmer
==================

The object density, is a method function (Macaulay2Doc).

DensityFunction -- probability density function
***********************************************

Description
===========

A key in ProbabilityDistribution, objects and an
option for discreteProbabilityDistribution,
and continuousProbabilityDistribution,
for setting the probability density/mass
function to be used by density.

For the programmer
==================

The object DensityFunction, is a symbol (Macaulay2Doc).

discreteProbabilityDistribution -- construct a discrete probability distribution
********************************************************************************

Synopsis
========

  * Usage:
        discreteProbabilityDistribution f
  * Inputs:
      * f, a function (Macaulay2Doc), the probability mass
        function of X, to be used by density.
  * Optional inputs (Macaulay2Doc),:
      * DistributionFunction => a function (Macaulay2Doc),
        default value null, the cumulative distribution function of X, to be
        used by probability.  If null, then obtained by
        adding values of f.
      * QuantileFunction => a function (Macaulay2Doc), default
        value null, the quantile function of X, to be used by quantile.
        If null, then obtained by adding values of f.
      * RandomGeneration => a function (Macaulay2Doc), default
        value null, a function for generating random samples from X, to be used
        by random(ProbabilityDistribution).
        If null, then obtained using
        inverse transform sampling (see
        https://en.wikipedia.org/wiki/inverse_transform_sampling ).
      * Support => a sequence (Macaulay2Doc), default value
        (0,infinity), containing the lower and upper bounds, respectively, of
        the support (see https://en.wikipedia.org/wiki/Support_(mathematics) )
        of X.
      * Description => a string (Macaulay2Doc), default value "a
        discrete probability distribution", describing the probability
        distribution.
  * Outputs:
      * X, a discrete probability distribution,

Description
===========

To construct a discrete probability distribution, provide the probability mass
function and, if different than the default of \([0, \infty\]), the support.

+---------------------------------------------------------------------+
|i1 : X = discreteProbabilityDistribution(x -> 1/6, Support => (1, 6))|
|                                                                     |
|o1 = a discrete probability distribution                             |
|                                                                     |
|o1 : DiscreteProbabilityDistribution                                 |
+---------------------------------------------------------------------+
|i2 : density_X 3                                                     |
|                                                                     |
|     1                                                               |
|o2 = -                                                               |
|     6                                                               |
|                                                                     |
|o2 : QQ                                                              |
+---------------------------------------------------------------------+

Non-integers and values outside the support are automatically sent to 0.

+------------------+
|i3 : density_X 3.5|
|                  |
|o3 = 0            |
+------------------+
|i4 : density_X 7  |
|                  |
|o4 = 0            |
+------------------+

The cumulative distribution, quantile, and random generation functions are set
to defaults based on the probability mass function.

+--------------------+
|i5 : probability_X 3|
|                    |
|     1              |
|o5 = -              |
|     2              |
|                    |
|o5 : QQ             |
+--------------------+
|i6 : quantile_X 0.2 |
|                    |
|o6 = 2              |
+--------------------+
|i7 : random X       |
|                    |
|o7 = 6              |
+--------------------+

However, if possible, it is good to provide these directly to improve
performance.  A description may also be provided.

+---------------------------------------------------------------------+
|i8 : X = discreteProbabilityDistribution(x -> 1/6, Support => (1, 6),|
|         DistributionFunction => x -> x / 6,                         |
|         QuantileFunction => p -> 6 * p,                             |
|         Description => "six-sided die")                             |
|                                                                     |
|o8 = six-sided die                                                   |
|                                                                     |
|o8 : DiscreteProbabilityDistribution                                 |
+---------------------------------------------------------------------+

Ways to use discreteProbabilityDistribution :
=============================================

  * "discreteProbabilityDistribution(Function)"

For the programmer
==================

The object discreteProbabilityDistribution,
is a method function with options (Macaulay2Doc).

DistributionFunction -- cumulative density function
***************************************************

Description
===========

A key in ProbabilityDistribution, objects and an
option for discreteProbabilityDistribution,
and continuousProbabilityDistribution,
for setting the cumulative distribution
function to be used by probability.

Functions with optional argument named DistributionFunction :
=============================================================

  * "continuousProbabilityDistribution(...,DistributionFunction=>...)" -- see
    continuousProbabilityDistribution,
    -- construct a continuous probability distribution
  * "discreteProbabilityDistribution(...,DistributionFunction=>...)" -- see
    discreteProbabilityDistribution, --
    construct a discrete probability distribution

For the programmer
==================

The object DistributionFunction, is a symbol (Macaulay2Doc).

exponentialDistribution -- exponential distribution
***************************************************

Synopsis
========

  * Usage:
        exponentialDistribution lambda
  * Inputs:
      * lambda, a number (Macaulay2Doc), the rate parameter
        (positive);
  * Outputs:
      * a continuous probability distribution,

Description
===========

The exponential distribution (see
https://en.wikipedia.org/wiki/exponential_distribution ), the waiting time
between events in a Poisson process, where lambda is the expected number of
events in one unit of time.

+--------------------------------------+
|i1 : X = exponentialDistribution 0.25 |
|                                      |
|o1 = Exp(.25)                         |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 2                      |
|                                      |
|o2 = .151632664928158                 |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 3                  |
|                                      |
|o3 = .527633447258985                 |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.4                   |
|                                      |
|o4 = 2.04330249506396                 |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 8.92894798990416                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

Ways to use exponentialDistribution :
=====================================

  * "exponentialDistribution(Constant)"
  * "exponentialDistribution(Number)"

For the programmer
==================

The object exponentialDistribution, is a
method function (Macaulay2Doc).

fDistribution -- F-distribution
*******************************

Synopsis
========

  * Usage:
        fDistribution(d1, d2)
  * Inputs:
      * d1, a number (Macaulay2Doc), the numerator degrees of
        freedom (positive);
      * d2, a number (Macaulay2Doc), the denominator degrees of
        freedom (positive);
  * Outputs:
      * a continuous probability distribution,

Description
===========

The F-distribution (see https://en.wikipedia.org/wiki/F-distribution ), widely
used in ANOVA (see https://en.wikipedia.org/wiki/ANOVA ).

+--------------------------------------+
|i1 : X = fDistribution(5, 6)          |
|                                      |
|o1 = F(5,6)                           |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 2                      |
|                                      |
|o2 = .160307714341474                 |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 3                  |
|                                      |
|o3 = .893202382912791                 |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.4                   |
|                                      |
|o4 = .777246066088529                 |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 2.99258985938596                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

Ways to use fDistribution :
===========================

  * "fDistribution(Constant,Constant)"
  * "fDistribution(Constant,Number)"
  * "fDistribution(Number,Constant)"
  * "fDistribution(Number,Number)"

For the programmer
==================

The object fDistribution, is a method function (Macaulay2Doc).

gammaDistribution -- gamma distribution
***************************************

Synopsis
========

  * Usage:
        gammaDistribution(alpha, lambda)
  * Inputs:
      * alpha, a number (Macaulay2Doc), the shape parameter
        (positive);
      * lambda, a number (Macaulay2Doc), the rate parameter
        (positive);

Description
===========

The gamma distribution (see https://en.wikipedia.org/wiki/gamma_distribution ).
When alpha is an integer (also known as the Erlang distribution (see
https://en.wikipedia.org/wiki/Erlang_distribution )), this is waiting time
until the alphath event in a Poisson process where lambda is the expected
number of events in one unit of time.  In particular, when alpha is 1, this is
the exponential distribution.

+--------------------------------------+
|i1 : X = gammaDistribution(5, 0.6)    |
|                                      |
|o1 = Gamma(5,.6)                      |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 2                      |
|                                      |
|o2 = .0156139079455286                |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 3                  |
|                                      |
|o3 = .0364066610010835                |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.4                   |
|                                      |
|o4 = 6.91289313411757                 |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 13.1175639516228                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

Caveat
======

Some probability texts define the gamma distribution using a scale parameter
instead of a rate parameter.  They are reciprocals of one another.

Ways to use gammaDistribution :
===============================

  * "gammaDistribution(Constant,Constant)"
  * "gammaDistribution(Constant,Number)"
  * "gammaDistribution(Number,Constant)"
  * "gammaDistribution(Number,Number)"

For the programmer
==================

The object gammaDistribution, is a method function (Macaulay2Doc).

geometricDistribution -- geometric distribution
***********************************************

Synopsis
========

  * Usage:
        geometricDistribution p
  * Inputs:
      * p, a number (Macaulay2Doc), between 0 and 1;
  * Outputs:
      * a discrete probability distribution,

Description
===========

The geometric distribution (see
https://en.wikipedia.org/wiki/geometric_distribution ), the distribution of the
number of a failures in a sequence of Bernoulli trials before the first
success, where p is the probability of a success.

+------------------------------------+
|i1 : X = geometricDistribution 0.1  |
|                                    |
|o1 = Geo(.1)                        |
|                                    |
|o1 : DiscreteProbabilityDistribution|
+------------------------------------+
|i2 : density_X 2                    |
|                                    |
|o2 = .081                           |
|                                    |
|o2 : RR (of precision 53)           |
+------------------------------------+
|i3 : probability_X 3                |
|                                    |
|o3 = .3439                          |
|                                    |
|o3 : RR (of precision 53)           |
+------------------------------------+
|i4 : quantile_X 0.4                 |
|                                    |
|o4 = 4                              |
+------------------------------------+
|i5 : random X                       |
|                                    |
|o5 = 21                             |
+------------------------------------+

Caveat
======

Some probability texts define the geometric distribution as the number of
Bernoulli trials until the first success, and so the values will be one greater
than ours.  Our definition is consistent with R.

Ways to use geometricDistribution :
===================================

  * "geometricDistribution(Constant)"
  * "geometricDistribution(Number)"

For the programmer
==================

The object geometricDistribution, is a
method function (Macaulay2Doc).

hypergeometricDistribution -- hypergeometric distribution
*********************************************************

Synopsis
========

  * Usage:
        hypergeometricDistribution(m, n, k)
  * Inputs:
      * m, an integer (Macaulay2Doc), nonnegative;
      * n, an integer (Macaulay2Doc), nonnegative;
      * k, an integer (Macaulay2Doc), between 0 and and m + n;
  * Outputs:
      * a discrete probability distribution,

Description
===========

The hypergeometric distribution (see
https://en.wikipedia.org/wiki/hypergeometric_distribution ), the number of
white balls drawn after drawing k balls from an urn containing m white and n
black balls.

+--------------------------------------------+
|i1 : X = hypergeometricDistribution(5, 6, 4)|
|                                            |
|o1 = HG(5,6,4)                              |
|                                            |
|o1 : DiscreteProbabilityDistribution        |
+--------------------------------------------+
|i2 : density_X 2                            |
|                                            |
|      5                                     |
|o2 = --                                     |
|     11                                     |
|                                            |
|o2 : QQ                                     |
+--------------------------------------------+
|i3 : probability_X 3                        |
|                                            |
|     65                                     |
|o3 = --                                     |
|     66                                     |
|                                            |
|o3 : QQ                                     |
+--------------------------------------------+
|i4 : quantile_X 0.4                         |
|                                            |
|o4 = 2                                      |
+--------------------------------------------+
|i5 : random X                               |
|                                            |
|o5 = 3                                      |
+--------------------------------------------+

Caveat
======

Probabiltity texts often use the total number of balls (our m + n) as one of
the parameters of this distribution.  Our definition is consistent with R.

Ways to use hypergeometricDistribution :
========================================

  * "hypergeometricDistribution(ZZ,ZZ,ZZ)"

For the programmer
==================

The object hypergeometricDistribution, is a
method function (Macaulay2Doc).

LowerTail -- whether to computer lower tail probabilities
*********************************************************

Description
===========

This is an option for probability, and quantile.

Functions with optional argument named LowerTail :
==================================================

  * "probability(...,LowerTail=>...)" -- see probability, --
    cumulative distribution function
  * "quantile(...,LowerTail=>...)" -- see quantile, -- quantile
    function

For the programmer
==================

The object LowerTail, is a symbol (Macaulay2Doc).

negativeBinomialDistribution -- negative binomial distribution
**************************************************************

Synopsis
========

  * Usage:
        negativeBinomialDistribution(r, p)
  * Inputs:
      * r, a number (Macaulay2Doc), positive;
      * p, a number (Macaulay2Doc), between 0 and 1;
  * Outputs:
      * a discrete probability distribution,

Description
===========

The negative binomial distribution (see
https://en.wikipedia.org/wiki/negative_binomial_distribution ), the
distribution of the number of failures in a sequence of Bernoulli trials (with
probability of success p) until the rth success.

+---------------------------------------------+
|i1 : X = negativeBinomialDistribution(5, 0.1)|
|                                             |
|o1 = NB(5,.1)                                |
|                                             |
|o1 : DiscreteProbabilityDistribution         |
+---------------------------------------------+
|i2 : density_X 20                            |
|                                             |
|o2 = .0129187353167939                       |
|                                             |
|o2 : RR (of precision 53)                    |
+---------------------------------------------+
|i3 : probability_X 30                        |
|                                             |
|o3 = .269251039773837                        |
|                                             |
|o3 : RR (of precision 53)                    |
+---------------------------------------------+
|i4 : quantile_X 0.4                          |
|                                             |
|o4 = 37                                      |
+---------------------------------------------+
|i5 : random X                                |
|                                             |
|o5 = 72                                      |
+---------------------------------------------+

Caveat
======

Probability texts define the negative binomial distribution in a variety of
different ways.  Our definition is consistent with R.

Ways to use negativeBinomialDistribution :
==========================================

  * "negativeBinomialDistribution(Constant,Constant)"
  * "negativeBinomialDistribution(Constant,Number)"
  * "negativeBinomialDistribution(Number,Constant)"
  * "negativeBinomialDistribution(Number,Number)"

For the programmer
==================

The object negativeBinomialDistribution, is
a method function (Macaulay2Doc).

normalDistribution -- normal distribution
*****************************************

Synopsis
========

  * Usage:
        normalDistribution(mu, sigma)
  * Inputs:
      * mu, a number (Macaulay2Doc), the mean;
      * sigma, a number (Macaulay2Doc), the standard deviation
        (positive);
  * Outputs:
      * a continuous probability distribution,

Description
===========

The normal distribution (see https://en.wikipedia.org/wiki/normal_distribution
) with mean mu and standard deviation sigma.

+--------------------------------------+
|i1 : X = normalDistribution(30, 5)    |
|                                      |
|o1 = N(30,5)                          |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 25                     |
|                                      |
|o2 = .0483941449038287                |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 35                 |
|                                      |
|o3 = .841344746068543                 |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.75                  |
|                                      |
|o4 = 33.3724487509804                 |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 28.8971809640044                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

With no arguments, the standard normal distribution with mean 0 and standard
deviation 1 is returned.

+--------------------------------------+
|i6 : Z = normalDistribution()         |
|                                      |
|o6 = N(0,1)                           |
|                                      |
|o6 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i7 : quantile_Z 0.975                 |
|                                      |
|o7 = 1.95996398454005                 |
|                                      |
|o7 : RR (of precision 53)             |
+--------------------------------------+

Ways to use normalDistribution :
================================

  * "normalDistribution()"
  * "normalDistribution(Constant,Constant)"
  * "normalDistribution(Constant,Number)"
  * "normalDistribution(Number,Constant)"
  * "normalDistribution(Number,Number)"

For the programmer
==================

The object normalDistribution, is a method function (Macaulay2Doc).

poissonDistribution -- Poisson distribution
*******************************************

Synopsis
========

  * Usage:
        poissonDistribution lambda
  * Inputs:
      * lambda, a number (Macaulay2Doc), the rate parameter;
  * Outputs:
      * a discrete probability distribution,

Description
===========

The Poisson distribution (see
https://en.wikipedia.org/wiki/Poisson_distribution ), the distribution of the
number of events to occur during some interval of time when the expected number
of events is lambda.

+------------------------------------+
|i1 : X = poissonDistribution 10     |
|                                    |
|o1 = Pois(10)                       |
|                                    |
|o1 : DiscreteProbabilityDistribution|
+------------------------------------+
|i2 : density_X 2                    |
|                                    |
|o2 = .00226999648812424             |
|                                    |
|o2 : RR (of precision 53)           |
+------------------------------------+
|i3 : probability_X 3                |
|                                    |
|o3 = .0103360506759257              |
|                                    |
|o3 : RR (of precision 53)           |
+------------------------------------+
|i4 : quantile_X 0.4                 |
|                                    |
|o4 = 9                              |
+------------------------------------+
|i5 : random X                       |
|                                    |
|o5 = 14                             |
+------------------------------------+

Ways to use poissonDistribution :
=================================

  * "poissonDistribution(Constant)"
  * "poissonDistribution(Number)"

For the programmer
==================

The object poissonDistribution, is a method function (Macaulay2Doc).

probability -- cumulative distribution function
***********************************************

Synopsis
========

  * Usage:
        probability_X x
  * Inputs:
      * X, a probability distribution,
      * x, a real number (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * LowerTail => a Boolean value (Macaulay2Doc), default
        value true
  * Outputs:
      * a real number (Macaulay2Doc),

Description
===========

The cumulative distribution function (see
https://en.wikipedia.org/wiki/cumulative_distribution_function ) of the
probability distribution, i.e., the lower tail probability \(F_X(x) = P(X \leq
x)\).

+--------------------------------------+
|i1 : Z = normalDistribution()         |
|                                      |
|o1 = N(0,1)                           |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : probability_Z 1.96               |
|                                      |
|o2 = .97500210485178                  |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+

If the LowerTail option is false, then it instead computes the value of the
survival function (see https://en.wikipedia.org/wiki/survival_function ), i.e.,
the upper tail probability \(S_X(x) = P(X > x)\).

+--------------------------------------------+
|i3 : probability_Z(1.96, LowerTail => false)|
|                                            |
|o3 = .0249978951482204                      |
|                                            |
|o3 : RR (of precision 53)                   |
+--------------------------------------------+

Ways to use probability :
=========================

  * "probability(DiscreteProbabilityDistribution,Constant)"
  * "probability(DiscreteProbabilityDistribution,Number)"
  * "probability(ProbabilityDistribution,Constant)"
  * "probability(ProbabilityDistribution,Number)"

For the programmer
==================

The object probability, is a method function with options (Macaulay2Doc).

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 (Macaulay2Doc).
+-----------------------------------------------------------------------------+
|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 => -*Function[/usr/share/Macaulay2/Probability.m2:300:11-300:|
|Description => N(0,1)                                                        |
|DistributionFunction => -*Function[/usr/share/Macaulay2/Probability.m2:301:35|
|QuantileFunction => -*Function[/usr/share/Macaulay2/Probability.m2:303:31-304|
|RandomGeneration => -*Function[/usr/share/Macaulay2/Probability.m2:306:32-307|
|Support => (-infinity, infinity)                                             |
|-----------------------------------------------------------------------------|
|73]*-     }                                                                  |
|                                                                             |
|-302:53]*-                                                                   |
|:54]*-                                                                       |
|:74]*-                                                                       |
+-----------------------------------------------------------------------------+

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

Types of probability distribution :
===================================

  * "ContinuousProbabilityDistribution"
  * "DiscreteProbabilityDistribution"

Methods that use a probability distribution :
=============================================

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

For the programmer
==================

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

quantile -- quantile function
*****************************

Synopsis
========

  * Usage:
        quantile_X p
  * Inputs:
      * X, a probability distribution,
      * p, a real number (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * LowerTail => a Boolean value (Macaulay2Doc), default
        value true
  * Outputs:
      * a real number (Macaulay2Doc),

Description
===========

For continuous probability distributions, the quantile function (see
https://en.wikipedia.org/wiki/quantile_function ) is the inverse of the
cumulative distribution function, i.e., \(x\) for which \(P(X \leq x) = p\).

+--------------------------------------+
|i1 : Z = normalDistribution()         |
|                                      |
|o1 = N(0,1)                           |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : quantile_Z 0.95                  |
|                                      |
|o2 = 1.64485362695147                 |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_Z oo                 |
|                                      |
|o3 = .95                              |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+

For discrete probability distributions, it returns the smallest \(x\) for which
\(P(X \leq x) \geq p\).

+---------------------------------------+
|i4 : X = binomialDistribution(10, 0.25)|
|                                       |
|o4 = B(10,.25)                         |
|                                       |
|o4 : DiscreteProbabilityDistribution   |
+---------------------------------------+
|i5 : quantile_X 0.75                   |
|                                       |
|o5 = 3                                 |
+---------------------------------------+
|i6 : probability_X 2                   |
|                                       |
|o6 = .525592803955078                  |
|                                       |
|o6 : RR (of precision 53)              |
+---------------------------------------+
|i7 : probability_X 3                   |
|                                       |
|o7 = .775875091552734                  |
|                                       |
|o7 : RR (of precision 53)              |
+---------------------------------------+

If the LowerTail option is false, then it instead finds \(x\) for which \(P(X >
x) = p\) in the continuous case.

+------------------------------------------+
|i8 : quantile_Z(0.95, LowerTail => false) |
|                                          |
|o8 = -1.64485362695147                    |
|                                          |
|o8 : RR (of precision 53)                 |
+------------------------------------------+
|i9 : probability_Z(oo, LowerTail => false)|
|                                          |
|o9 = .95                                  |
|                                          |
|o9 : RR (of precision 53)                 |
+------------------------------------------+

In the discrete case, it finds the smallest \(x\) for which \(P(X > x) \leq
p\).

+------------------------------------------+
|i10 : quantile_X(0.75, LowerTail => false)|
|                                          |
|o10 = 2                                   |
+------------------------------------------+
|i11 : probability_X(2, LowerTail => false)|
|                                          |
|o11 = .474407196044922                    |
|                                          |
|o11 : RR (of precision 53)                |
+------------------------------------------+
|i12 : probability_X(1, LowerTail => false)|
|                                          |
|o12 = .755974769592285                    |
|                                          |
|o12 : RR (of precision 53)                |
+------------------------------------------+

Ways to use quantile :
======================

  * "quantile(DiscreteProbabilityDistribution,Constant)"
  * "quantile(DiscreteProbabilityDistribution,Number)"
  * "quantile(ProbabilityDistribution,Constant)"
  * "quantile(ProbabilityDistribution,Number)"

For the programmer
==================

The object quantile, is a method function with options (Macaulay2Doc).

QuantileFunction -- quantile function
*************************************

Description
===========

A key in ProbabilityDistribution, objects and an
option for discreteProbabilityDistribution,
and continuousProbabilityDistribution,
for setting the quantile function to be used
by quantile.

Functions with optional argument named QuantileFunction :
=========================================================

  * "continuousProbabilityDistribution(...,QuantileFunction=>...)" -- see
    continuousProbabilityDistribution, --
    construct a continuous probability distribution
  * "discreteProbabilityDistribution(...,QuantileFunction=>...)" -- see
    discreteProbabilityDistribution, --
    construct a discrete probability distribution

For the programmer
==================

The object QuantileFunction, is a symbol (Macaulay2Doc).

random(ProbabilityDistribution) -- randomly generate samples from probability distribution
******************************************************************************************

Synopsis
========

  * Function: random (Macaulay2Doc),
  * Usage:
        random X
  * Inputs:
      * X, a probability distribution,
  * Optional inputs (Macaulay2Doc),:
      * Density (Macaulay2Doc), => ...,
        default value 1, null
      * Height (Macaulay2Doc), => ..., default value 10,
        null
      * MaximalRank (Macaulay2Doc), => ...,
        default value false, null
      * UpperTriangular (Macaulay2Doc), =>
        ..., default value false, null
  * Outputs:
      * a real number (Macaulay2Doc),

Description
===========

Randomly generate samples from the given probability distribution.

+-----------------------------------------------------------------------------+
|i1 : Z = normalDistribution()                                                |
|                                                                             |
|o1 = N(0,1)                                                                  |
|                                                                             |
|o1 : ContinuousProbabilityDistribution                                       |
+-----------------------------------------------------------------------------+
|i2 : for i to 10 list random Z                                               |
|                                                                             |
|o2 = {-.220564, -1.04988, -.592586, .0568131, .195867, -.17318, .822224,     |
|     ------------------------------------------------------------------------|
|     -.387842, -.0571517, .601504, -1.34091}                                 |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * random(ProbabilityDistribution),
    -- randomly generate samples from probability distribution

RandomGeneration -- random generation function
**********************************************

Description
===========

A key in ProbabilityDistribution, objects and an
option for discreteProbabilityDistribution,
and continuousProbabilityDistribution,
for setting the random generation function
to be used by random(ProbabilityDistribution).

Functions with optional argument named RandomGeneration :
=========================================================

  * "continuousProbabilityDistribution(...,RandomGeneration=>...)" -- see
    continuousProbabilityDistribution, --
    construct a continuous probability distribution
  * "discreteProbabilityDistribution(...,RandomGeneration=>...)" -- see
    discreteProbabilityDistribution, --
    construct a discrete probability distribution

For the programmer
==================

The object RandomGeneration, is a symbol (Macaulay2Doc).

Support -- support for probability distribution
***********************************************

Description
===========

A key in ProbabilityDistribution, objects and an
option for discreteProbabilityDistribution,
and continuousProbabilityDistribution,
for setting the support of the probability
distribution.

Functions with optional argument named Support :
================================================

  * "continuousProbabilityDistribution(...,Support=>...)" -- see
    continuousProbabilityDistribution, --
    construct a continuous probability distribution
  * "discreteProbabilityDistribution(...,Support=>...)" -- see
    discreteProbabilityDistribution, --
    construct a discrete probability distribution

For the programmer
==================

The object Support, is a symbol (Macaulay2Doc).

tDistribution -- Student's t-distribution
*****************************************

Synopsis
========

  * Usage:
        tDistribution df
  * Inputs:
      * df, a number (Macaulay2Doc), the degrees of freedom
        (positive);
  * Outputs:
      * a continuous probability distribution,

Description
===========

The Student's t-distribution (see
https://en.wikipedia.org/wiki/Student's_t-distribution ).

+--------------------------------------+
|i1 : X = tDistribution 5              |
|                                      |
|o1 = t(5)                             |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 2                      |
|                                      |
|o2 = .0650903103262165                |
|                                      |
|o2 : RR (of precision 53)             |
+--------------------------------------+
|i3 : probability_X 3                  |
|                                      |
|o3 = .984950376051269                 |
|                                      |
|o3 : RR (of precision 53)             |
+--------------------------------------+
|i4 : quantile_X 0.4                   |
|                                      |
|o4 = -.267180865704144                |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 1.42096698549053                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

Ways to use tDistribution :
===========================

  * "tDistribution(Constant)"
  * "tDistribution(Number)"

For the programmer
==================

The object tDistribution, is a method function (Macaulay2Doc).

uniformDistribution -- continuous uniform distribution
******************************************************

Synopsis
========

  * Usage:
        uniformDistribution(a, b)
  * Inputs:
      * a, a number (Macaulay2Doc),
      * b, a number (Macaulay2Doc), greater than a;
  * Outputs:
      * a continuous probability distribution,

Description
===========

The continuous uniform distribution.

+--------------------------------------+
|i1 : X = uniformDistribution(3, 7)    |
|                                      |
|o1 = U(3,7)                           |
|                                      |
|o1 : ContinuousProbabilityDistribution|
+--------------------------------------+
|i2 : density_X 4                      |
|                                      |
|     1                                |
|o2 = -                                |
|     4                                |
|                                      |
|o2 : QQ                               |
+--------------------------------------+
|i3 : probability_X 5                  |
|                                      |
|     1                                |
|o3 = -                                |
|     2                                |
|                                      |
|o3 : QQ                               |
+--------------------------------------+
|i4 : quantile_X 0.6                   |
|                                      |
|o4 = 5.4                              |
|                                      |
|o4 : RR (of precision 53)             |
+--------------------------------------+
|i5 : random X                         |
|                                      |
|o5 = 6.57084736738766                 |
|                                      |
|o5 : RR (of precision 53)             |
+--------------------------------------+

With no arguments, the standard uniform distribution on [0, 1] is returned.

+--------------------------------------+
|i6 : uniformDistribution()            |
|                                      |
|o6 = U(0,1)                           |
|                                      |
|o6 : ContinuousProbabilityDistribution|
+--------------------------------------+

Ways to use uniformDistribution :
=================================

  * "uniformDistribution()"
  * "uniformDistribution(Constant,Constant)"
  * "uniformDistribution(Constant,Number)"
  * "uniformDistribution(Number,Constant)"
  * "uniformDistribution(Number,Number)"

For the programmer
==================

The object uniformDistribution, is a method function (Macaulay2Doc).