# Time-series analysis — Part 2

In the part 1 of this article series, I went over some basic methods of forecasting utilizing time-series data. In this article, we will be going over some of the more mathematically advanced methods of time-series forecasting.

1. Holt’s linear trend method

This method, developed in 1957, is an extension of exponential smoothing, used in forecasting by including two smoothing equations.

In these equations, t denotes the time, l(t) denotes the level of time-series at time t, b(t) represents the trend values at time t, h represents the time for which we are forecasting.

2. Holt-Winter’s seasonal method

This method is an extension of Holt’s method, to include a parameter for seasonality.

Here, S(t) represents seasonal value at time t.

Another form of Holt-Winter’s method is the multiplicative form, where we assume the prediction function to be a product of smoothing function, trend function and seasonality function.

3. Holt’s damped method

This method is an improvement to the Holt’s method. In Holt’s, the trend seem to continue to rise or fall infinitely. But, it has been observed that this leads to over-forecasting and hence, the methods needs some improvements. Gardner & McKenzie included a damping parameter in the model to make it more realistic.

# Forecasting in R

Reading the data set and converting to a time-series. We have a weekly time-series consisting of average weekly temperature.

`data_week <- read.csv('data_week.csv')week <- ts(data_week, start=c(2015), frequency=52.25)xx = ts(temp, frequency = 52, start = c(2015,1))plot(xx)`

Fitting the data-set to the various methods mentioned above:

`fc2 <- holt(xx, h=100)fc <- holt(xx, damped=TRUE, phi = 0.8, h=100)fit1 <- HoltWinters(xx, beta = TRUE, gamma = TRUE, seasonal="additive")fit2 <- HoltWinters(xx, beta = TRUE, gamma = TRUE, seasonal="multiplicative")`

Plotting the time-series: