Documentation

nctpdf

Noncentraltprobability density function

Syntax

Y = nctpdf(X,V,DELTA)

Description

Y = nctpdf(X,V,DELTA)computes the noncentraltpdf at each of the values inXusing the corresponding degrees of freedom inVand noncentrality parameters inDELTA. Vector or matrix inputs forX,V, andDELTAmust have the same size, which is also the size ofY. A scalar input forX,V, orDELTAis expanded to a constant matrix with the same dimensions as the other inputs.

Examples

collapse all

Compute the pdf of a noncentraltdistribution with degrees of freedomV = 10and noncentrality parameterDELTA = 1. For comparison, also compute the pdf of atdistribution with the same degrees of freedom.

x = (-5:0.1:5)'; nct = nctpdf(x,10,1); t = tpdf(x,10);

Plot the pdf of the noncentraltdistribution and the pdf of thetdistribution on the same figure.

plot(x,nct,'b-','LineWidth',2) holdonplot(x,t,'g--','LineWidth',2) legend('nct','t')

References

[1] Evans, M., N. Hastings, and B. Peacock. Statistical Distributions. 2nd ed., Hoboken, NJ: John Wiley & Sons, Inc., 1993, pp. 147–148.

[2] Johnson, N., and S. Kotz. Distributions in Statistics: Continuous Univariate Distributions-2. Hoboken, NJ: John Wiley & Sons, Inc., 1970, pp. 201–219.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a

Was this topic helpful?