rvcov: Robust Variance-Covariance matrix of the parameters from a...

View source: R/get-K-rvcov-16-06-2913.R

rvcovR Documentation

Robust Variance-Covariance matrix of the parameters from a fitted GAMLSS model

Description

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).

Usage

rvcov(object, type = c("vcov", "cor", "se", "coef", "all"),
                      hessian.fun = c("R", "PB") )
get.K(object, what = c("K", "Deriv"))

Arguments

object

a GAMLSS fitted object

type

this argument for rvcov() function whether variance-covariance matrix, correlation matrix, standard errors or all of them

what

this an argument for the function ket.K() allowing to get either K or the first derivative of the likelihood with respect to the parameters (the \beta's in the GAMLSS notation).

hessian.fun

How to obtain numerically the Hessian i) using optimHess(), option "R" ii) using a function by Pinheiro and Bates taken from package nlme, option "PB".

Details

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.

Value

A variance covariance matrix or other relevant output

Author(s)

Mikis Stasinopoulos, Bob Rigby and Vlasios Voudouris

References

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/).

See Also

vcov, ~~~

Examples

# 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)



gamlss documentation built on May 29, 2024, 6:08 a.m.