R/vcov.R

#' @export
vcov.TVAR <- function (object, ...) {
  x <- object
  Z<-t(as.matrix(tail.matrix(x$model[,-c(1:x$k)],x$t)))
  R <- chol2inv(chol(tcrossprod(Z)))
  
  ## 
  Sigma <- matrix((1/x$df.residual) * crossprod(x$residuals),ncol=x$k)
  VarCovB <- Sigma %x% R
  
  VarCovB
}

Try the tsDyn package in your browser

Any scripts or data that you put into this service are public.

tsDyn documentation built on Oct. 31, 2024, 5:08 p.m.