powered by
This function generates Vector Auto-Regressive (VAR) data based on the provided parameters.
generateVAR(n, As, Sig, h, isOldProvided = FALSE, oldxs = NULL)
A data matrix of dimensions p by n.
p
n
Integer. The length of the VAR data to be generated.
List. A list containing the transition matrices for the VAR process.
Matrix. The covariance matrix of errors.
Integer. The order of the VAR process.
Logical. If TRUE, the VAR data will be generated based on the last observations from the previous segment of data. Defaults to FALSE.
Matrix. A p by h matrix containing the last observations from the previous segment of data. Required if isOldProvided = TRUE.
h
isOldProvided = TRUE
# Example usage As <- list(matrix(c(0.5, 0.2, 0.1, 0.4), 2, 2)) Sig <- diag(2) data <- generateVAR(n = 100, As = As, Sig = Sig, h = 1)
Run the code above in your browser using DataLab