[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Índice] [ ? ]

48. distrib


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Índice] [ ? ]

48.1 Introduction to distrib

Package distrib contains a set of functions for making probability computations on both discrete and continuous univariate models.

What follows is a short reminder of basic probabilistic related definitions.

Let f(x) be the density function of an absolute continuous random variable X. The distribution function is defined as

 
                       x
                      /
                      [
               F(x) = I     f(u) du
                      ]
                      /
                       minf

which equals the probability Pr(X <= x).

The mean value is a localization parameter and is defined as

 
                     inf
                    /
                    [
           E[X]  =  I   x f(x) dx
                    ]
                    /
                     minf

The variance is a measure of variation,

 
                 inf
                /
                [                    2
         V[X] = I     f(x) (x - E[X])  dx
                ]
                /
                 minf

which is a positive real number. The square root of the variance is the standard deviation, D[X]=sqrt(V[X]), and it is another measure of variation.

The skewness coefficient is a measure of non-symmetry,

 
                 inf
                /
            1   [                    3
  SK[X] = ----- I     f(x) (x - E[X])  dx
              3 ]
          D[X]  /
                 minf

And the kurtosis coefficient measures the peakedness of the distribution,

 
                 inf
                /
            1   [                    4
  KU[X] = ----- I     f(x) (x - E[X])  dx - 3
              4 ]
          D[X]  /
                 minf

If X is gaussian, KU[X]=0. In fact, both skewness and kurtosis are shape parameters used to measure the non-gaussianity of a distribution.

If the random variable X is discrete, the density, or probability, function f(x) takes positive values within certain countable set of numbers x_i, and zero elsewhere. In this case, the distribution function is

 
                       ====
                       \
                F(x) =  >    f(x )
                       /        i
                       ====
                      x <= x
                       i

The mean, variance, standard deviation, skewness coefficient and kurtosis coefficient take the form

 
                       ====
                       \
                E[X] =  >  x  f(x ) ,
                       /    i    i
                       ====
                        x 
                         i
 
                ====
                \                     2
        V[X] =   >    f(x ) (x - E[X])  ,
                /        i    i
                ====
                 x
                  i
 
               D[X] = sqrt(V[X]),
 
                     ====
              1      \                     3
  SK[X] =  -------    >    f(x ) (x - E[X])  
           D[X]^3    /        i    i
                     ====
                      x
                       i

and

 
                     ====
              1      \                     4
  KU[X] =  -------    >    f(x ) (x - E[X])   - 3 ,
           D[X]^4    /        i    i
                     ====
                      x
                       i

respectively.

Package distrib includes functions for simulating random variates. Some of these functions make use of optional variables indicating the algorithm to be used. The general inverse method (based on the fact that if u is an uniform random number in (0,1), then F^(-1)(u) is a random variate with distribution F) is implemented in most cases; this is a suboptimal method in terms of timing, but useful for comparing with other algorithms. In this example, the performance of algorithms ahrens_cheng and inverse for simulating chi-square variates are compared by means of their histograms:

 
(%i1) load(descriptive)$
(%i2) showtime:true$
Evaluation took 0.00 seconds (0.00 elapsed) using 80 bytes.
(%i3) rchi2_algorithm: 'ahrens_cheng$ histogram(rchi2(10,500))$
Evaluation took 0.00 seconds (0.00 elapsed) using 80 bytes.
Evaluation took 0.70 seconds (0.77 elapsed) using 5.517 MB.
(%i5) rchi2_algorithm: 'inverse$ histogram(rchi2(10,500))$
Evaluation took 0.00 seconds (0.00 elapsed) using 80 bytes.
Evaluation took 10.37 seconds (10.45 elapsed) using 321.278 MB.

In order to make visual comparisons among algorithms for a discrete variate, function barsplot of the descriptive package should be used.

Note that some work remains to be done, since these simulating functions are not yet checked by more rigurous goodness of fit tests.

Please, consult an introductory manual on probability and statistics for more information about all this mathematical stuff.

There is a naming convention in package distrib. Every function name has two parts, the first one makes reference to the function or parameter we want to calculate,

 
Functions:
   Density function            (den*)
   Distribution function       (dis*)
   Quantile                    (q*)
   Mean                        (mean*)
   Variance                    (var*)
   Standard deviation          (std*)
   Skewness coefficient        (skw*)
   Kurtosis coefficient        (kur*)
   Random variate              (r*)

The second part is an explicit reference to the probabilistic model,

 
Continuous distributions:
   Normal              (*normal)
   Student             (*student)
   Chi^2               (*chi2)
   F                   (*f)
   Exponential         (*exp)
   Lognormal           (*logn)
   Gamma               (*gamma)
   Beta                (*beta)
   Continuous uniform  (*contu)
   Logistic            (*log)
   Pareto              (*pareto)
   Weibull             (*weibull)
   Rayleigh            (*rayleigh)
   Laplace             (*laplace)
   Cauchy              (*cauchy)
   Gumbel              (*gumbel)

Discrete distributions:
   Binomial             (*binomial)
   Poisson              (*poisson)
   Bernoulli            (*bernoulli)
   Geometric            (*geo)
   Discrete uniform     (*discu)
   Hypergeometric       (*hypergeo)
   Negative binomial    (*negbinom)

For example, denstudent(x,n) is the density function of the Student distribution with n degrees of freedom, stdpareto(a,b) is the standard deviation of the Pareto distribution with parameters a and b and kurpoisson(m) is the kurtosis coefficient of the Poisson distribution with mean m.

In order to make use of package distrib you need first to load it by typing

 
(%i1) load(distrib)$

For comments, bugs or suggestions, please contact the author at 'mario AT edu DOT xunta DOT es'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Índice] [ ? ]

48.2 Definitions for continuous distributions

Function: dennormal (x,m,s)

Returns the value at x of the density function of a normal random variable N(m,s), with s>0.

Function: disnormal (x,m,s)

Returns the value at x of the distribution function of a normal random variable N(m,s), with s>0. This function is defined in terms of Maxima's built-in error function erf.

 
(%i1) assume(s>0)$ disnormal(x,m,s);
                         x - m
                   erf(---------)
                       sqrt(2) s    1
