R/A.R

Defines functions A

Documented in A

"Acoef" <-
function (x) 
{
    if (!is(x, "varest")) {
        stop("\nPlease provide an object of class 'varest', generated by 'var()'.\n")
    }
    K <- x$K
    p <- x$p
    A <- Bcoef(x)[, 1:(K*p)]
    As <- list()
    start <- seq(1, p * K, K)
    end <- seq(K, p * K, K)
    for (i in 1:p) {
        As[[i]] <- matrix(A[, start[i]:end[i]], nrow = K, ncol = K)
        rownames(As[[i]]) <- rownames(A)
        colnames(As[[i]]) <- colnames(A[, start[i]:end[i]])
    }
    return(As)
}
A <- function(x){
  .Deprecated("Acoef", package = "vars", msg = "Function 'A' is deprecated; use 'Acoef' instead.\nSee help(\"vars-deprecated\") and help(\"A-deprecated\") for more information.")
  Acoef(x = x)
}

Try the vars package in your browser

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

vars documentation built on March 31, 2023, 10:30 p.m.