matlabforecastingautoregressive-models

Matlab's Arburg (Autoregression Burg's method) for forecasting time series


Matlab's arburg function returns a vector of coefficients of the form [1 c(i) c(2) ... c(p)] where p is the model's order. But these are not the coefficients for forecasting, instead they are used with a random input vector to simulate an stochastic AR process. Without forecasting anything on test data how can I compute model's error to calculate say AIC criterion? Is there a categorical difference between AR models like this and those used for forecasting?


Solution

  • So I have found that yes indeed we can use those coefficients (except the first one which is always 1) to forecast the next time point. To use the coefficients, first we need to remove the first one, then flip and negate the array. The mean absolute error can be calculated like this:

    coeffs = -flip(coeffs(2:end))
    error = mean(abs(time_series(t) - coeffs*time_series(t-length(coeffs):t-1)))
    

    where * is the matrix multiplication assuming coeffs is a row vector and time_series is a column vector.