0
$\begingroup$

I am working with the in built Air Passenger data set in R to learn forecasting.

After splitting the data in 120:24 data points, I am trying to extract trend component from them.

For the training data with 120 data points I did trend_logtrain<- ma(log_train, order = 12, centre = T) because the data is recorded monthly so aptly the order of moving average is 12. But as it should, I have 6 missing values from the start and 6 missing values towards the end.

Similarly, to extract the trend component of test data, I did the same trend_logtest<- ma(log_test, order = 12, centre = T) and instead of having trend for 24 data points, now I have trend values for 12 data points with the rest of them NA

My question is, do we proceed accordingly and only use the 12 test data points for validating a forecasting model? Or is there a way where we can extract the trend properly and still make use of all 24 data points ?

Because, reconstructing the test data like Trend * Seasonality * Random with 12 missing values in Trend will cause in 12 predictions instead of 24.

$\endgroup$
  • $\begingroup$ Your title suggests the model-selection tag would be relevant, but the body does not quite justify that, IMHO. Perhaps you should consider a more precise title. $\endgroup$ – Richard Hardy Sep 21 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.