StatTimeSerAnalysis.ARARForecast Method

void ARARForecast(TVec Data, TVec Phi, TVec Filter, Int32 tau, Int32 l1, Int32 l2, Int32 l3, Double SMean, Int32 N, TVec aResult, TVec StdErrs, ref Double RMSE)

Forecast time series by ARAR.

#NameDescription
1DataDefines original time series.
2PhiDefines ARAR model Phi coefficients (phi[0],phi[1],phi[2],phi[3]).
3FilterDefines memory shortening filter, obtained from memory-shortening operation. In case no memory-shortening is performed, set filter to 1.0 by using Filter.SetIt([1.0]).
4tauDefines memory-shortening optimal lag, obtained from memory-shortening operation. In case no memory-shortening is performed, set it to 1.
5l1Defines optimal lag for phi[l1] (see equation above).
6l2Defines optimal lag for phi[l2] (see equation above).
7l3Defines optimal lag for phi[l3] (see equation above).
8SMeanDefines memory-shortened series mean.
9NDefines number of forecasts.
10aResultReturns forecasts. Size and complex properties of Result are adjusted automatically.
11StdErrsReturns forecasts standard errors. Size and complex properties of StdErrs are adjusted automatically.
12RMSEReturns fit root mean square error (RMSE).

Result: stored in self (calling object)

Remarks:

Forecast time series values by using ARAR model, defined by the following relation:

X[t]=ϕ1X[t1]+ϕl1X[tl1]+ϕl2X[tl2]+ϕl3X[tl3]+Z[t]X[t] =\phi _1 X[t-1] + \phi _{l1} X[t-l1] + \phi _{l2} X[t-l2] + \phi _{l3} X[t-l3] + Z[t]
Examples
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
    private void Example()
    {
        Vector timeseries = new Vector(0);
        Vector s = new Vector(0);
        Vector filter = new Vector(0);
        Vector phi = new Vector(0);
        Vector forecasts = new Vector(0);
        Vector stderrs = new Vector(0);
        int l1, l2, l3, tau;
        double s2, rmse;
        timeseries.LoadFromFile("deaths.vec");
        // #1: shorten series
        StatTimeSerAnalysis.ShortenFilter(timeseries, s, out tau, filter, 15);
        // #2 : fit ARAR model on shortened series
        StatTimeSerAnalysis.ARARFit(s, phi, out l1, out l2, out l3, out s2, 13);
        // #3: forecast 100 values by using ARAR fit parameters
        StatTimeSerAnalysis.ARARForecast(timeseries, phi, filter, tau, l1, l2, l3, s.Mean(), 100, forecasts, stderrs, out rmse);
    }
}
See Also: StatTimeSerAnalysis.ARARFit, StatTimeSerAnalysis.ShortenFilter