(%o2)              -------------- + -
                         2          2

See also erf.

Function: qnormal (q,m,s)

Returns the q-quantile of a normal random variable N(m,s), with s>0; in other words, this is the inverse of disnormal. Argument q must be an element of [0,1].

Function: meannormal (m,s)

Returns the mean of a normal random variable N(m,s), with s>0, namely m.

Function: varnormal (m,s)

Returns the variance of a normal random variable N(m,s), with s>0, namely s^2.

Function: stdnormal (m,s)

Returns the standard deviation of a normal random variable N(m,s), with s>0, namely s.

Function: skwnormal (m,s)

Returns the skewness coefficient of a normal random variable N(m,s), with s>0, which is always equal to 0.

Function: kurnormal (m,s)

Returns the kurtosis coefficient of a normal random variable N(m,s), with s>0, which is always equal to 0.

Option variable: rnormal_algorithm

Default value: box_mueller

This is the selected algorithm for simulating random normal variates. Implemented algorithms are box_mueller and inverse:

See also rnormal.

Function: rnormal (m,s)
Function: rnormal (m,s,n)

Returns a normal random variate N(m,s), with s>0. Calling rnormal with a third argument n, a random sample of size n will be simulated.

There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rnormal_algorithm, which defaults to box_mueller.

There is also a built-in Maxima function for simulating random normal variates based on the so called Marsaglia's Ziggurat method.

See also rnormal_algorithm and gauss.

Function: denstudent (x,n)

Returns the value at x of the density function of a Student random variable t(n), with n>0.

Function: disstudent (x,n)

Returns the value at x of the distribution function of a Student random variable t(n), with n>0. This function has no closed form and it is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) disstudent(1/2, 7/3);
                                 1  7
(%o1)                 disstudent(-, -)
                                 2  3
(%i2) %,numer;
(%o2)                .6698450596140417
Function: qstudent (q,n)

Returns the q-quantile of a Student random variable t(n), with n>0; in other words, this is the inverse of disstudent. Argument q must be an element of [0,1].

Function: meanstudent (n)

Returns the mean of a Student random variable t(n), with n>0, which is always equal to 0.

Function: varstudent (n)

Returns the variance of a Student random variable t(n), with n>2.

 
(%i1) assume(n>2)$  varstudent(n);
                            n
(%o2)                     -----
                          n - 2
Function: stdstudent (n)

Returns the standard deviation of a Student random variable t(n), with n>2.

Function: skwstudent (n)

Returns the skewness coefficient of a Student random variable t(n), with n>3, which is always equal to 0.

Function: kurstudent (n)

Returns the kurtosis coefficient of a Student random variable t(n), with n>4.

Option variable: rstudent_algorithm

Default value: ratio

This is the selected algorithm for simulating random Student variates. Implemented algorithms are inverse and ratio:

See also rstudent.

Function: rstudent (n)
Function: rstudent (n,m)

Returns a Student random variate t(n), with n>0. Calling rstudent with a second argument m, a random sample of size m will be simulated.

There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rstudent_algorithm, which defaults to ratio.

See also rstudent_algorithm.

Function: denchi2 (x,n)

Returns the value at x of the density function of a Chi-square random variable Chi^2(n), with n>0.

The Chi^2(n) random variable is equivalent to the Gamma(n/2,2), therefore when Maxima has not enough information to get the result, a nominal form based on the gamma density is returned.

 
(%i1) denchi2(x,n);
                                 n
(%o1)                dengamma(x, -, 2)
                                 2
(%i2) assume(x>0, n>0)$  denchi2(x,n);
                       n/2 - 1   - x/2
                      x        %e
(%o2)                 ----------------
                        n/2       n
                       2    gamma(-)
                                  2
Function: dischi2 (x,n)

Returns the value at x of the distribution function of a Chi-square random variable Chi^2(n), with n>0.

This function has no closed form and it is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression based on the gamma distribution, since the Chi^2(n) random variable is equivalent to the Gamma(n/2,2).

 
(%i1) dischi2(3,4);
(%o1)               disgamma(3, 2, 2)
(%i2) dischi2(3,4),numer;
(%o2)               .4421745996289249
Function: qchi2 (q,n)

Returns the q-quantile of a Chi-square random variable Chi^2(n), with n>0; in other words, this is the inverse of dischi2. Argument q must be an element of [0,1].

This function has no closed form and it is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression based on the gamma quantile function, since the Chi^2(n) random variable is equivalent to the Gamma(n/2,2).

 
(%i1) qchi2(0.99,9);
(%o1)               21.66599433346194
(%i2) qchi2(0.99,n);
                                 n
(%o2)               qgamma(0.99, -, 2)
                                 2
Function: meanchi2 (n)

Returns the mean of a Chi-square random variable Chi^2(n), with n>0.

The Chi^2(n) random variable is equivalent to the Gamma(n/2,2), therefore when Maxima has not enough information to get the result, a nominal form based on the gamma mean is returned.

 
(%i1) meanchi2(n);
                                 n
(%o1)                  meangamma(-, 2)
                                 2
(%i2) assume(n>0)$ meanchi2(n);
(%o3)                        n
Function: varchi2 (n)

Returns the variance of a Chi-square random variable Chi^2(n), with n>0.

The Chi^2(n) random variable is equivalent to the Gamma(n/2,2), therefore when Maxima has not enough information to get the result, a nominal form based on the gamma variance is returned.

 
(%i1) varchi2(n);
                               n
(%o1)                 vargamma(-, 2)
                               2
(%i2) assume(n>0)$ varchi2(n);
(%o3)                      2 n
Function: stdchi2 (n)

Returns the standard deviation of a Chi-square random variable Chi^2(n), with n>0.

The Chi^2(n) random variable is equivalent to the Gamma(n/2,2), therefore when Maxima has not enough information to get the result, a nominal form based on the gamma standard deviation is returned.

 
(%i1) stdchi2(n);
                               n
(%o1)                 stdgamma(-, 2)
                               2
(%i2) assume(n>0)$ stdchi2(n);
(%o3)                sqrt(2) sqrt(n)
Function: skwchi2 (n)

Returns the skewness coefficient of a Chi-square random variable Chi^2(n), with n>0.

