Scaled t distribution {metRology} | R Documentation |
Scaled and shifted t distribution.
Description
Student's t distribution for 'df' degrees of freedom, shifted by 'mean' and scaled by 'sd'.
Usage
dt.scaled(x, df, mean = 0, sd = 1, ncp, log = FALSE)
pt.scaled(q, df, mean = 0, sd = 1, ncp, lower.tail = TRUE, log.p = FALSE)
qt.scaled(p, df, mean = 0, sd = 1, ncp, lower.tail = TRUE, log.p = FALSE)
rt.scaled(n, df, mean = 0, sd = 1, ncp)
Arguments
x , q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. If |
df |
degrees of freedom (> 0, maybe non-integer). |
mean |
mean value for the shifted, scaled distribution. |
sd |
Scale factor for the shifted, scaled distribution. |
ncp |
non-centrality parameter delta; currently except for |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x]; otherwise, P[X > x]. |
log , log.p |
logical; if TRUE, probabilities p are given as log(p). |
Details
These are wrappers for the corresponding t distribution functions in package stats
.
The scaled, shifted t distribution has mean mean
and variance sd^2 * df/(df-2)
The scaled, shifted t distribution is used for Monte Carlo evaluation when a value x has
been assigned a standard uncertainty u associated with with df degrees of freedom;
the corresponding distribution function for that is then t.scaled
with
mean=x
, sd=u
and df=df
.
Value
dt.scaled
gives the density, pt.scaled
gives the distribution function,
qt.scaled
gives the quantile function, and rt.scaled
generates random deviates.
Invalid arguments will result in return value NaN
, with a
warning.
Author(s)
S. L. R. Ellison s.ellison@lgc.co.uk
See Also
Examples
u<-rt.scaled(20, df=5, mean=11, sd=0.7)
qt.scaled(c(0.025,0.975), Inf, mean=10, sd=1) #10 +- 1.96*sd
require(graphics)
hist(rt.scaled(10000, df=4, mean=11, sd=0.7), breaks=50, probability=TRUE)
x<-seq(0,25, 0.05)
lines(x,dnorm(x,mean=11, sd=0.7), col=2)