[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Índice] | [ ? ] |
48.1 Introduction to distrib | ||
48.2 Definitions for continuous distributions | ||
48.3 Definitions for discrete distributions |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Índice] | [ ? ] |
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] | [ ? ] |
Returns the value at x of the density function of a normal random variable N(m,s), with s>0.
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
.
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].
Returns the mean of a normal random variable N(m,s), with s>0, namely m.
Returns the variance of a normal random variable N(m,s), with s>0, namely s^2.
Returns the standard deviation of a normal random variable N(m,s), with s>0, namely s.
Returns the skewness coefficient of a normal random variable N(m,s), with s>0, which is always equal to 0.
Returns the kurtosis coefficient of a normal random variable N(m,s), with s>0, which is always equal to 0.
Default value: box_mueller
This is the selected algorithm for simulating random normal variates. Implemented algorithms are box_mueller
and inverse
:
box_mueller
, based on algorithm described in Knuth, D.E. (1981) Seminumerical Algorithms. The Art of Computer Programming.. Addison-Wesley.
inverse
, based on the general inverse method.
See also rnormal
.
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
.
Returns the value at x of the density function of a Student random variable t(n), with n>0.
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 |
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].
Returns the mean of a Student random variable t(n), with n>0, which is always equal to 0.
Returns the variance of a Student random variable t(n), with n>2.
(%i1) assume(n>2)$ varstudent(n); n (%o2) ----- n - 2 |
Returns the standard deviation of a Student random variable t(n), with n>2.
Returns the skewness coefficient of a Student random variable t(n), with n>3, which is always equal to 0.
Returns the kurtosis coefficient of a Student random variable t(n), with n>4.
Default value: ratio
This is the selected algorithm for simulating random Student variates. Implemented algorithms are inverse
and ratio
:
inverse
, based on the general inverse method.
ratio
, based on the fact that if Z is a normal random variable N(0,1) and S^2 is chi square random variable with n degrees of freedom, Chi^2(n), then
Z X = ------------- / 2 \ 1/2 | S | | --- | \ n / |
is a Student random variable with n degrees of freedom, t(n).
See also rstudent
.
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
.
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 |
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 |
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 |
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 |
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 |
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) |
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) |
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 |
Default value: ahrens_cheng
This is the selected algorithm for simulating random Chi-square variates. Implemented algorithms are ahrens_cheng
and inverse
:
ahrens_cheng
, based on the random simulation of gamma variates. See rgamma_algorithm
for details.
inverse
, based on the general inverse method.
See also rchi2
.
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
.
Returns the value at x of the density function of a F random variable F(m,n), with m,n>0.
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 |
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 |
Returns the mean of a F random variable F(m,n), with m>0, n>2.
Returns the variance of a F random variable F(m,n), with m>0, n>4.
Returns the standard deviation of a F random variable F(m,n), with m>0, n>4.
Returns the skewness coefficient of a F random variable F(m,n), with m>0, n>6.
Returns the kurtosis coefficient of a F random variable F(m,n), with m>0, n>8.
Default value: inverse
This is the selected algorithm for simulating random F variates. Implemented algorithms are ratio
and inverse
:
ratio
, based on the fact that if X is a Chi^2(m) random variable and Y is a Chi^2(n) random variable, then
n X F = --- m Y |
is a F random variable with m and n degrees of freedom, F(m,n).
inverse
, based on the general inverse method.
See also rf
.
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
.
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Default value: inverse
This is the selected algorithm for simulating random exponential variates. Implemented algorithms are inverse
, ahrens_cheng
and ahrens_dieter
inverse
, based on the general inverse method.
ahrens_cheng
, based on the fact that the Exp(m) random variable is equivalent to the Gamma(1,1/m). See rgamma_algorithm
for details.
ahrens_dieter
, based on algorithm described in Ahrens, J.H. and Dieter, U. (1972) Computer methods for sampling from the exponential and normal distributions.. Comm, ACM, 15, Oct., 873-882.
See also rexp
.
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
.
Returns the value at x of the density function of a log-normal random variable log-N(m,s), with s>0.
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
.
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].
Returns the mean of a log-normal random variable log-N(m,s), with s>0.
Returns the variance of a log-normal random variable log-N(m,s), with s>0.
Returns the standard deviation of a log-normal random variable log-N(m,s), with s>0.
Returns the skewness coefficient of a log-normal random variable log-N(m,s), with s>0.
Returns the kurtosis coefficient of a log-normal random variable log-N(m,s), with s>0.
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
.
Returns the value at x of the density function of a gamma random variable Gamma(a,b), with a,b>0.
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 |
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].
Returns the mean of a gamma random variable Gamma(a,b), with a,b>0.
Returns the variance of a gamma random variable Gamma(a,b), with a,b>0.
Returns the standard deviation of a gamma random variable Gamma(a,b), with a,b>0.
Returns the skewness coefficient of a gamma random variable Gamma(a,b), with a,b>0.
Returns the kurtosis coefficient of a gamma random variable Gamma(a,b), with a,b>0.
Default value: ahrens_cheng
This is the selected algorithm for simulating random gamma variates. Implemented algorithms are ahrens_cheng
and inverse
ahrens_cheng
, this is a combinantion of two procedures, depending on the value of parameter a:
For a>=1, Cheng, R.C.H. and Feast, G.M. (1979). Some simple gamma variate generators. Appl. Stat., 28, 3, 290-295.
For 0<a<1, Ahrens, J.H. and Dieter, U. (1974). Computer methods for sampling from gamma, beta, poisson and binomial distributions. Computing, 12, 223-246.
inverse
, based on the general inverse method.
See also rgamma
.
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
.
Returns the value at x of the density function of a beta random variable Beta(a,b), with a,b>0.
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 |
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].
Returns the mean of a beta random variable Beta(a,b), with a,b>0.
Returns the variance of a beta random variable Beta(a,b), with a,b>0.
Returns the standard deviation of a beta random variable Beta(a,b), with a,b>0.
Returns the skewness coefficient of a beta random variable Beta(a,b), with a,b>0.
Returns the kurtosis coefficient of a beta random variable Beta(a,b), with a,b>0.
Default value: cheng
This is the selected algorithm for simulating random beta variates. Implemented algorithms are cheng
, inverse
and ratio
cheng
, this is the algorithm defined in Cheng, R.C.H. (1978). Generating Beta Variates with Nonintegral Shape Parameters. Communications of the ACM, 21:317-322
inverse
, based on the general inverse method.
ratio
, based on the fact that if X is a random variable Gamma(a,1) and Y is Gamma(b,1), then the ratio X/(X+Y) is distributed as Beta(a,b).
See also rbeta
.
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
.
Returns the value at x of the density function of a continuous uniform random variable cUnif(a,b), with a<b.
Returns the value at x of the distribution function of a continuous uniform random variable cUnif(a,b), with 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].
Returns the mean of a continuous uniform random variable cUnif(a,b), with a<b.
Returns the variance of a continuous uniform random variable cUnif(a,b), with a<b.
Returns the standard deviation of a continuous uniform random variable cUnif(a,b), with a<b.
Returns the skewness coefficient of a continuous uniform random variable cUnif(a,b), with a<b.
Returns the kurtosis coefficient of a continuous uniform random variable cUnif(a,b), with a<b.
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
.
Returns the value at x of the density function of a logistic random variable log(a,b), with b>0.
Returns the value at x of the distribution function of a logistic random variable log(a,b), with b>0.
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].
Returns the mean of a logistic random variable log(a,b), with b>0.
Returns the variance of a logistic random variable log(a,b), with b>0.
Returns the standard deviation of a logistic random variable log(a,b), with b>0.
Returns the skewness coefficient of a logistic random variable log(a,b), with b>0.
Returns the kurtosis coefficient of a logistic random variable log(a,b), with b>0.
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.
Returns the value at x of the density function of a Pareto random variable Par(a,b), with a,b>0.
Returns the value at x of the distribution function of a Pareto random variable Par(a,b), with a,b>0.
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].
Returns the mean of a Pareto random variable Par(a,b), with a>1,b>0.
Returns the variance of a Pareto random variable Par(a,b), with a>2,b>0.
Returns the standard deviation of a Pareto random variable Par(a,b), with a>2,b>0.
Returns the skewness coefficient of a Pareto random variable Par(a,b), with a>3,b>0.
Returns the kurtosis coefficient of a Pareto random variable Par(a,b), with a>4,b>0.
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.
Returns the value at x of the density function of a Weibull random variable Wei(a,b), with a,b>0.
Returns the value at x of the distribution function of a Weibull random variable Wei(a,b), with a,b>0.
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].
Returns the mean of a Weibull random variable Wei(a,b), with a,b>0.
Returns the variance of a Weibull random variable Wei(a,b), with a,b>0.
Returns the standard deviation of a Weibull random variable Wei(a,b), with a,b>0.
Returns the skewness coefficient of a Weibull random variable Wei(a,b), with a,b>0.
Returns the kurtosis coefficient of a Weibull random variable Wei(a,b), with a,b>0.
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.
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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.
Returns the value at x of the density function of a Laplace random variable Lap(a,b), with b>0.
Returns the value at x of the distribution function of a Laplace random variable Lap(a,b), with b>0.
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].
Returns the mean of a Laplace random variable Lap(a,b), with b>0.
Returns the variance of a Laplace random variable Lap(a,b), with b>0.
Returns the standard deviation of a Laplace random variable Lap(a,b), with b>0.
Returns the skewness coefficient of a Laplace random variable Lap(a,b), with b>0.
Returns the kurtosis coefficient of a Laplace random variable Lap(a,b), with b>0.
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.
Returns the value at x of the density function of a Cauchy random variable Cau(a,b), with b>0.
Returns the value at x of the distribution function of a Cauchy random variable Cau(a,b), with b>0.
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].
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.
Returns the value at x of the density function of a Gumbel random variable Gum(a,b), with b>0.
Returns the value at x of the distribution function of a Gumbel random variable Gum(a,b), with b>0.
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].
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
.
Returns the variance of a Gumbel random variable Gum(a,b), with b>0.
Returns the standard deviation of a Gumbel random variable Gum(a,b), with b>0.
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.
Returns the kurtosis coefficient of a Gumbel random variable Gum(a,b), with b>0.
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] | [ ? ] |
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.
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 |
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].
Returns the mean of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.
Returns the variance of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.
Returns the standard deviation of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.
Returns the skewness coefficient of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.
Returns the kurtosis coefficient of a binomial random variable B(n,p), with 0<p<1 and n a positive integer.
Default value: kachit
This is the selected algorithm for simulating random binomial variates. Implemented algorithms are kachit
, bernoulli
and inverse
:
kachit
, based on algorithm described in Kachitvichyanukul, V. and Schmeiser, B.W. (1988) Binomial Random Variate Generation. Communications of the ACM, 31, Feb., 216.
bernoulli
, based on simulation of Bernoulli trials.
inverse
, based on the general inverse method.
See also rbinomial
.
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
.
Returns the value at x of the probability function of a Poisson random variable Poi(m), with m>0.
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 |
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].
Returns the mean of a Poisson random variable Poi(m), with m>0.
Returns the variance of a Poisson random variable Poi(m), with m>0.
Returns the standard deviation of a Poisson random variable Poi(m), with m>0.
Returns the skewness coefficient of a Poisson random variable Poi(m), with m>0.
Returns the kurtosis coefficient of a Poisson random variable Poi(m), with m>0.
Default value: kachit
This is the selected algorithm for simulating random Poisson variates. Implemented algorithms are ahrens_dieter
and inverse
:
ahrens_dieter
, based on algorithm described in Ahrens, J.H. and Dieter, U. (1982) Computer Generation of Poisson Deviates From Modified Normal Distributions. ACM Trans. Math. Software, 8, 2, June,163-179.
inverse
, based on the general inverse method.
See also rpoisson
.
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
.
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 |
Returns the value at x of the distribution function of a Bernoulli random variable Ber(p), with 0<p<1.
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].
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 |
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 |
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) |
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) |
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 |
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
.
Returns the value at x of the probability function of a geometric random variable Geo(p), with 0<p<1.
Returns the value at x of the distribution function of a geometric random variable Geo(p), with 0<p<1.
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].
Returns the mean of a geometric random variable Geo(p), with 0<p<1.
Returns the variance of a geometric random variable Geo(p), with 0<p<1.
Returns the standard deviation of a geometric random variable Geo(p), with 0<p<1.
Returns the skewness coefficient of a geometric random variable Geo(p), with 0<p<1.
Returns the kurtosis coefficient of a geometric random variable Geo(p), with 0<p<1.
Default value: bernoulli
This is the selected algorithm for simulating random geometric variates. Implemented algorithms are bernoulli
, devroye
and inverse
:
bernoulli
, based on simulation of Bernoulli trials.
devroye
, based on algorithm described in Devroye, L. (1986) Non-Uniform Random Variate Generation. Springer Verlag, p. 480.
inverse
, based on the general inverse method.
See also rgeo
.
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
.
Returns the value at x of the probability function of a discrete uniform random variable dUnif(n), with n a strictly positive integer.
Returns the value at x of the distribution function of a discrete uniform random variable dUnif(n), with n a strictly positive integer.
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].
Returns the mean of a discrete uniform random variable dUnif(n), with n a strictly positive integer.
Returns the variance of a discrete uniform random variable dUnif(n), with n a strictly positive integer.
Returns the standard deviation of a discrete uniform random variable dUnif(n), with n a strictly positive integer.
Returns the skewness coefficient of a discrete uniform random variable dUnif(n), with n a strictly positive integer.
Returns the kurtosis coefficient of a discrete uniform random variable dUnif(n), with n a strictly positive integer.
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
.
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.
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.
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].
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.
Returns the variance of a hypergeometric random variable Hyp(n1,n2,n), with n1, n2 and n non negative integers and n<=n1+n2.
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.
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.
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.
Default value: kachit
This is the selected algorithm for simulating random hypergeometric variates. Implemented algorithms are kachit
and inverse
:
kachit
, based on algorithm described in Kachitvichyanukul, V., Schmeiser, B.W. (1985) Computer generation of hypergeometric random variates. Journal of Statistical Computation and Simulation 22, 127-145.
inverse
, based on the general inverse method.
See also rhypergeo
.
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
.
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.
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 |
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].
Returns the mean of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.
Returns the variance of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.
Returns the standard deviation of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.
Returns the skewness coefficient of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.
Returns the kurtosis coefficient of a negative binomial random variable NB(n,p), with 0<p<1 and n a positive integer.
Default value: bernoulli
This is the selected algorithm for simulating random negative binomial variates. Implemented algorithms are devroye
, bernoulli
and inverse
:
devroye
, based on algorithm described in Devroye, L. (1986) Non-Uniform Random Variate Generation. Springer Verlag, p. 480.
bernoulli
, based on simulation of Bernoulli trials.
inverse
, based on the general inverse method.
See also rnegbinom
.
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.