The Chi^2(n) random variable is equivalent to the Gamma(n/2,2), therefore when Maxima has not enough information to get the result, a nominal form based on the gamma skewness coefficient is returned.

 
(%i1) skwchi2(n);
                               n
(%o1)                 skwgamma(-, 2)
                               2
(%i2) assume(n>0)$ skwchi2(n);
                        2 sqrt(2)
(%o3)                   ---------
                         sqrt(n)
Function: kurchi2 (n)

Returns the kurtosis coefficient of a Chi-square random variable Chi^2(n), with n>0.

The Chi^2(n) random variable is equivalent to the Gamma(n/2,2), therefore when Maxima has not enough information to get the result, a nominal form based on the gamma kurtosis coefficient is returned.

 
(%i1) kurchi2(n);
                               n
(%o1)                 kurgamma(-, 2)
                               2
(%i2) assume(n>0)$ kurchi2(n);
                            12
(%o3)                       --
                            n
Option variable: rchi2_algorithm

Default value: ahrens_cheng

This is the selected algorithm for simulating random Chi-square variates. Implemented algorithms are ahrens_cheng and inverse:

See also rchi2.

Function: rchi2 (n)
Function: rchi2 (n,m)

Returns a Chi-square random variate Chi^2(n), with n>0. Calling rchi2 with a second argument m, a random sample of size m will be simulated.

There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rchi2_algorithm, which defaults to ahrens_cheng.

See also rchi2_algorithm.

Function: denf (x,m,n)

Returns the value at x of the density function of a F random variable F(m,n), with m,n>0.

Function: disf (x,m,n)

Returns the value at x of the distribution function of a F random variable F(m,n), with m,n>0. This function has no closed form and it is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) disf(2,3,9/4);
                                 9
(%o1)                 disf(2, 3, -)
                                 4
(%i2) %,numer;
(%o2)                0.66756728179008
Function: qf (q,m,n)

Returns the q-quantile of a F random variable F(m,n), with m,n>0; in other words, this is the inverse of disf. Argument q must be an element of [0,1].

This function has no closed form and it is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) qf(2/5,sqrt(3),5);
                       2
(%o1)               qf(-, sqrt(3), 5)
                       5
(%i2) %,numer;
(%o2)               0.518947838573693
Function: meanf (m,n)

Returns the mean of a F random variable F(m,n), with m>0, n>2.

Function: varf (m,n)

Returns the variance of a F random variable F(m,n), with m>0, n>4.

Function: stdf (m,n)

Returns the standard deviation of a F random variable F(m,n), with m>0, n>4.

Function: skwf (m,n)

Returns the skewness coefficient of a F random variable F(m,n), with m>0, n>6.

Function: kurf (m,n)

Returns the kurtosis coefficient of a F random variable F(m,n), with m>0, n>8.

Option variable: rf_algorithm

Default value: inverse

This is the selected algorithm for simulating random F variates. Implemented algorithms are ratio and inverse:

See also rf.

Function: rf (m,n)
Function: rf (m,n,k)

Returns a F random variate F(m,n), with m,n>0. Calling rf with a third argument k, a random sample of size k will be simulated.

There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rf_algorithm, which defaults to inverse.

See also rf_algorithm.

Function: denexp (x,m)

Returns the value at x of the density function of an exponential random variable Exp(m), with m>0.

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull density is returned.

 
(%i1) denexp(x,m);
                                    1
(%o1)              denweibull(x, 1, -)
                                    m
(%i2) assume(x>0,m>0)$  denexp(x,m);
                            - m x
(%o3)                   m %e
Function: disexp (x,m)

Returns the value at x of the distribution function of an exponential random variable Exp(m), with m>0.

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull distribution is returned.

 
(%i1) disexp(x,m);
                                    1
(%o1)              disweibull(x, 1, -)
                                    m
(%i2) assume(x>0,m>0)$  disexp(x,m);
                             - m x
(%o3)                  1 - %e
Function: qexp (q,m)

Returns the q-quantile of an exponential random variable Exp(m), with m>0; in other words, this is the inverse of disexp. Argument q must be an element of [0,1].

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull quantile is returned.

 
(%i51) qexp(0.56,5);
(%o1)               .1641961104139661
(%i2) qexp(0.56,m);
                                     1
(%o2)              qweibull(0.56, 1, -)
                                     m
Function: meanexp (m)

Returns the mean of an exponential random variable Exp(m), with m>0.

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull mean is returned.

 
(%i1) meanexp(m);
                                   1
(%o1)               meanweibull(1, -)
                                   m
(%i2) assume(m>0)$  meanexp(m);
                            1
(%o3)                       -
                            m
Function: varexp (m)

Returns the variance of an exponential random variable Exp(m), with m>0.

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull variance is returned.

 
(%i1) varexp(m);
                                   1
(%o2)                varweibull(1, -)
                                   m
(%i3) assume(m>0)$  varexp(m);
                            1
(%o4)                       --
                             2
                            m
Function: stdexp (m)

Returns the standard deviation of an exponential random variable Exp(m), with m>0.

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull standard deviation is returned.

 
(%i1) stdexp(m);
                                   1
(%o1)                stdweibull(1, -)
                                   m
(%i2) assume(m>0)$  stdexp(m);
                            1
(%o3)                       -
                            m
Function: skwexp (m)

Returns the skewness coefficient of an exponential random variable Exp(m), with m>0.

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull skewness coefficient is returned.

 
(%i1) skwexp(m);
                                   1
(%o1)                skwweibull(1, -)
                                   m
(%i2) assume(m>0)$  skwexp(m);
(%o3)                       2
Function: kurexp (m)

Returns the kurtosis coefficient of an exponential random variable Exp(m), with m>0.

The Exp(m) random variable is equivalent to the Weibull Wei(1,1/m), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull kurtosis coefficient is returned.

 
(%i1) kurexp(m);
                                   1
(%o1)                kurweibull(1, -)
                                   m
(%i2) assume(m>0)$  kurexp(m);
(%o3)                       6
Option variable: rexp_algorithm

Default value: inverse

This is the selected algorithm for simulating random exponential variates. Implemented algorithms are inverse, ahrens_cheng and ahrens_dieter

