covest.SGB {SGB} | R Documentation |
Classical and robust asymptotic covariance matrix
Description
Computation of two covariance matrices of the estimators of parameters in a SGB regression. The first is based on the Hessian and the second is the sandwich estimator.
Usage
covest.SGB(x, d, u, V, weight=rep(1,dim(d)[1]), x0 = NULL, hessian = NULL, ind = NULL,
shape1 = NULL)
Arguments
x |
vector of parameters (shape1,coefi,shape2) where
shape1 is the overall shape, coefi is the vector of regression coefficients (see |
d |
data matrix of explanatory variables (with constant vector if required in the model) |
u |
data matrix of compositions (variables to be explained) |
V |
full rank transformation of log(parts) into log-ratios, matrix |
weight |
vector of length |
x0 |
specification of the initial parameter vector of length |
hessian |
Hessian matrix (optional), see |
ind |
vector of length equal to the number of fixed parameters; specifies the indices of the fixed components in the vector of parameters |
shape1 |
fixed value of the overall shape parameter, if |
Details
This function is internally called by regSGB. In this case the Hessian is the output of auglag
and is numerically computed.
A design based covariance matrix of the parameters can be obtained by linearization as the covariance matrix of the scores
.
Value
a list with
summary |
Data frame with |
scores |
matrix |
vcov1 |
ordinary asymptotic covariance matrix, inverse of minus the Hessian. |
StdErr1 |
vector of ordinary asymptotic standard error of parameters. |
varest2 |
robust asymptotic covariance matrix. |
StdErr |
vector of robust asymptotic standard error of parameters. |
References
Huber, P. J. (1967). The behavior of maximum likelihood estimates under nonstandard conditions. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1, pp. 221-233.
See Also
regSGB
for creating oilr
.
Examples
data(arc)
data(oilr)
## compositions
da <- as.matrix(log(arc[["depth"]]),ncol=1)
ua <- as.matrix(arc[,1:3])
## ilr transforms
c1 <- 1/sqrt(2)
c2 <- 1/sqrt(6)
Vilr <- matrix(c(-c1,c1,0,-c2,-c2,2*c2),nrow=3)
colnames(Vilr) <- c("ilr1","ilr2")
Vilr
covs <- covest.SGB(oilr[["par"]], da, ua, Vilr)
## Compare the ordinary and robust correlation matrices of parameters estimates.
## (Ordinary) covariance based on inverse Hessian
vcov1 <- covs[["vcov1"]]
StdErr1 <- covs[["StdErr1"]]
## Estimated correlation matrix
vcor1 <- diag(1/StdErr1) %*% vcov1 %*% diag(1/StdErr1)
round(vcor1,2)
## Robust (Huber's sandwich estimator):
StdErr <- covs[["StdErr"]]
vcov <- covs[["vcov"]]
## Estimated correlation matrix
round(diag(1/StdErr) %*% vcov %*% diag(1/StdErr),2)