GNARXsim {GNAR} | R Documentation |
Simulates a GNARX process
Description
Simulates a GNAR process with Normally distributed innovations.
Usage
GNARXsim(n=200, net=GNAR::fiveNet, alphaParams=list(c(rep(0.2,5))),
betaParams=list(c(0.5)), sigma=1, tvnets=NULL, netsstart=NULL, xvts=NULL,
lambdaParams=NULL)
Arguments
n |
time length of simulation. |
net |
network used for the GNAR simulation. |
alphaParams |
a list containing vectors of auto-regression parameters for each time-lag. |
betaParams |
a list of equal length as |
sigma |
the standard deviation for the innovations. |
tvnets |
a list of additional networks. Currently only NULL (the static network case) is supported. |
netsstart |
a vector of times corresponding to the first time points for each network of |
xvts |
a list of matrices containing values of the exogenous regressors for each vertex/node.
The |
lambdaParams |
a list containing vectors of parameters associated to effect of the exogenous regressor variables for each time-lag. |
Details
Parameter lists should not be NULL, set unused parameters to be zero. See GNARXfit for model description.
Value
GNARXsim
returns the multivariate time series as a ts object, with n
rows and a column for each of the nodes in the network.
References
Knight, M.I., Nunes, M.A. and Nason, G.P. Modelling, detrending and decorrelation of network time series.
arXiv preprint.
Knight, M.I., Leeming, K., Nason, G.P. and Nunes, M. A. (2020) Generalised Network Autoregressive Processes and the GNAR package. Journal of Statistical Software, 96 (5), 1–36.
Nason G.P. and Wei J. (2022) Quantifying the economic response to COVID-19 mitigations and death rates via forecasting Purchasing Managers’ Indices using Generalised Network Autoregressive models with
exogenous variables. Journal of the Royal Statistical Society Series A, 185, 1778–1792.
Examples
#Simulate a GNARX process with the fiveNet network
set.seed(1)
n = 1000
xvts=list()
xvts[[1]] = matrix(rnorm(5*n, mean=0, sd=2), nrow=n, ncol=5)
xvts[[2]] = matrix(rnorm(5*n, mean=0, sd=2), nrow=n, ncol=5)
lambdaParams=list()
lambdaParams[[1]] = c(0.5, -0.5)
lambdaParams[[2]] = c(0.3, 0.1)
# Simulate the GNARX using the exogenous variables xvts with associated parameters lambdaParams
Y_data <- GNARXsim(n=n, net=GNAR::fiveNet, alphaParams=list(c(rep(0.2,5))), betaParams=list(c(0.5)),
sigma=1, xvts=xvts, lambdaParams=lambdaParams)
# now try to refit the model
model <- GNARXfit(vts = Y_data, net = GNAR::fiveNet,globalalpha = TRUE, alphaOrder = 1,
betaOrder = 1, xvts = xvts, lambdaOrder = c(1,1))
model