Documentation Center

  • Trials
  • Product Updates

Contents

pdf

Probability density functions

Syntax

Y = pdf(name,X,A)
Y = pdf(name,X,A,B)
Y = pdf(name,X,A,B,C)

Description

Y = pdf(name,X,A) computes the probability density function for the one-parameter family of distributions specified by name. Parameter values for the distribution are given in A. Densities are evaluated at the values in X and returned in Y.

If X and A are arrays, they must be the same size. If X is a scalar, it is expanded to a constant matrix the same size as A. If A is a scalar, it is expanded to a constant matrix the same size as X.

Y is the common size of X and A after any necessary scalar expansion.

Y = pdf(name,X,A,B) computes the probability density function for two-parameter families of distributions, where parameter values are given in A and B.

If X, A, and B are arrays, they must be the same size. If X is a scalar, it is expanded to a constant matrix the same size as A and B. If either A or B are scalars, they are expanded to constant matrices the same size as X.

Y is the common size of X, A, and B after any necessary scalar expansion.

Y = pdf(name,X,A,B,C) computes the probability density function for three-parameter families of distributions, where parameter values are given in A, B, and C.

If X, A, B, and C are arrays, they must be the same size. If X is a scalar, it is expanded to a constant matrix the same size as A, B, and C. If any of A, B or C are scalars, they are expanded to constant matrices the same size as X.

Y is the common size of X, A, B and C after any necessary scalar expansion.

Acceptable strings for name are:

nameDistributionInput Parameter AInput Parameter BInput Parameter C
'beta' or 'Beta'Beta Distributionab
'bino' or 'Binomial'Binomial Distributionn: number of trialsp: probability of success for each trial
'birnbaumsaunders'Birnbaum-Saunders Distributionβγ
'burr' or 'Burr': Burr Type XII Distributionα: scale parameterc: shape parameterk: shape parameter
'chi2' or 'Chisquare'Chi-Square Distributionν: degrees of freedom
'exp' or 'Exponential'Exponential Distributionμ: mean
'ev' or 'Extreme Value'Extreme Value Distributionμ: location parameterσ: scale parameter
'f' or 'F'F Distributionν1: numerator degrees of freedomν2: denominator degrees of freedom
'gam' or 'Gamma'Gamma Distributiona: shape parameterb: scale parameter
'gev' or 'Generalized Extreme Value'Generalized Extreme Value Distributionk: shape parameterσ: scale parameterμ: location parameter
'gp' or 'Generalized Pareto'Generalized Pareto Distributionk: tail index (shape) parameterσ: scale parameterμ: threshold (location) parameter
'geo' or 'Geometric'Geometric Distributionp: probability parameter
'hyge' or 'Hypergeometric'Hypergeometric DistributionM: size of the populationK: number of items with the desired characteristic in the populationn: number of samples drawn
'inversegaussian'Inverse Gaussian Distributionμλ
'logistic'Logistic Distributionμσ
'loglogistic'Loglogistic Distributionμσ
'logn' or 'Lognormal'Lognormal Distributionμσ
'nakagami'Nakagami Distributionμω
'nbin' or 'Negative Binomial'Negative Binomial Distributionr: number of successesp: probability of success in a single trial
'ncf' or 'Noncentral F'Noncentral F Distributionν1: numerator degrees of freedomν2: denominator degrees of freedomδ: noncentrality parameter
'nct' or 'Noncentral t'Noncentral t Distributionν: degrees of freedomδ: noncentrality parameter
'ncx2' or 'Noncentral Chi-square'Noncentral Chi-Square Distributionν: degrees of freedomδ: noncentrality parameter
'norm' or 'Normal'Normal Distributionμ: mean σ: standard deviation
'poiss' or 'Poisson'Poisson Distributionλ: mean
'rayl' or 'Rayleigh'Rayleigh Distributionb: scale parameter
'rician'Rician Distributions: noncentrality parameterσ: scale parameter
't' or 'T'Student's t Distributionν: degrees of freedom
'tlocationscale't Location-Scale Distributionμ: location parameterσ: scale parameterν: shape parameter
'unif' or 'Uniform'Uniform Distribution (Continuous)a: lower endpoint (minimum)b: upper endpoint (maximum)
'unid' or 'Discrete Uniform'Uniform Distribution (Discrete)N: maximum observable value
'wbl' or 'Weibull'Weibull Distributiona: scale parameterb: shape parameter

Examples

Compute the pdf of the normal distribution with mean 0 and standard deviation 1 at inputs –2, –1, 0, 1, 2:

p1 = pdf('Normal',-2:2,0,1)
p1 =
  0.0540  0.2420  0.3989  0.2420  0.0540

The order of the parameters is the same as for normpdf.

Compute the pdfs of Poisson distributions with rate parameters 0, 1, ..., 4 at inputs 1, 2, ..., 5, respectively:

p2 = pdf('Poisson',0:4,1:5)
p2 =
  0.3679  0.2707  0.2240  0.1954  0.1755

The order of the parameters is the same as for poisspdf.

See Also

| | |

Was this topic helpful?