B.11 Probability and cumulative density functions
The following two tables describe statements that are used to evaluate probability density/mass and cumulative density functions (pdfs and cdfs) of some popular distributions.
Syntax | Mathematical expression | Arguments and return values |
W = betapdf(X, alpha, beta); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the beta distribution with shape parameters alpha and beta, evaluated at each entry of X. The function works element-wise.
|
W = chi2pdf(X, p); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the chi-squared distribution with p degrees of freedom, evaluated at each entry of X. The function works element-wise.
|
W = exppdf(X, lambda); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the exponential distribution with rate parameter lambda, evaluated at each entry of X. The function works element-wise.
|
W = evpdf(X, mu, sigma); | where: | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the type-I extreme-value distribution with location parameter mu and scale parameter sigma, evaluated at each entry of X. The function works element-wise.
|
W = fpdf(X, p1, p2); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of Fisher’s F distribution with numerator degrees of freedom p1 and denominator degrees of freedom p2, evaluated at each entry of X. The function works element-wise.
|
W = gampdf(X, alpha, beta); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the gamma distribution with shape parameter alpha and rate parameter beta, evaluated at each entry of X. The function works element-wise.
|
W = logisticpdf(X, mu, s); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the logistic distribution with mean mu and scale parameter s (variance equal to ), evaluated at each entry of X. The function works element-wise.
|
W = logitnpdf(X, mu, sigma); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of logit-Normal distribution with location parameter mu and scale parameter sigma, evaluated at each entry of X. The function works element-wise.
|
W = lognpdf(X, mu, sigma); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the log-Normal distribution with location parameter mu and scale parameter sigma, evaluated at each entry of X. The function works element-wise.
|
W = normpdf(X, mu, sigma); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the normal distribution with mean parameter mu and standard deviation sigma, evaluated at each entry of X. The function works element-wise.
|
W = tpdf(X, p); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the t distribution with p degrees of freedom, evaluated at each entry of X. The function works element-wise.
|
W = truncnpdf(X, mu, sigma); | where: is the standard normal pdf is the standard normal cdf | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of a Normal distribution with location parameter mu and scale parameter sigma, truncated from below at zero and evaluated at each entry of X. The function works element-wise.
|
W = wblpdf(X, alpha, beta); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the Weibull distribution with shape parameter alpha and scale parameter beta, evaluated at each entry of X. The function works element-wise.
|
Syntax | Mathematical expression | Arguments and return values |
W = binompdf(X, n, p); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the binomial distribution with n of trials and probability of success in each trial p, evaluated at each entry of X. The function works element-wise.
Note that the function allows for non-integer values of n by replacing the factorials in the expression by the Gamma function. |
W = nbinompdf(X, n, p); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the negative-binomial distribution with n failures until stopping and probability of success in each trial p, evaluated at each entry of X. The function works element-wise.
Note that the function allows for non-integer values of n by replacing the factorials in the expression by the Gamma function. |
W = poissonpdf(X, lambda); | | W is a matrix with dimensions equal to those of X and entries equal to the pdf/cdf of the Poisson distribution with rate parameter lambda, evaluated at each entry of X. The function works element-wise.
|