See also rexp.

Function: rexp (m)
Function: rexp (m,k)

Returns an exponential random variate Exp(m), with m>0. Calling rexp2 with a second argument k, a random sample of size k will be simulated.

There are three algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rexp_algorithm, which defaults to inverse.

See also rexp_algorithm.

Function: denlogn (x,m,s)

Returns the value at x of the density function of a log-normal random variable log-N(m,s), with s>0.

Function: dislogn (x,m,s)

Returns the value at x of the distribution function of a log-normal random variable log-N(m,s), with s>0. This function is defined in terms of Maxima's built-in error function erf.

 
(%i1) assume(s>0)$  dislogn(x,m,s);
                        log(x) - m
                    erf(----------)
                        sqrt(2) s     1
(%o2)               --------------- + -
                           2          2

See also erf.

Function: qlogn (q,m,s)

Returns the q-quantile of a log-normal random variable log-N(m,s), with s>0; in other words, this is the inverse of dislogn. Argument q must be an element of [0,1].

Function: meanlogn (m,s)

Returns the mean of a log-normal random variable log-N(m,s), with s>0.

Function: varlogn (m,s)

Returns the variance of a log-normal random variable log-N(m,s), with s>0.

Function: stdlogn (m,s)

Returns the standard deviation of a log-normal random variable log-N(m,s), with s>0.

Function: skwlogn (m,s)

Returns the skewness coefficient of a log-normal random variable log-N(m,s), with s>0.

Function: kurlogn (m,s)

Returns the kurtosis coefficient of a log-normal random variable log-N(m,s), with s>0.

Function: rlogn (m,s)
Function: rlogn (m,s,n)

Returns a log-normal random variate log-N(m,s), with s>0. Calling rlogn with a third argument n, a random sample of size n will be simulated.

Log-normal variates are simulated by means of random normal variates. There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rnormal_algorithm, which defaults to box_mueller.

See also rnormal_algorithm.

Function: dengamma (x,a,b)

Returns the value at x of the density function of a gamma random variable Gamma(a,b), with a,b>0.

Function: disgamma (x,a,b)

Returns the value at x of the distribution function of a gamma random variable Gamma(a,b), with a,b>0.

This function has no closed form and it is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) disgamma(3,5,21);
(%o1)                disgamma(3, 5, 21)
(%i2) %,numer;
(%o2)               4.402663157135039E-7
Function: qgamma (q,a,b)

Returns the q-quantile of a gamma random variable Gamma(a,b), with a,b>0; in other words, this is the inverse of disgamma. Argument q must be an element of [0,1].

Function: meangamma (a,b)

Returns the mean of a gamma random variable Gamma(a,b), with a,b>0.

Function: vargamma (a,b)

Returns the variance of a gamma random variable Gamma(a,b), with a,b>0.

Function: stdgamma (a,b)

Returns the standard deviation of a gamma random variable Gamma(a,b), with a,b>0.

Function: skwgamma (a,b)

Returns the skewness coefficient of a gamma random variable Gamma(a,b), with a,b>0.

Function: kurgamma (a,b)

Returns the kurtosis coefficient of a gamma random variable Gamma(a,b), with a,b>0.

Option variable: rgamma_algorithm

Default value: ahrens_cheng

This is the selected algorithm for simulating random gamma variates. Implemented algorithms are ahrens_cheng and inverse

See also rgamma.

Function: rgamma (a,b)
Function: rgamma (a,b,n)

Returns a gamma random variate Gamma(a,b), with a,b>0. Calling rgamma with a third argument n, a random sample of size n will be simulated.

There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rgamma_algorithm, which defaults to ahrens_cheng.

See also rgamma_algorithm.

Function: denbeta (x,a,b)

Returns the value at x of the density function of a beta random variable Beta(a,b), with a,b>0.

Function: disbeta (x,a,b)

Returns the value at x of the distribution function of a beta random variable Beta(a,b), with a,b>0.

This function has no closed form and it is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) disgamma(1/3,15,2);
                             1
(%o1)               disgamma(-, 15, 2)
                             3
(%i2) %,numer;
(%o2)             1.391214268475648E-24
Function: qbeta (q,a,b)

Returns the q-quantile of a beta random variable Beta(a,b), with a,b>0; in other words, this is the inverse of disbeta. Argument q must be an element of [0,1].

Function: meanbeta (a,b)

Returns the mean of a beta random variable Beta(a,b), with a,b>0.

Function: varbeta (a,b)

Returns the variance of a beta random variable Beta(a,b), with a,b>0.

Function: stdbeta (a,b)

Returns the standard deviation of a beta random variable Beta(a,b), with a,b>0.

Function: skwbeta (a,b)

Returns the skewness coefficient of a beta random variable Beta(a,b), with a,b>0.

Function: kurbeta (a,b)

Returns the kurtosis coefficient of a beta random variable Beta(a,b), with a,b>0.

Option variable: rbeta_algorithm

Default value: cheng

This is the selected algorithm for simulating random beta variates. Implemented algorithms are cheng, inverse and ratio

See also rbeta.

Function: rbeta (a,b)
Function: rbeta (a,b,n)

Returns a beta random variate Beta(a,b), with a,b>0. Calling rbeta with a third argument n, a random sample of size n will be simulated.

There are three algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rbeta_algorithm, which defaults to cheng.

See also rbeta_algorithm.

Function: dencontu (x,a,b)

Returns the value at x of the density function of a continuous uniform random variable cUnif(a,b), with a<b.

Function: discontu (x,a,b)

Returns the value at x of the distribution function of a continuous uniform random variable cUnif(a,b), with a<b.

Function: qcontu (q,a,b)

Returns the q-quantile of a continuous uniform random variable cUnif(a,b), with a<b; in other words, this is the inverse of discontu. Argument q must be an element of [0,1].

Function: meancontu (a,b)

Returns the mean of a continuous uniform random variable cUnif(a,b), with a<b.

Function: varcontu (a,b)

Returns the variance of a continuous uniform random variable cUnif(a,b), with a<b.

Function: stdcontu (a,b)

Returns the standard deviation of a continuous uniform random variable cUnif(a,b), with a<b.

