You are on page 1of 5

Time

Series Data for Flood



The time series for flood is decomposed into trend, seasonal, and random components in R. As
we can see, there is an increasing trend for flood in the time series aft the 1960s. Seasonality is
also apparent in the time series. The random component is just the random fluctuations in the
time series.


The ACF shows oscillation, indicating a seasonal series. The peaks occur at lags of 12 months,
because January 1902 correlates with January 1903, and 24 months, because January 1902
correlates with January 1904, and so on.

Time Series Forecasting in R

1. Holt-Winters Exponential Smoothing

Holt-Winters Exponential Smoothing Method in R:

Step 1: Use the function HoltWinters() and input the series into the function. Alpha, beta, and
gamma will be calculated by default. If not, set FALSE to not calculate the parameter. Additive
or multiplicative can be set under the option of seasonal. Additive is the default option.

Step 2: Use library(forecast) to make forecast for the Holt-Winters method by using
forecast.HoltWinters(). Option h can be specified for the length of time period to be predicted
(in month).

Step 3: Plot the variable created from step 2, and type in the variable created will show a plot
and a table of the predicted values in the next h period.

Results and Discussion


The above plot is the forecast for the number of flood in the next 10 years starting from 2015.
The forecasts are shown as a blue line, dark gray shade (80% prediction interval), and light gray
( 95% prediction interval) shade. The forecast is optimistic as we see a downward trend in the
forecast for the number of flood occurrences.

Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Jan 2015 0.250048960 -0.4097719 0.9098699 -0.759060011 1.259158
Feb 2015 0.171736864 -0.4882198 0.8316935 -0.837579770 1.181053
Mar 2015 0.550840208 -0.1092579 1.2109383 -0.458692735 1.560373
Apr 2015 1.197932891 0.5376876 1.8581782 0.188174822 2.207691
May 2015 0.971205197 0.3108068 1.6316036 -0.038786989 1.981197
Jun 2015 1.053981663 0.3934242 1.7145391 0.043746199 2.064217
Jul 2015 0.433585135 -0.2271375 1.0943078 -0.576902940 1.444073
Aug 2015 0.197945286 -0.4629487 0.8588393 -0.812804905 1.208695
Sep 2015 0.132974301 -0.5280974 0.7940460 -0.878047679 1.143996
Oct 2015 0.094698104 -0.5665578 0.7559540 -0.916605510 1.106002
Nov 2015 0.209256368 -0.4521902 0.8707030 -0.802338895 1.220852
Dec 2015 0.195635746 -0.4660082 0.8572797 -0.816261348 1.207533

Above is the table forecasting the number of floods in the year of 2015. April, May, and June
(rainy season) seem to be the riskiest months in the year of 2015, so the forecast has clearly
identified seasonality.

Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Jan 2024 0.146103815 -0.6109477 0.9031553 -1.011706543 1.303914
Feb 2024 0.067791718 -0.6904988 0.8260822 -1.091913504 1.227497
Mar 2024 0.446895062 -0.3126483 1.2064384 -0.714726202 1.608516
Apr 2024 1.093987745 0.3331777 1.8547978 -0.069570785 2.257546
May 2024 0.867260051 0.1051694 1.6293507 -0.298257020 2.032777
Jun 2024 0.950036517 0.1866513 1.7134217 -0.217460417 2.117533
Jul 2024 0.329639990 -0.4350538 1.0943337 -0.839858173 1.499138
Aug 2024 0.094000140 -0.6720161 0.8600164 -1.077520662 1.265521
Sep 2024 0.029029155 -0.7383237 0.7963820 -1.144535739 1.202594
Oct 2024 -0.009247041 -0.7779505 0.7594564 -1.184877523 1.166383
Nov 2024 0.105311222 -0.6647569 0.8753794 -1.072406380 1.283029
Dec 2024 0.091690601 -0.6797563 0.8631375 -1.088135694 1.271517

The rainy season again is identified in the year of 2024. Thus, this method is reasonable for
predicting flooding in Canada.

2. Seasonal Autoregressive Integrated Moving Average (ARIMA)

ARIMA in R:

Step 1: Install forecast package from R and find the function auto.arima().

