tdistr | R Documentation |
Calculate the density of the non-standard Student's t-distribution.
tdistr(x, dfree = 3, loc = 0, scalev = 1)
x |
A numeric value for which to calculate the density of the t-distribution. |
dfree |
An integer value equal to the degrees of freedom
(the default is |
loc |
A numeric value equal to the location (center) of
the distribution (the default is |
scalev |
A numeric value equal to the scale (width) of the
distribution (the default is |
The function tdistr()
calculates the density of the
non-standard Student's t-distribution by calling the function
gamma()
.
The density function of the non-standard Student's t-distribution is given
by:
f(t) = \frac{\Gamma((\nu+1)/2)}{\sqrt{\pi \nu} \, \sigma \, \Gamma(\nu/2)} \, (1 + (\frac{t - \mu}{\sigma})^2/\nu)^{-(\nu+1)/2}
Where \Gamma()
is the gamma function, and \nu
are the degrees of
freedom.
The non-standard Student's density function has a mean equal to the location
parameter \mu
, and a standard deviation proportional to the scale
parameter \sigma
.
A numeric value equal to the density of the non-standard Student's t-distribution.
## Not run:
# Student t-distribution at x=1, with df=4, location=-1 and scale=2
tdistr(1, df=4, loc=-1, scalev=2)
# Student t-distribution at x=1, with location=0 and scale=1 - same as dt()
all.equal(tdistr(1, df=3), dt(1, df=3))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.