View source: R/get-K-rvcov-16-06-2913.R
rvcov | R Documentation |
The function rvcov()
is design for providing robust standard errors for the parameters estimates of a GAMLSS fitted model. The same result can be achieved by using vcov(fitted_model,robust=TRUE)
. The function get.()
gets the K
matrix (see details below).
rvcov(object, type = c("vcov", "cor", "se", "coef", "all"),
hessian.fun = c("R", "PB") )
get.K(object, what = c("K", "Deriv"))
object |
a GAMLSS fitted object |
type |
this argument for |
what |
this an argument for the function |
hessian.fun |
How to obtain numerically the Hessian i) using |
The robust standard errors are calculated for the robust sandwich estimator of the variance-covariance given by S=VKV
where V
is the standard variance-covariance matrix (the inverse of the information matrix) and K
is an estimate of the variance of he first derivatives of he likelihood. The function get.K()
is use the get the required K
matrix.
A variance covariance matrix or other relevant output
Mikis Stasinopoulos, Bob Rigby and Vlasios Voudouris
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, https://www.jstatsoft.org/v23/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.
(see also https://www.gamlss.com/).
vcov
, ~~~
# gererate from a gamma distribution
Y <- rGA(200, mu=1, sigma=2)
hist(Y)
# fitting the wrong model i.e. sigma=1
m1 <- gamlss(Y~1, family=EXP)
# the conventinal se is too precise
vcov(m1, type="se")
# the sandwich se is wider
rvcov(m1, type="se")
# fitting the correct model
m2 <- gamlss(Y~1, family=GA)
vcov(m2, type="se")
rvcov(m2, type="se")
# similar stadard errors
# also obtained using
vcov(m2, type="se", robust=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.