Step 2: Input the time series of interest into the function auto.arima() and create a variable, say
fit. For instance, fit <- auto.arima(timeseriesofinterest).

Step 3: Use the forecast function forecast(), and input the variable fit and specify the forecast
period in month. For instance, fcast = forecast(fit, 12) where 12 is the forecast period of 1 year.

Step 4: Type fcast created from step 3, you will see the forecast points calculated by the
function forecast for the next 1 year. You can also plot(fcast) to see the forecasting results.

Results and Discussion

The ARIMA Model

Series: dtseries
ARIMA(5,1,4)(1,0,0)[12] with drift

Coefficients:
ar1 ar2 ar3 ar4 ar5 ma1 ma2 ma3 ma4 sar1 drift
-0.406 0.7461 0.4395 -0.1452 -0.0558 -0.4844 -1.1855 0.1522 0.5219 0.1293 0.0004


The above plot is the forecast for the number of flood in the next 10 years starting from 2015.
The forecasts are shown as a blue line, dark gray shade (80% prediction interval), and light gray
( 95% prediction interval) shade. There is a slight increasing trend and the predictive values are
under 1 occurrence. Thus, this method tells us less about flood occurrences than the Holt-
Winters smoothing method.

Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Jan 2015 0.4554701 -0.2191904 1.130131 -0.5763342 1.487274
Feb 2015 0.5323576 -0.1463436 1.211059 -0.5056263 1.570341
Mar 2015 0.5321689 -0.1468694 1.211207 -0.5063305 1.570668
Apr 2015 0.8223180 0.1432511 1.501385 -0.2162252 1.860861
May 2015 0.5185741 -0.1619255 1.199074 -0.5221602 1.559309
Jun 2015 0.7825265 0.1016430 1.463410 -0.2587949 1.823848
Jul 2015 0.4978197 -0.1837593 1.179399 -0.5445653 1.540205
Aug 2015 0.4881519 -0.1937630 1.170067 -0.5547470 1.531051
Sep 2015 0.4798710 -0.2022029 1.161945 -0.5632711 1.523013
Oct 2015 0.4663977 -0.2158390 1.148634 -0.5769933 1.509789
Nov 2015 0.4650680 -0.2171931 1.147329 -0.5783602 1.508496
Dec 2015 0.4549093 -0.2273939 1.137212 -0.5885834 1.498402

Above is the table forecasting the number of floods in the year of 2015. April and June are the
rainy months in Canada, and ARIMA point forecasts predicts that these months are higher than
other months in the year of 2015. This model, however, missed the month May.

Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Jan 2024 0.5329643 -0.1585705 1.224499 -0.5246469 1.590575
Feb 2024 0.5333231 -0.1582549 1.224901 -0.5243542 1.591001
Mar 2024 0.5336820 -0.1579394 1.225303 -0.5240616 1.591426
Apr 2024 0.5340409 -0.1576238 1.225706 -0.5237690 1.591851
May 2024 0.5343998 -0.1573082 1.226108 -0.5234763 1.592276
Jun 2024 0.5347586 -0.1569927 1.226510 -0.5231837 1.592701
Jul 2024 0.5351175 -0.1566771 1.226912 -0.5228910 1.593126
Aug 2024 0.5354764 -0.1563615 1.227314 -0.5225984 1.593551
Sep 2024 0.5358353 -0.1560459 1.227716 -0.5223057 1.593976
Oct 2024 0.5361941 -0.1557303 1.228119 -0.5220130 1.594401
Nov 2024 0.5365530 -0.1554147 1.228521 -0.5217204 1.594826
Dec 2024 0.5369119 -0.1550992 1.228923 -0.5214277 1.595251

However, in 2024, the seasonality wears off as the years go on. In 2024, we can barely identify
the rainy season in Canada; thus, cannot properly predict the potential flooding dates. Thus,
ARIMA seems to not be good for long-term forecast comparing to the Holt-Winters method.

Conclusion

As a result, Holt-Winters exponential smoothing method is more preferable than the ARIMA
model for this study. By using the Holt-Winters method, both the provincial and federal
governments should be aware the possibilities of flooding in the rainy months (April, May, and
June) and have the flexibility to relocated resources (finance and personnel) to combat the
potential flooding.

You might also like