View source: R/main_function.R
generateVAR | R Documentation |
This function generates Vector Auto-Regressive (VAR) data based on the provided parameters.
generateVAR(n, As, Sig, h, isOldProvided = FALSE, oldxs = NULL)
n |
Integer. The length of the VAR data to be generated. |
As |
List. A list containing the transition matrices for the VAR process. |
Sig |
Matrix. The covariance matrix of errors. |
h |
Integer. The order of the VAR process. |
isOldProvided |
Logical. If TRUE, the VAR data will be generated based on the last observations from the previous segment of data. Defaults to FALSE. |
oldxs |
Matrix. A |
A data matrix of dimensions p
by n
.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.