Categories &

Functions List

Function Reference: nctrnd

statistics: r = nctrnd (df, mu)
statistics: r = nctrnd (df, mu, rows, cols, …)
statistics: r = nctrnd (df, mu, [sz])

Random arrays from the noncentral t-distribution.

x = nctrnd (p, df, mu) returns an array of random numbers chosen from the noncentral t-distribution with df degrees of freedom and noncentrality parameter mu. The size of r is the common size of df and mu. A scalar input functions as a constant matrix of the same size as the other input.

nctrnd generates values using the definition of a noncentral t random variable, as the ratio of a normal distribution with non-zero mean and the sqrt of a chi-squared distribution.

When called with a single size argument, nctrnd returns a square matrix with the dimension specified. When called with more than one scalar argument, the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. The size may also be specified with a row vector of dimensions, sz.

Further information about the noncentral t-distribution can be found at https://en.wikipedia.org/wiki/Noncentral_t-distribution

See also: nctcdf, nctinv, nctpdf, nctstat, trnd, normrnd, chi2rnd

Source Code: nctrnd