# NOT RUN {
X <- matrix(rnorm(1000*3),ncol=3)
colnames(X) <- c("ABC","XYZ","WORM")
Sigmas <- sr_vcov(X)
# make it fat tailed:
X <- matrix(rt(1000*3,df=5),ncol=3)
Sigmas <- sr_vcov(X)
# }
# NOT RUN {
if (require(sandwich)) {
Sigmas <- sr_vcov(X,vcov.func=vcovHC)
}
# }
# NOT RUN {
# add some autocorrelation to X
Xf <- filter(X,c(0.2),"recursive")
colnames(Xf) <- colnames(X)
Sigmas <- sr_vcov(Xf)
# }
# NOT RUN {
if (require(sandwich)) {
Sigmas <- sr_vcov(Xf,vcov.func=vcovHAC)
}
# }
# NOT RUN {
# should run for a vector as well
X <- rnorm(1000)
SS <- sr_vcov(X)
# }
Run the code above in your browser using DataLab