Function: skwcontu (a,b)

Returns the skewness coefficient of a continuous uniform random variable cUnif(a,b), with a<b.

Function: kurcontu (a,b)

Returns the kurtosis coefficient of a continuous uniform random variable cUnif(a,b), with a<b.

Function: rcontu (a,b)
Function: rcontu (a,b,n)

Returns a continuous uniform random variate cUnif(a,b), with a<b. Calling rcontu with a third argument n, a random sample of size n will be simulated.

This is a direct application of the random built-in Maxima function.

See also random.

Function: denlog (x,a,b)

Returns the value at x of the density function of a logistic random variable log(a,b), with b>0.

Function: dislog (x,a,b)

Returns the value at x of the distribution function of a logistic random variable log(a,b), with b>0.

Function: qlog (q,a,b)

Returns the q-quantile of a logistic random variable log(a,b), with b>0; in other words, this is the inverse of dislog. Argument q must be an element of [0,1].

Function: meanlog (a,b)

Returns the mean of a logistic random variable log(a,b), with b>0.

Function: varlog (a,b)

Returns the variance of a logistic random variable log(a,b), with b>0.

Function: stdlog (a,b)

Returns the standard deviation of a logistic random variable log(a,b), with b>0.

Function: skwlog (a,b)

Returns the skewness coefficient of a logistic random variable log(a,b), with b>0.

Function: kurlog (a,b)

Returns the kurtosis coefficient of a logistic random variable log(a,b), with b>0.

Function: rlog (a,b)
Function: rlog (a,b,n)

Returns a logistic random variate log(a,b), with b>0. Calling rlog with a third argument n, a random sample of size n will be simulated.

Only the inverse method is implemented.

Function: denpareto (x,a,b)

Returns the value at x of the density function of a Pareto random variable Par(a,b), with a,b>0.

Function: dispareto (x,a,b)

Returns the value at x of the distribution function of a Pareto random variable Par(a,b), with a,b>0.

Function: qpareto (q,a,b)

Returns the q-quantile of a Pareto random variable Par(a,b), with a,b>0; in other words, this is the inverse of dispareto. Argument q must be an element of [0,1].

Function: meanpareto (a,b)

Returns the mean of a Pareto random variable Par(a,b), with a>1,b>0.

Function: varpareto (a,b)

Returns the variance of a Pareto random variable Par(a,b), with a>2,b>0.

Function: stdpareto (a,b)

Returns the standard deviation of a Pareto random variable Par(a,b), with a>2,b>0.

Function: skwpareto (a,b)

Returns the skewness coefficient of a Pareto random variable Par(a,b), with a>3,b>0.

Function: kurpareto (a,b)

Returns the kurtosis coefficient of a Pareto random variable Par(a,b), with a>4,b>0.

Function: rpareto (a,b)
Function: rpareto (a,b,n)

Returns a Pareto random variate Par(a,b), with a>0,b>0. Calling rpareto with a third argument n, a random sample of size n will be simulated.

Only the inverse method is implemented.

Function: denweibull (x,a,b)

Returns the value at x of the density function of a Weibull random variable Wei(a,b), with a,b>0.

Function: disweibull (x,a,b)

Returns the value at x of the distribution function of a Weibull random variable Wei(a,b), with a,b>0.

Function: qweibull (q,a,b)

Returns the q-quantile of a Weibull random variable Wei(a,b), with a,b>0; in other words, this is the inverse of disweibull. Argument q must be an element of [0,1].

Function: meanweibull (a,b)

Returns the mean of a Weibull random variable Wei(a,b), with a,b>0.

Function: varweibull (a,b)

Returns the variance of a Weibull random variable Wei(a,b), with a,b>0.

Function: stdweibull (a,b)

Returns the standard deviation of a Weibull random variable Wei(a,b), with a,b>0.

Function: skwweibull (a,b)

Returns the skewness coefficient of a Weibull random variable Wei(a,b), with a,b>0.

Function: kurweibull (a,b)

Returns the kurtosis coefficient of a Weibull random variable Wei(a,b), with a,b>0.

Function: rweibull (a,b)
Function: rweibull (a,b,n)

Returns a Weibull random variate Wei(a,b), with a,b>0. Calling rweibull with a third argument n, a random sample of size n will be simulated.

Only the inverse method is implemented.

Function: denrayleigh (x,b)

Returns the value at x of the density function of a Rayleigh random variable Ray(b), with b>0.

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull density is returned.

 
(%i1) denrayleigh(x,b);
                                    1
(%o1)              denweibull(x, 2, -)
                                    b
(%i2) assume(x>0,b>0)$ denrayleigh(x,b);
                                 2  2
                        2     - b  x
(%o3)                2 b  x %e
Function: disrayleigh (x,b)

Returns the value at x of the distribution function of a Rayleigh random variable Ray(b), with b>0.

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull distribution is returned.

 
(%i1) disrayleigh(x,b);
                                    1
(%o1)              disweibull(x, 2, -)
                                    b
(%i2) assume(x>0,b>0)$ disrayleigh(x,b);
                               2  2
                            - b  x
(%o3)                 1 - %e
Function: qrayleigh (q,b)

Returns the q-quantile of a Rayleigh random variable Ray(b), with b>0; in other words, this is the inverse of disrayleigh. Argument q must be an element of [0,1].

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull quantile is returned.

 
(%i1) qrayleigh(0.99,b);
                                     1
(%o1)              qweibull(0.99, 2, -)
                                     b
(%i2) assume(x>0,b>0)$ qrayleigh(0.99,b);
                    2.145966026289347
(%o3)               -----------------
                            b
Function: meanrayleigh (b)

Returns the mean of a Rayleigh random variable Ray(b), with b>0.

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull mean is returned.

 
(%i1) meanrayleigh(b);
                                   1
(%o1)               meanweibull(2, -)
                                   b
(%i2) assume(b>0)$ meanrayleigh(b);
                        sqrt(%pi)
(%o3)                   ---------
                           2 b
Function: varrayleigh (b)

Returns the variance of a Rayleigh random variable Ray(b), with b>0.

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull variance is returned.

 
(%i1) varrayleigh(b);
                                  1
