| getVARmodel | R Documentation |
vars packageEither creates a VAR model or chooses a VAR model by using VAR or VARselect commands of vars package
getVARmodel(
data,
suffix = c("_Tx", "_Tn"),
sep = "",
p = 1,
type = "none",
season = NULL,
exogen = NULL,
lag.max = NULL,
ic = "AIC",
activateVARselect = FALSE,
na.rm = TRUE,
n_GPCA_iteration = 0,
n_GPCA_iteration_residuals = n_GPCA_iteration,
extremes = TRUE,
nearPD = FALSE
)
data |
see |
suffix |
see |
sep |
separator element. See |
p |
lag considered for the auto-regression see |
type |
see |
season |
see |
exogen |
see |
lag.max |
see |
ic |
see |
activateVARselect |
logical variables. If |
na.rm |
logical variables. If |
n_GPCA_iteration |
number of iterations of Gaussianization process for data. Default is 0 (no Gaussianization) |
n_GPCA_iteration_residuals |
number of iterations of Gaussianization process for data. Default is 0 (no Gaussianization) |
extremes |
see |
nearPD |
logical (experimental) and passed to |
a varest2 or GPCAvarest2 object representing a VAR model or a GPCA-varest object which also contains the GPCA transformation parameters
It inherits input parameters of VAR, VARselect and addsuffixes. The variable data contains the measured data on which the vector auto-regressive models is estimated.
It is a matrix where each row is a realization of the vector random variable.
In some application of this package, the random variables may be the daily maximum and minimum temperature anomalies for different stations.
Often the the columns of data are called with the IDs of the stations whithout specifying the type of variable (e.g. minimun or maximum temperature anomalies).
This means that two or more columns may have the same name. Therefore the function addsuffixes, which is called from this function, adds suitable suffixes to the column names.
Emanuele Cordano, Emanuele Eccel
set.seed(122)
NSTEP <- 1000
x <- rnorm(NSTEP)
y <- x+rnorm(NSTEP)
z <- c(rnorm(1),y[-1]+rnorm(NSTEP-1))
df <- data.frame(x=x,y=y,z=z)
exogen <- as.data.frame(x+5)
only_var <- VAR(df,type="none")
gpcavar <- getVARmodel(data=df,suffix=NULL,p=3,n_GPCA_iteration=5,
n_GPCA_iteration_residuals=5,exogen=exogen)
exogen <- as.data.frame(x+5)
data_for_var <- gpcavar@GPCA_data$final_results
data(collinear_dataset)
gpcavar_coll <- getVARmodel(data=collinear_dataset,suffix=NULL,p=3,n_GPCA_iteration=5,
n_GPCA_iteration_residuals=0,exogen=NULL,nearPD=TRUE) ## use nearPD==TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.