Distributions in R

August 18, 2010
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

One of the R language's most powerful features is its ability to deal with random distributions: not just generating random numbers from various distributions (based on a very powerful pseudo-random number generator), but also calculating densities, probabilities, and quintiles. John Cook provides a handy reference chart listing all of the distributions supported by standard R (reproduced below -- and there are many other distributions supported by contributed packages), and also explains the elegant naming scheme for the various functions.

DistributionBase name    Parameters
betabetashape1, shape2, ncp
binomialbinomsize, prob
Cauchycauchylocation, scale
chi-squaredchisqdf, ncp
exponentialexprate
Ffdf1, df2, ncp
gammagammashape, rate
geometricgeomp
hypergeometrichyperm, n, k
log-normallnormmeanlog, sdlog
logisticlogislocation, scale
negative binomialnbinomsize, prob
normalnormmean, sd
Poissonpoislambda
Student ttdf, ncp
uniformunifmin, max
Weibullweibullshape, scale

Updated Aug 20: added the ncp parameter to beta, chisq, f, and t with thanks to Doug Bates' comment below.

John D Cook: Distributions in R and S-PLUS

To leave a comment for the author, please follow the link and comment on his blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: ,

Comments are closed.