Learn Python and AI for free! One week only. No credit card needed.
Ends in:
These functions provide the density, distribution function, quantile
function, and random generation for the univariate Student t
distribution with location parameter
dst(x, mu=0, sigma=1, nu=10, log=FALSE)
pst(q, mu=0, sigma=1, nu=10, lower.tail=TRUE, log.p=FALSE)
qst(p, mu=0, sigma=1, nu=10, lower.tail=TRUE, log.p=FALSE)
rst(n, mu=0, sigma=1, nu=10)
These are each a vector of quantiles.
This is a vector of probabilities.
This is the number of observations, which must be a positive integer that has length 1.
This is the location parameter
This is the scale parameter
This is the degrees of freedom parameter
Logical. If lower.tail=TRUE
, then
probabilities are
Logical. If log=TRUE
, then the logarithm of the
density or probability is returned.
dst
gives the density,
pst
gives the distribution function,
qst
gives the quantile function, and
rst
generates random deviates.
Application: Continuous Univariate
Density:
Inventor: William Sealy Gosset (1908)
Notation 1:
Notation 2:
Parameter 1: location parameter
Parameter 2: scale parameter
Parameter 3: degrees of freedom
Mean:
Variance:
Mode:
The Student t-distribution is often used as an alternative to the normal distribution as a model for data. It is frequently the case that real data have heavier tails than the normal distribution allows for. The classical approach was to identify outliers and exclude or downweight them in some way. However, it is not always easy to identify outliers (especially in high dimensions), and the Student t-distribution is a natural choice of model-form for such data. It provides a parametric approach to robust statistics.
The degrees of freedom parameter,
In the limit
The pst
and qst
functions are similar to those in the
gamlss.dist
package.
# NOT RUN {
library(LaplacesDemon)
x <- dst(1,0,1,10)
x <- pst(1,0,1,10)
x <- qst(0.5,0,1,10)
x <- rst(100,0,1,10)
#Plot Probability Functions
x <- seq(from=-5, to=5, by=0.1)
plot(x, dst(x,0,1,0.1), ylim=c(0,1), type="l", main="Probability Function",
ylab="density", col="red")
lines(x, dst(x,0,1,1), type="l", col="green")
lines(x, dst(x,0,1,10), type="l", col="blue")
legend(1, 0.9, expression(paste(mu==0, ", ", sigma==1, ", ", nu==0.5),
paste(mu==0, ", ", sigma==1, ", ", nu==1),
paste(mu==0, ", ", sigma==1, ", ", nu==10)),
lty=c(1,1,1), col=c("red","green","blue"))
# }
Run the code above in your browser using DataLab