(%o1)               varweibull(2, -)
                                  b
(%i2) assume(b>0)$ varrayleigh(b);
                             %pi
                         1 - ---
                              4
(%o3)                    -------
                            2
                           b
Function: stdrayleigh (b)

Returns the standard deviation of a Rayleigh random variable Ray(b), with b>0.

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull standard deviation is returned.

 
(%i1) stdrayleigh(b);
                                  1
(%o1)               stdweibull(2, -)
                                  b
(%i2) assume(b>0)$ stdrayleigh(b);
                               %pi
                      sqrt(1 - ---)
                                4
(%o3)                 -------------
                            b
Function: skwrayleigh (b)

Returns the skewness coefficient of a Rayleigh random variable Ray(b), with b>0.

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull skewness coefficient is returned.

 
(%i1) skwrayleigh(b);
                                  1
(%o1)               skwweibull(2, -)
                                  b
(%i2) assume(b>0)$ skwrayleigh(b);
                      3/2
                   %pi      3 sqrt(%pi)
                   ------ - -----------
                     4           4
(%o3)              --------------------
                            %pi 3/2
                       (1 - ---)
                             4
Function: kurrayleigh (b)

Returns the kurtosis coefficient of a Rayleigh random variable Ray(b), with b>0.

The Ray(b) random variable is equivalent to the Wei(2,1/b), therefore when Maxima has not enough information to get the result, a nominal form based on the Weibull kurtosis coefficient is returned.

 
(%i1) kurrayleigh(b);
                                  1
(%o1)               kurweibull(2, -)
                                  b
(%i2) assume(b>0)$ kurrayleigh(b);
                               2
                          3 %pi
                      2 - ------
                            16
(%o3)                 ---------- - 3
                           %pi 2
                      (1 - ---)
                            4
Function: rrayleigh (b)
Function: rrayleigh (b,n)

Returns a Rayleigh random variate Ray(b), with b>0. Calling rrayleigh with a second argument n, a random sample of size n will be simulated.

Only the inverse method is implemented.

Function: denlaplace (x,a,b)

Returns the value at x of the density function of a Laplace random variable Lap(a,b), with b>0.

Function: dislaplace (x,a,b)

Returns the value at x of the distribution function of a Laplace random variable Lap(a,b), with b>0.

Function: qlaplace (q,a,b)

Returns the q-quantile of a Laplace random variable Lap(a,b), with b>0; in other words, this is the inverse of dislaplace. Argument q must be an element of [0,1].

Function: meanlaplace (a,b)

Returns the mean of a Laplace random variable Lap(a,b), with b>0.

Function: varlaplace (a,b)

Returns the variance of a Laplace random variable Lap(a,b), with b>0.

Function: stdlaplace (a,b)

Returns the standard deviation of a Laplace random variable Lap(a,b), with b>0.

Function: skwlaplace (a,b)

Returns the skewness coefficient of a Laplace random variable Lap(a,b), with b>0.

Function: kurlaplace (a,b)

Returns the kurtosis coefficient of a Laplace random variable Lap(a,b), with b>0.

Function: rlaplace (a,b)
Function: rlaplace (a,b,n)

Returns a Laplace random variate Lap(a,b), with b>0. Calling rlaplace with a third argument n, a random sample of size n will be simulated.

Only the inverse method is implemented.

Function: dencauchy (x,a,b)

Returns the value at x of the density function of a Cauchy random variable Cau(a,b), with b>0.

Function: discauchy (x,a,b)

Returns the value at x of the distribution function of a Cauchy random variable Cau(a,b), with b>0.

Function: qcauchy (q,a,b)

Returns the q-quantile of a Cauchy random variable Cau(a,b), with b>0; in other words, this is the inverse of discauchy. Argument q must be an element of [0,1].

Function: rcauchy (a,b)
Function: rcauchy (a,b,n)

Returns a Cauchy random variate Cau(a,b), with b>0. Calling rcauchy with a third argument n, a random sample of size n will be simulated.

Only the inverse method is implemented.

Function: dengumbel (x,a,b)

Returns the value at x of the density function of a Gumbel random variable Gum(a,b), with b>0.

Function: disgumbel (x,a,b)

Returns the value at x of the distribution function of a Gumbel random variable Gum(a,b), with b>0.

Function: qgumbel (q,a,b)

Returns the q-quantile of a Gumbel random variable Gum(a,b), with b>0; in other words, this is the inverse of disgumbel. Argument q must be an element of [0,1].

Function: meangumbel (a,b)

Returns the mean of a Gumbel random variable Gum(a,b), with b>0.

 
(%i1) assume(b>0)$  meangumbel(a,b);
(%o2)                  %gamma b + a

where symbol %gamma stands for the Euler-Mascheroni constant. See also %gamma.

Function: vargumbel (a,b)

Returns the variance of a Gumbel random variable Gum(a,b), with b>0.

Function: stdgumbel (a,b)

Returns the standard deviation of a Gumbel random variable Gum(a,b), with b>0.

Function: skwgumbel (a,b)

Returns the skewness coefficient of a Gumbel random variable Gum(a,b), with b>0.

 
(%i1) assume(b>0)$  skwgumbel(a,b);
                    12 sqrt(6) zeta(3)
(%o2)               ------------------
                              3
                           %pi
(%i3) numer:true$ skwgumbel(a,b);
(%o4)               1.139547099404649

where zeta stands for the Riemann's zeta function.

Function: kurgumbel (a,b)

Returns the kurtosis coefficient of a Gumbel random variable Gum(a,b), with b>0.

Function: rgumbel (a,b)
Function: rgumbel (a,b,n)

Returns a Gumbel random variate Gum(a,b), with b>0. Calling rgumbel with a third argument n, a random sample of size n will be simulated.

Only the inverse method is implemented.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Índice] [ ? ]

48.3 Definitions for discrete distributions

Function: denbinomial (x,n,p)

Returns the value at x of the probability function of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.

Function: disbinomial (x,n,p)

Returns the value at x of the distribution function of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.

This function is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) disbinomial(5,7,1/6);
                                     1
(%o1)              disbinomial(5, 7, -)
                                     6
