Home Forums Question about VARMA forecast

Viewing 1 post (of 1 total)
• Author
Posts
• #2666
hessinemaaoui
Keymaster

Hi,

I have an example for a bivariate series with n=2, p=2, and q=0 and i wanna estimate N+1. value by fitting an VARMA model.
I’ve used suanshu.net-2.6.0 for the below code.
I’ve fitted a model but i got an exception on this line
instance = new VARMAForecastOneStep(X_T, varmaModel);
and i don’t know how to estimate the next term. I’m new with Suanshu and any help or advise will be appreciated.

Exception :

at com.numericalmethod.suanshu.misc.ArgumentAssertion.assertTrue(Boolean condition, String errorMessage, Object[] args)
at com.numericalmethod.suanshu.stats.timeseries.linear.multivariate.stationaryprocess.arma.VARMAAutoCovariance..ctor(VARMAModel model, Int32 nLags)
at com.numericalmethod.suanshu.stats.timeseries.linear.multivariate.stationaryprocess.arma.VARMAForecastOneStep..ctor(MultivariateIntTimeTimeSeries Xt, VARMAModel model)

code:
X_T = new MultivariateSimpleTimeSeries(
new double[][]{
new double[]{1, 50},
new double[]{2, 60},
new double[]{3, 70},
new double[]{4, 80},
new double[]{5, 90},
new double[]{6, 100},
new double[]{7, 110},
new double[]{8, 120},
new double[]{9, 130},
new double[]{10, 140},
new double[]{11, 150},
new double[]{12, 160},
new double[]{13, 170},
new double[]{14, 180},
new double[]{15, 190},
new double[]{16, 200},
new double[]{17, 210},
new double[]{18, 220},
new double[]{19, 230},
new double[]{20, 240}

});

VARFitting fitting = new VARFitting(X_T, 2);

VARMAModel varmaModel = fitting.getVARMA();
VARMAForecastOneStep instance = null;
try
{
instance = new VARMAForecastOneStep(X_T, varmaModel);
int T = X_T.size();
Vector xTHat = instance.xHat(T + 1);
Matrix V = instance.covariance(T);
Console.Write(“Predictor at time ” + T + “: ” + xTHat + “, covariance of errors: ” + V);
Console.Write(“\n”);
}catch(Exception e){
Console.WriteLine(“\nStackTrace —\n{0}”, e.StackTrace);
}

Viewing 1 post (of 1 total)
• You must be logged in to reply to this topic.