TF | R Documentation |
The function TF
defines the t-family distribution, a three parameter distribution,
for a gamlss.family
object to be used in GAMLSS fitting using the function gamlss()
.
The functions dTF
, pTF
, qTF
and rTF
define the density, distribution function, quantile function and random
generation for the specific parameterization of the t distribution given in details below, with mean equal to \mu
and standard deviation equal to \sigma (\frac{\nu}{\nu-2})^{0.5}
with the degrees of freedom \nu
The function TF2
is a different parametrization where sigma
is the standard deviation.
TF(mu.link = "identity", sigma.link = "log", nu.link = "log")
dTF(x, mu = 0, sigma = 1, nu = 10, log = FALSE)
pTF(q, mu = 0, sigma = 1, nu = 10, lower.tail = TRUE, log.p = FALSE)
qTF(p, mu = 0, sigma = 1, nu = 10, lower.tail = TRUE, log.p = FALSE)
rTF(n, mu = 0, sigma = 1, nu = 10)
TF2(mu.link = "identity", sigma.link = "log", nu.link = "logshiftto2")
dTF2(x, mu = 0, sigma = 1, nu = 10, log = FALSE)
pTF2(q, mu = 0, sigma = 1, nu = 10, lower.tail = TRUE, log.p = FALSE)
qTF2(p, mu = 0, sigma = 1, nu = 10, lower.tail = TRUE, log.p = FALSE)
rTF2(n, mu = 0, sigma = 1, nu = 10)
mu.link |
Defines the |
sigma.link |
Defines the |
nu.link |
Defines the |
x,q |
vector of quantiles |
mu |
vector of location parameter values |
sigma |
vector of scale parameter values |
nu |
vector of the degrees of freedom parameter values |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x] |
p |
vector of probabilities. |
n |
number of observations. If |
Definition file for t family distribution TF()
:
f(y|\mu,\sigma, \nu)=\frac{1}{\sigma B(1/2,\nu/2)) \nu^{0.5}} \left[1+\frac{(y-\mu)^2}{\nu \sigma^2}\right]^{-(\nu+1)/2}
for -\infty<y<+\infty
, -\infty<\mu<+\infty
, \sigma>0
and \nu>0
see pp. 382-383 of Rigby et al. (2019).
Note that z=(y-\mu)/\sigma
has a standard t distribution with degrees of freedom \nu
see pp. 382-383 of Rigby et al. (2019).
Definition file for t family distribution TF2()
:
f(y|\mu,\sigma, \nu)=\frac{1}{\sigma B(1/2, \nu/2) (\nu-2)^{0.5}} \left[1+\frac{(y-\mu)^2}{(\nu-2) \sigma^2}\right]^{-(\nu+1)/2}
for -\infty<y<+\infty
, -\infty<\mu<+\infty
, \sigma>0
and \nu>2
see pp. 382-383 of Rigby et al. (2019).
Note that z=(y-\mu)/\sigma
has a standard t distribution with degrees of freedom \nu
see pp. 383-384 of Rigby et al. (2019).
TF()
returns a gamlss.family
object which can be used to fit a t distribution in the gamlss()
function.
dTF()
gives the density, pTF()
gives the distribution
function, qTF()
gives the quantile function, and rTF()
generates random deviates. The latest functions are based on the equivalent R
functions for gamma distribution.
\mu
is the mean and \sigma [\nu/(\nu-2)]^{0.5}
is the standard deviation of the t family distribution.
\nu>0
is a positive real valued parameter.
Mikis Stasinopoulos, Bob Rigby and Kalliope Akantziliotou
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in https://www.gamlss.com/.
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v023.i07")}.
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/b21973")}
gamlss.family
TF()# gives information about the default links for the t-family distribution
# library(gamlss)
#data(abdom)
#h<-gamlss(y~cs(x,df=3), sigma.formula=~cs(x,1), family=TF, data=abdom) # fits
#plot(h)
newdata<-rTF(1000,mu=0,sigma=1,nu=5) # generates 1000 random observations
hist(newdata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.