(%i2) disbinomial(5,7,1/6),numer;
(%o2)               .9998713991769548
Function: qbinomial (q,n,p)

Returns the q-quantile of a binomial random variable B(n,p), with 0<p<1 and n a positive integer; in other words, this is the inverse of disbinomial. Argument q must be an element of [0,1].

Function: meanbinomial (n,p)

Returns the mean of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.

Function: varbinomial (n,p)

Returns the variance of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.

Function: stdbinomial (n,p)

Returns the standard deviation of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.

Function: skwbinomial (n,p)

Returns the skewness coefficient of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.

Function: kurbinomial (n,p)

Returns the kurtosis coefficient of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.

Option variable: rbinomial_algorithm

Default value: kachit

This is the selected algorithm for simulating random binomial variates. Implemented algorithms are kachit, bernoulli and inverse:

See also rbinomial.

Function: rbinomial (n,p)
Function: rbinomial (n,p,m)

Returns a binomial random variate B(n,p), with 0<p<1 and n a positive integer. Calling rbinomial with a third argument m, a random sample of size m will be simulated.

There are three algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rbinomial_algorithm, which defaults to kachit.

See also rbinomial_algorithm.

Function: denpoisson (x,m)

Returns the value at x of the probability function of a Poisson random variable Poi(m), with m>0.

Function: dispoisson (x,m)

Returns the value at x of the distribution function of a Poisson random variable Poi(m), with m>0.

This function is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) dispoisson(3,5);
(%o1)                dispoisson(3, 5)
(%i2) dispoisson(3,5),numer;
(%o2)               .2650259152973617
Function: qpoisson (q,m)

Returns the q-quantile of a Poisson random variable Poi(m), with m>0; in other words, this is the inverse of dispoisson. Argument q must be an element of [0,1].

Function: meanpoisson (m)

Returns the mean of a Poisson random variable Poi(m), with m>0.

Function: varpoisson (m)

Returns the variance of a Poisson random variable Poi(m), with m>0.

Function: stdpoisson (m)

Returns the standard deviation of a Poisson random variable Poi(m), with m>0.

Function: skwpoisson (m)

Returns the skewness coefficient of a Poisson random variable Poi(m), with m>0.

Function: kurpoisson (m)

Returns the kurtosis coefficient of a Poisson random variable Poi(m), with m>0.

Option variable: rpoisson_algorithm

Default value: kachit

This is the selected algorithm for simulating random Poisson variates. Implemented algorithms are ahrens_dieter and inverse:

See also rpoisson.

Function: rpoisson (m)
Function: rpoisson (m,n)

Returns a Poisson random variate Poi(m), with m>0. Calling rpoisson with a second argument n, a random sample of size n will be simulated.

There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rpoisson_algorithm, which defaults to ahrens_dieter.

See also rpoisson_algorithm.

Function: denbernoulli (x,p)

Returns the value at x of the probability function of a Bernoulli random variable Ber(p), with 0<p<1.

The Ber(p) random variable is equivalent to the binomial B(1,p), therefore when Maxima has not enough information to get the result, a nominal form based on the binomial probability function is returned.

 
(%i1) denbernoulli(1,p);
(%o1)              denbinomial(1, 1, p)
(%i2) assume(0<p,p<1)$ denbernoulli(1,p);
(%o3)                       p
Function: disbernoulli (x,p)

Returns the value at x of the distribution function of a Bernoulli random variable Ber(p), with 0<p<1.

Function: qbernoulli (q,p)

Returns the q-quantile of a Bernoulli random variable Ber(p), with 0<p<1; in other words, this is the inverse of disbernoulli. Argument q must be an element of [0,1].

Function: meanbernoulli (p)

Returns the mean of a Bernoulli random variable Ber(p), with 0<p<1.

The Ber(p) random variable is equivalent to the binomial B(1,p), therefore when Maxima has not enough information to get the result, a nominal form based on the binomial mean is returned.

 
(%i1) meanbernoulli(p);
(%o1)               meanbinomial(1, p)
(%i2) assume(0<p,p<1)$ meanbernoulli(p);
(%o3)                       p
Function: varbernoulli (p)

Returns the variance of a Bernoulli random variable Ber(p), with 0<p<1.

The Ber(p) random variable is equivalent to the binomial B(1,p), therefore when Maxima has not enough information to get the result, a nominal form based on the binomial variance is returned.

 
(%i1) varbernoulli(p);
(%o1)               varbinomial(1, p)
(%i2) assume(0<p,p<1)$ varbernoulli(p);
(%o3)                   (1 - p) p
Function: stdbernoulli (p)

Returns the standard deviation of a Bernoulli random variable Ber(p), with 0<p<1.

The Ber(p) random variable is equivalent to the binomial B(1,p), therefore when Maxima has not enough information to get the result, a nominal form based on the binomial standard deviation is returned.

 
(%i1) stdbernoulli(p);
(%o1)              stdbinomial(1, p)
(%i2) assume(0<p,p<1)$ stdbernoulli(p);
(%o3)             sqrt(1 - p) sqrt(p)
Function: skwbernoulli (p)

Returns the skewness coefficient of a Bernoulli random variable Ber(p), with 0<p<1.

The Ber(p) random variable is equivalent to the binomial B(1,p), therefore when Maxima has not enough information to get the result, a nominal form based on the binomial skewness coefficient is returned.

 
(%i1) skwbernoulli(p);
(%o1)              skwbinomial(1, p)
(%i2) assume(0<p,p<1)$ skwbernoulli(p);
                        1 - 2 p
(%o3)             -------------------
                  sqrt(1 - p) sqrt(p)
Function: kurbernoulli (p)

Returns the kurtosis coefficient of a Bernoulli random variable Ber(p), with 0<p<1.

The Ber(p) random variable is equivalent to the binomial B(1,p), therefore when Maxima has not enough information to get the result, a nominal form based on the binomial kurtosis coefficient is returned.

 
(%i1) kurbernoulli(p);
(%o1)              kurbinomial(1, p)
(%i2) assume(0<p,p<1)$ kurbernoulli(p);
                    1 - 6 (1 - p) p
(%o3)               ---------------
                       (1 - p) p
Function: rbernoulli (p)
Function: rbernoulli (p,n)

