Probability distributions

It is possible to find the the density, probability at the left of a point, quantile and random numbers for several distributions. For example, for a normal distribution:

For example:
> a_seq(-5,5,by=.2)
> a
 [1] -5.0 -4.8 -4.6 -4.4 -4.2 -4.0 -3.8 -3.6 -3.4 -3.2 -3.0 -2.8 -2.6 -2.4 -2.2
[16] -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2  0.0  0.2  0.4  0.6  0.8
[31]  1.0  1.2  1.4  1.6  1.8  2.0  2.2  2.4  2.6  2.8  3.0  3.2  3.4  3.6  3.8
[46]  4.0  4.2  4.4  4.6  4.8  5.0
> a2_(pnorm(a))
> b_cbind(a,a2)
generates is table of the normal distribution. You can add parameter of the mean and standard deviation pnorm(a, nu,sigma)=pnorm((a-nu)/sigma)
> pnorm(1,0,3)
[1] 0.6305586
> pnorm(1,mean=0,sd=3)
[1] 0.6305587 
> pnorm(1/3)
[1] 0.6305586
You can name the parameters:
> pnorm(1,sd=2,mean=0)
[1] 0.6914625
> pnorm(mean=0,sd=2,1)
[1] 0.6914625
> pnorm(1,0,2)
[1] 0.6914625
The following is a list of distributions and their associated commands:
Beta  
dbeta, pbeta, qbeta, rbeta
pamameters: shape1, shape2
defaults: -, -

Binomial
dbinom, pbinom, qbinom, rbinom
pamameters: size, prob
defaults: -, -

Cauchy
dcauchy, pcauchy, qcauchy, rcauchy
pamameters: loc, scale
defaults: 0, 1

Chi-Square
dchisq, pchisq, qchisq, rchisq
pamameters: df
defaults: -

Exponential
dexp, pexp, qexp, rexp
pamameters: rate (the rate is the inverse of the mean of the distribution)
defaults: -

Double exponential
ddexp, pdexp, qdexp, rdexp
pamameters: -
defaults: -

Geometric
dgeom, pgeom, qgeom, rgeom
pamameters: prob
defaults: -

Hypergeometric
dhyper, phyper, qhyper, rhyper
pamameters:
defaults:

Lognormal
dlnorm, plnorm, qlnorm, rlnorm
pamameters:
defaults:

Logistic
dlogis, plogis, qlogis, rlogis
pamameters: loc, scale
defaults: 0, 1

Multivariate normal
dmvnorm, pmvnorm, qmvnorm, rmvnorm
pamameters: mean, cov, sd, rho, d
defaults:

Negative binomial
dnbinom, pnbinom, qnbinom, rnbinom
pamameters:
defaults:

Normal
dnorm, pnormqnorm, rnorm
pamameters:mean, sd
defaults: 0, 1

Poisson
dpois, ppois, qpois, rpois
pamameters: lambda
defaults: -

Student's t statistic
dt, pt, qt, rt
pamameters: df
defaults: -

Uniform
dunif, punif, qunif, runif
pamameters: min, max
defaults: 0, 1

Weibull
dweibull, pweibul, qweibul, rweibul
pamameters: shape
defaults: -

Wilcoxon Rank Sum Statistic
dwilcox, pwilcox, qwilcox, rwilcox
pamameters: m, n
defaults:

Comments to: Miguel A. Arcones

Go to main homepage: