This dataset contains the Monthly price of Natural gas, starting from January 1997 to August 2020. Prices are in nominal dollars.
Since this is monthly data, frequency =12 will be used the define the time series object.
The following visual representations show the different behaviors of the two methods of decomposition. This is the classical decomposition of the additive time series.
This is the STL decomposition of the addivitive time series
We hold up the last 7 periods of data for testing. The rest of the historical data will be used to train the forecast model.
To evaluate the effect of different sizes in training the time series, We define different training data sets with different sizes. Three training set sizes used in this example are 144, 109, 73, and 48. The same test set with size 7 will be used to calculate the prediction error.
We next perform error analysis.
| MSE | MAPE | |
|---|---|---|
| n.144 | 0.0502943 | 0.0839476 |
| n.109 | 0.0522701 | 0.0860305 |
| n. 73 | 0.0686739 | 0.1212956 |
| n. 48 | 0.1420157 | 0.2078806 |
We trained the same algorithm with different sample sizes and compared
the resulting accuracy measures. Among four training sizes 144, 109, 73,
and 48. training data size 144 yields the best performance with training
data size 48 yielding the worst performance.