Fits the GNAR model to up to observation t-1
and produces a within-sample prediction for time t
.
GNARpredict(vts=GNAR::fiveVTS, net=GNAR::fiveNet, alphaOrder=2, betaOrder=c(1,1),
fact.var=NULL, globalalpha=TRUE, tvnets=NULL, netsstart=NULL, ErrorIfNoNei=TRUE)
a matrix containing the multivariate time series to be modelled. The i,j
entry of this matrix should be for time i
and vertex/node j
.
the (first) network associated with the time series, containing a list with entries $edges
and $dist
. This network should have the same number of nodes as the number of columns of the vts
matrix.
a non-negative integer specifying the maximum time-lag to model.
a vector of length alphaOrder
specifying the maximum neighbour set to model at each of the time-lags.
a vector of factors indicating which nodes belong to differents set with different parameters to be fitted.
a TRUE/FALSE value indivating whether to use global alpha parameters.
a list of additional networks. Currently only NULL (the static network case) is supported.
a vector of times corresponding to the first time points for each network of tvnets
. Currently only NULL (the static network case) is supported.
a TRUE/FALSE value indicating whether to stop the function call with an error if betaOrder specifies more neighbour sets than exist in the network. If FALSE the function will continue and some parameters will be NA.
the prediction for time t
.
the lm
output from fitting the GNAR model up to t-1
.
the original response values up to t-1
, with NAs left in.
the output of GNARdesign
containing the design matrix up to t-1
, with NAs left in.
the original response values at t
.
the time t
entries of the design matrix.
inputs to the GNARpredict
function.
See GNARfit for GNAR model information. Note that the prediction is for the final time observation of the input data, to predict out-of-sample add a row of zeros to the input data matrix. Only coefficients with p-value smaller than 0.05 are used to calculate prediction. See is.GNARnet for GNARnet
object information and example construction.
# NOT RUN {
#Fit and predict the fiveVTS data with the GNAR(2,[1,1]) model
data(fiveNode)
GNARpredict()
# }
Run the code above in your browser using DataLab