dst {lazy.stat} | R Documentation |
t distribution
dst(x, df, m = 0, c2 = 1, sd = 0) pst(x, df, m = 0, c2 = 1, sd = 0) qst(p, df, m = 0, c2 = 1, sd = 0)
x, |
q vector of quantiles. |
df |
The degrees of freedom |
m |
The mean |
c2 |
The scale parameter or NULL |
sd |
The standard deviation: This has priority over c2. |
p |
vector of probabilities. |
n |
# of random numbers to be generated. |
X ~ t( df, m, c2 ) means that
(X-m) / sqrt(c2) ~ t( df, m=0, c2=1 )
If Y ~ t( df ) then Y * sqrt(c2) + m ~ t( df, m, c2 )
variance of t( df, m=0, c2=1 ) = df/(df-2)
variance of t( df, m, c2 ) = c2 * df/(df-2)
rst returns the vector of length n.
Other functions return the vector of length length(x) or length(p)
df <- 10 m <- 1 c2 <- 4 var <- df/(df-2)*c2 x <- seq(-4,6,length.out=31) pdft <- dst( x, df, m, c2 ) pdfn <- dnorm( x, m, sqrt(var) ) matplot(x, cbind(pdft,pdfn), type <- "l") pn <- pnorm( x, m, sqrt(var) ) p <- pst( x, df, m, c2 ) q <- qst( p, df, m, c2 ) Print( x, pn, p, q )