# Predict the first observations of a time series when order of the model is higher

Suppose you have you have a time series with 365 observations, one for each day of the year, and you split the first 183 rows in training set and the latest 182 in test set.

Suppose you create an AR (autoregressive model), and you set the order of the model to 4. So you will have:

$$y(t) = a1y(t-1)+a2y(t-2)+a3y(t-3)+a4y(t-4)$$

In a situation like this, is it possible to do predictions on the first observation of the test set? That basically is the 184th row I think no, because we do not have y(t-1),...,y(t-4) but we have only y(t)=value of 184th observation.

So, the first row we can predict is 188th, right? Because:

$$y(t-1)=value$$ of $$187^{th}$$ row
$$y(t-2)=value$$ of $$186^{th}$$ row
$$y(t-3)=value$$ of $$185^{th}$$ row
$$y(t-4)=value$$ of $$184^{th}$$ row

I think that until now is right. Correct me if I am wrong.

But if I want to predict the obs. 184, the first one of test set, is there any way? I mean, without decreasing the order of the model from 4 to 1 for example.

In your model, the dependent variable is $$y_5$$ to $$y_{183}$$. On the other hand, the four explanatory variables are: $$y_1-y_{179}$$; $$y_2-y_{180}$$; $$y_3-y_{181}$$; and $$y_4-y_{182}$$.
So the test data set for each of the explanatory variable actually starts from $$y_{180}$$, $$y_{181}$$, $$y_{182}$$ and $$y_{183}$$ respectively.