I'm trying to solve a assignment from an university statistic course regarding the ARIMA models using matlab.
The assignment is:
- an Y vector of size n of data
- an NxK matrix with a trend and an exogenous variable where N ha the same length of Y and K=2
$$y_t=X_t\beta + \mu_t$$
with the following:
The first question is to estimate the 3 models.
After plotting the data I observed that the trend is the second column of NxK matrix and so the exogenous is the first.
As far as I understand (my Professor is very bad....):
- The first model is arimax(0,0,0)
- The second model is arimax(2,0,1)
- The third model is arimax(3,0,2)
Am I right?
Secondly I don't know how to use regARIMA and estimate commands considering the trend and the exogenous variables.
I come to the following solution, but I'm quite sure it is wrong because I'm considering NxK matrix as previsions of the model
% Model 2 ARIMAX(2,0,1) mdl_2_p = 2; mdl_2_q = 1; mdl_2=regARIMA('AR',nan(mdl_2_p,1), 'MA', nan(mdl_2_q,1), 'Intercept', 0); [mdl_hat_2,vpar_mdl_2,logl_mdl_2,info_mdl_2]=estimate(mdl_2,Y,'X',X);