A non-central Student’s t continuous random variable.
As an instance of the rv_continuous class, nct object inherits from it
a collection of generic methods (see below for the full list),
and completes them with details specific for this particular distribution.
Expected value of a function (of one argument) with respect to the distribution.
median(df, nc, loc=0, scale=1)
Median of the distribution.
mean(df, nc, loc=0, scale=1)
Mean of the distribution.
var(df, nc, loc=0, scale=1)
Variance of the distribution.
std(df, nc, loc=0, scale=1)
Standard deviation of the distribution.
interval(confidence, df, nc, loc=0, scale=1)
Confidence interval with equal areas around the median.
Notes
If \(Y\) is a standard normal random variable and \(V\) is
an independent chi-square random variable (chi2) with \(k\) degrees
of freedom, then
\[X = \frac{Y + c}{\sqrt{V/k}}\]
has a non-central Student’s t distribution on the real line.
The degrees of freedom parameter \(k\) (denoted df in the
implementation) satisfies \(k > 0\) and the noncentrality parameter
\(c\) (denoted nc in the implementation) is a real number.
This distribution uses routines from the Boost Math C++ library for
the computation of the pdf, cdf, ppf, sf and isf
methods. [1]
The probability density above is defined in the "standardized" form. To shift
and/or scale the distribution use the loc and scale parameters.
Specifically, nct.pdf(x,df,nc,loc,scale) is identically
equivalent to nct.pdf(y,df,nc)/scale with
y=(x-loc)/scale. Note that shifting the location of a distribution
does not make it a "noncentral" distribution; noncentral generalizations of
some distributions are available in separate classes.
Alternatively, the distribution object can be called (as a function)
to fix the shape, location and scale parameters. This returns a "frozen"
RV object holding the given parameters fixed.
Freeze the distribution and display the frozen pdf: