如何预测多元时间序列?

时间:2019-07-07 18:58:44

标签: java statistics time-series weka

我在attemot中使用以下代码使用Sunashu统计资料库预测了多元时间序列。

double[][] series = {
    {0,118},
    {11,143},
    {13,145},
    {3,88},
    {11,138},
    {3,180},
    {5,88}
};

Matrix matrix = new DenseMatrix(series);

int p = 1;
MultivariateIntTimeTimeSeries timeSeries = new MultivariateSimpleTimeSeries(matrix);
VARFit varFit = new VARFit(timeSeries, p);
VARMAModel varmaModel = varFit.getVARMA();

System.out.println("VARMA model: " + varmaModel);
VARMAForecastOneStep forecast = new VARMAForecastOneStep(timeSeries, varmaModel);
System.out.println("forecast series: " + forecast.xHat(12));

我正在获取以下堆栈跟踪:

Exception in thread "main" java.lang.IllegalArgumentException: EX<sub>t</sub> = 0
    at com.numericalmethod.suanshu.misc.ArgumentAssertion.assertTrue(vjb:256)
    at com.numericalmethod.suanshu.stats.timeseries.linear.multivariate.stationaryprocess.arma.VARMAAutoCovariance.<init>(ol:188)
    at com.numericalmethod.suanshu.stats.timeseries.linear.multivariate.stationaryprocess.arma.VARMAForecastOneStep.<init>(em:117)
    at net.aline.paml.compute.test.VARFitExample.main(VARFitExample.java:58)

该错误引发以下行:

public VARMAAutoCovariance(VARMAModel model, int nLags) {
ArgumentAssertion.assertTrue(DoubleUtils.isZero(model.mu().norm(), 0.0D), "EX<sub>t</sub> = 0", new Object[0]);

0 个答案:

没有答案