computeMSPEcpp {forecastSNSTS} | R Documentation |
Mean Squared Prediction Errors, for a single
Description
This function computes the estimated mean squared prediction errors from a given time series and prediction coefficients
Arguments
X |
the data |
coef |
the array of coefficients. |
h |
which lead time to compute the MSPE for |
t |
a vector of times from which backward the forecasts are computed |
type |
indicating what type of measure of accuracy is to be computed; 1: mspe, 2: msae |
trimLo |
percentage of lower observations to be trimmed away |
trimUp |
percentage of upper observations to be trimmed away |
Details
The array of prediction coefficients coef
is expected to be of
dimension P x P x H x length(N) x length(t)
and in the format as
it is returned by the function predCoef
. More precisely, for
and the
j.N
th element of N
element of
N
the coefficient of the
h
-step ahead predictor for which is computed from
the observations
has to be available via
coef[p, 1:p, h, j.N, t==i]
.
Note that t
have to be the indices corresponding to the coefficients.
The resulting mean squared prediction error
is then stored in the resulting matrix at position (p, j.N)
.
Value
Returns a P x length(N)
matrix with the results.