# Reply To: Question about VARMA forecast

Home 21090308 Forums Numerical Method Statistics Question about VARMA forecast Reply To: Question about VARMA forecast

#2671
ozcanalp
Member

Thank you very much Ding Hao,

I have one more question about “public VARFitting(MultivariateIntTimeTimeSeries mts,int p)”. How can I estimate p value by using akaike information criterion. For example if I used ARIMA model below code is ok for me. But how can I estimate p value for VARMA model by using akaike information criterion?

Best wishes,
ozcanalp

double[] inputNumbers = new double[] { 2, 3, 4 };
int P_VALUE = 2;
int D_VALUE = 1;
int Q_VALUE = 3;

int p = P_VALUE;
int d = D_VALUE;
int q = Q_VALUE;

ARIMAModel arima = null;

double maxAic = 0;
double actualAic = 0;
int maxp = 10;
int maxd = 10;
int maxq = 10;

ConditionalSumOfSquares csos = new ConditionalSumOfSquares(inputTimeSeries, p, d, q);

for(int ii=0;ii<=3;ii++){ for(int jj=0;jj<=2;jj++){ for(int kk=0;kk maxAic){ maxAic = actualAic; maxp = p; maxd = d; maxq = q; csos = new ConditionalSumOfSquares(inputTimeSeries, p, d, q); } } } } Console.Write("\n"); Console.Write("maxp: " + maxp + "," + maxd + "," + maxq); Console.Write("\n"); arima = csos.getModel(); IntTimeTimeSeries xt = new SimpleTimeSeries(inputTimeSeries); ARIMAForecast instance = new ARIMAForecast(xt, arima); ARIMAForecast.Forecast frc = instance.next(); double next = frc.xHat(); double err = frc.var();