quadVAR {quadVAR} | R Documentation |
Estimate lag-1 quadratic vector autoregression models
Description
This function estimate regularized nonlinear quadratic vector autoregression models with strong hierarchy using the RAMP::RAMP()
algorithm, and also compare it with the linear AR, regularized VAR, and unregularized (full) VAR and quadratic VAR models.
Usage
quadVAR(
data,
vars,
dayvar = NULL,
beepvar = NULL,
penalty = "LASSO",
tune = "EBIC",
donotestimate = NULL,
SIS_options = list(),
RAMP_options = list()
)
## S3 method for class 'quadVAR'
print(x, ...)
## S3 method for class 'quadVAR'
summary(object, ...)
## S3 method for class 'quadVAR'
coef(object, ...)
## S3 method for class 'coef_quadVAR'
print(
x,
use_actual_names = TRUE,
abbr = FALSE,
minlength = 3,
omit_zero = TRUE,
digits = 2,
row.names = FALSE,
...
)
## S3 method for class 'quadVAR'
plot(x, value = NULL, value_standardized = TRUE, interactive = FALSE, ...)
Arguments
data |
A |
vars |
A character vector of the variable names used in the model. |
dayvar |
String indicating assessment day. Adding this argument makes sure that the first measurement of a day is not regressed on the last measurement of the previous day. IMPORTANT: only add this if the data has multiple observations per day. |
beepvar |
Optional string indicating assessment beep per day. Adding this argument will cause non-consecutive beeps to be treated as missing! |
penalty |
The penalty used for the linear and regularized VAR models. Possible options include "LASSO", "SCAD", "MCP", with "LASSO" as the default. |
tune |
Tuning parameter selection method. Possible options include "AIC", "BIC", "EBIC", with "EBIC" as the default. |
donotestimate |
A character vector of the model names that are not estimated. Possible options include, "NULL_model", "AR", "VAR", "VAR_full", "quadVAR_full", "all_others", with NULL as the default. If set "all_others", then only a |
SIS_options |
A list of other parameters for the |
RAMP_options |
A list of other parameters for the |
... |
For |
object , x |
An |
use_actual_names |
Logical. If |
abbr |
Logical. If |
minlength |
the minimum length of the abbreviations. |
omit_zero |
Logical. If |
digits |
the minimum number of significant digits to be used: see
|
row.names |
logical (or character vector), indicating whether (or what) row names should be printed. |
value |
A numeric vector of length 1 or the same as the number of nodes, that specifies the values of the variables that the linearized model will be based on. If the length is 1, the same value will be used for all variables. The default value is |
value_standardized |
A logical value that specifies whether the input value is standardized or not. If TRUE, the input value will be regarded as standardized value, i.e., mean + |
interactive |
Whether to produce an interactive plot using |
Value
An quadVAR
object that contains the following elements:
-
NULL_model
: A list of NULL models for each variable. -
AR_model
: A list of linear AR models for each variable. -
VAR_model
: A list of regularized VAR models for each variable. -
VAR_full_model
: A list of unregularized (full) VAR models for each variable. -
quadVAR_model
: A list of regularized nonlinear quadratic VAR models for each variable. -
quadVAR_full_model
: A list of unregularized (full) nonlinear quadratic VAR models for each variable. -
data
,vars
,penalty
,tune
,SIS_options
,RAMP_options
: The input arguments. -
data_x
,data_y
: The data directly used for modeling.
Methods (by generic)
-
print(quadVAR)
: Print the coefficients for a quadVAR object. Seecoef.quadVAR()
andprint.coef_quadVAR()
for details. -
summary(quadVAR)
: Summary of a quadVAR object. Different IC definitions used by different packages (which differ by a constant) are unified to make them comparable to each other. -
coef(quadVAR)
: Extract the coefficients from a quadVAR object. -
plot(quadVAR)
: Produce a plot for the linearized quadVAR model. Equivalent to first produce a linear quadVAR network usinglinear_quadVAR_network()
, then useplot.linear_quadVAR_network()
.
Functions
-
print(coef_quadVAR)
: Print the coefficients from a quadVAR object.
See Also
Examples
set.seed(1614)
data <- sim_4_emo(time = 200, sd = 1)
plot(data[, "x1"])
qV1 <- quadVAR(data, vars = c("x1", "x2", "x3", "x4"))
summary(qV1)
coef(qV1)
plot(qV1)
# Compare the estimation with the true model
plot(true_model_4_emo())
plot(qV1, value = 0, value_standardized = FALSE, layout = plot(true_model_4_emo())$layout)