rst {lazy.stat} | R Documentation |
t Random Numbers
rst(n, df, m = 0, c = NULL, sd = 1)
n |
# of random numbers to be generated |
df |
The degrees of freedom |
m |
The mean |
c |
The scale parameter or NULL |
sd |
The standard deviation |
#' X ~ t( df, c ) means that
X / sqrt(c) ~ t( df )
If Y ~ t( df ) then Y * sqrt(c) ~ t( df, c )
variance of t( df ) = df/(df-2)
variance of t( df, c ) = c * df/(df-2)
vector of length n
x <- rst( 10000, 9, sd=1 ) Print( mean(x), var(x), sqrt(var(x)) )