Returns a Bernoulli random variate Ber(p), with 0<p<1. Calling rbernoulli with a second argument n, a random sample of size n will be simulated.

This is a direct application of the random built-in Maxima function.

See also random.

Function: dengeo (x,p)

Returns the value at x of the probability function of a geometric random variable Geo(p), with 0<p<1.

Function: disgeo (x,p)

Returns the value at x of the distribution function of a geometric random variable Geo(p), with 0<p<1.

Function: qgeo (q,p)

Returns the q-quantile of a geometric random variable Geo(p), with 0<p<1; in other words, this is the inverse of disgeo. Argument q must be an element of [0,1].

Function: meangeo (p)

Returns the mean of a geometric random variable Geo(p), with 0<p<1.

Function: vargeo (p)

Returns the variance of a geometric random variable Geo(p), with 0<p<1.

Function: stdgeo (p)

Returns the standard deviation of a geometric random variable Geo(p), with 0<p<1.

Function: skwgeo (p)

Returns the skewness coefficient of a geometric random variable Geo(p), with 0<p<1.

Function: kurgeo (p)

Returns the kurtosis coefficient of a geometric random variable Geo(p), with 0<p<1.

Option variable: rgeo_algorithm

Default value: bernoulli

This is the selected algorithm for simulating random geometric variates. Implemented algorithms are bernoulli, devroye and inverse:

See also rgeo.

Function: rgeo (p)
Function: rgeo (p,n)

Returns a geometric random variate Geo(p), with 0<p<1. Calling rgeo with a second argument n, a random sample of size n will be simulated.

There are three algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rgeo_algorithm, which defaults to bernoulli.

See also rgeo_algorithm.

Function: dendiscu (x,n)

Returns the value at x of the probability function of a discrete uniform random variable dUnif(n), with n a strictly positive integer.

Function: disdiscu (x,n)

Returns the value at x of the distribution function of a discrete uniform random variable dUnif(n), with n a strictly positive integer.

Function: qdiscu (q,n)

Returns the q-quantile of a discrete uniform random variable dUnif(n), with n a strictly positive integer; in other words, this is the inverse of disdiscu. Argument q must be an element of [0,1].

Function: meandiscu (n)

Returns the mean of a discrete uniform random variable dUnif(n), with n a strictly positive integer.

Function: vardiscu (n)

Returns the variance of a discrete uniform random variable dUnif(n), with n a strictly positive integer.

Function: stddiscu (n)

Returns the standard deviation of a discrete uniform random variable dUnif(n), with n a strictly positive integer.

Function: skwdiscu (n)

Returns the skewness coefficient of a discrete uniform random variable dUnif(n), with n a strictly positive integer.

Function: kurdiscu (n)

Returns the kurtosis coefficient of a discrete uniform random variable dUnif(n), with n a strictly positive integer.

Function: rdiscu (n)
Function: rdiscu (n,m)

Returns a uniform random variable dUnif(n), with n a strictly positive integer. Calling rdiscu with a second argument m, a random sample of size m will be simulated.

This is a direct application of the random built-in Maxima function.

See also random.

Function: denhypergeo (x,n1,n2,n)

Returns the value at x of the probability function of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.

Function: dishypergeo (x,n1,n2,n)

Returns the value at x of the distribution function of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.

Function: qhypergeo (q,n1,n2,n)

Returns the q-quantile of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2; in other words, this is the inverse of dishypergeo. Argument q must be an element of [0,1].

Function: meanhypergeo (n1,n2,n)

Returns the mean of a discrete uniform random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.

Function: varhypergeo (n1,n2,n)

Returns the variance of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.

Function: stdhypergeo (n1,n2,n)

Returns the standard deviation of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.

Function: skwhypergeo (n1,n2,n)

Returns the skewness coefficient of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.

Function: kurhypergeo (n1,n2,n)

Returns the kurtosis coefficient of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.

Option variable: rhypergeo_algorithm

Default value: kachit

This is the selected algorithm for simulating random hypergeometric variates. Implemented algorithms are kachit and inverse:

See also rhypergeo.

Function: rhypergeo (n1,n2,n)
Function: rhypergeo (n1,n2,n,m)

Returns a hypergeometric random variate Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2. Calling rhypergeo with a fourth argument m, a random sample of size m will be simulated.

There are two algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rhypergeo_algorithm, which defaults to kachit.

See also rhypergeo_algorithm.

Function: dennegbinom (x,n,p)

Returns the value at x of the probability function of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.

Function: disnegbinom (x,n,p)

Returns the value at x of the distribution function of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.

This function is numerically computed if the global variable numer equals true, otherwise it returns a nominal expression.

 
(%i1) disnegbinom(3,4,1/8);
                                     1
(%o1)              disnegbinom(3, 4, -)
                                     8
(%i2) disnegbinom(3,4,1/8),numer;
(%o2)              .006238937377929698
Function: qnegbinom (q,n,p)

Returns the q-quantile of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer; in other words, this is the inverse of disnegbinom. Argument q must be an element of [0,1].

Function: meannegbinom (n,p)

Returns the mean of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.

Function: varnegbinom (n,p)

Returns the variance of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.

Function: stdnegbinom (n,p)

Returns the standard deviation of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.

Function: skwnegbinom (n,p)

Returns the skewness coefficient of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.

Function: kurnegbinom (n,p)

Returns the kurtosis coefficient of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.

Option variable: rnegbinom_algorithm

Default value: bernoulli

This is the selected algorithm for simulating random negative binomial variates. Implemented algorithms are devroye, bernoulli and inverse:

See also rnegbinom.

Function: rnegbinoml (n,p)
Function: rnegbinom (n,p,m)

Returns a negative binomial random variate NB(n,p), with 0<p<1 and n a positive integer. Calling rnegbinoml with a third argument m, a random sample of size m will be simulated.

There are three algorithms implemented for this function, the one to be used can be selected giving a certain value to the global variable rnegbinom_algorithm, which defaults to bernoulli.

See also rnegbinom_algorithm.


[ << ] [ >> ]           [Top] [Contents] [Índice] [ ? ]

This document was generated by root on Outubro, 18 2006 using texi2html 1.76.