Professional Documents
Culture Documents
Lecture 2832
Lecture 2832
Quarterly Annual
Daily IBM Monthly
sales results Google
stock prices rainfall
for Amazon profits
Time series patterns
One more
Uses of Time Series
Procedure:
Procedure:
In this method, the semi-averages are calculated to find out the trend values. Now, we will
see the working procedure of this method.
Procedure:
(i) The data is divided into two equal parts. In case of odd number of data, two equal parts
can be made simply by omitting the middle year.
(ii) The average of each part is calculated, thus we get two points.
Method of Semi-Averages
Procedure:
Fit a trend line by the method of semi-averages for the given data.
Solution
Since the number of years is odd(seven), we will leave the middle year’s production value
and obtain the averages of first three years and last three years.
Method of Moving Averages
Moving Averages Method gives a trend with a fair degree of accuracy. In this
method, we take arithmetic mean of the values for a certain time span. The
time span can be three-years, four -years, five- years and so on depending on the
data set and our interest. We will see the working procedure of this method.
Method of Moving Averages
Procedure:
(i) Decide the period of moving averages (three- years, four -years).
(iii) If the moving average is an odd number, there is no problem of centering it, the average
value will be centered besides the second year for every three years.
Method of Moving Averages
(v) If the moving average is an even number, the average of first four
values will be placed between 2 nd and 3rd year, similarly the average of the
second four values will be placed between 3rd and 4th year. These two
averages will be again averaged and placed in the 3rd year. This continues
for rest of the values in the problem. This process is called as centering of
the averages
Method of Least Squares
The line of best fit is a line from which the sum of the deviations of various
points is zero. This is the best method for obtaining the trend values. It
gives a convenient basis for calculating the line of best fit for the time
series. It is a mathematical method for measuring trend. Further the sum of
the squares of these deviations would be least when compared with other
fitting methods
Defining the Moving Average Model for Time
Series Forecasting
• One of the foundational models for time series forecasting is the moving
average model, denoted as MA(q).
• This is one of the basic statistical models that is a building block of more
complex models such as the ARMA, ARIMA, SARIMA and SARIMAX
models.
• A deep understanding of the MA(q) is thus a key step prior to using more
complex models to forecast intricate time series.
Time series regression models
For example, we might wish to forecast monthly sales Y using total advertising spend X as a
predictor. Or we might forecast daily electricity demand Y using temperature X1 and the day of
week X2 as predictors.
The forecast variable Y is sometimes also called the regress and, dependent or explained
variable. The predictor variables X are sometimes also called the regressors, independent or
explanatory variables.
Simple linear regression
In the simplest case, the regression model allows for a linear relationship between
the forecast variable y and a single predictor variable x :
yt=β0+β1xt+εt
An artificial example of data from such a model is shown in Figure 5.1. The
coefficients β0 and β1 denote the intercept and the slope of the line respectively. The
intercept β0 represents the predicted value of y when x=0. The slope β1 represents the average
predicted change in y resulting from a one unit increase in x
Ploting
Univariate Forecasting ARIMA
35,000
Forecast for Nifty 50
monthly data 30,000
25,000
Refer Excel
20,000
15,000
10,000
5,000
0
08 10 12 14 16 18 20 22 24 26 28 30
ARIMA Forecasting
Diagnostic
1) Trend forecasting
If yt is a time series variable, the 24,000
12,000
Where, ‘Time’ is the time variable and
its slope coefficient (beta) represents 8,000
• Open eviews- Open nifty monthly data- Select nifty and time-
open as equation- Change period to june2022-coefficient
shows trend (means nifty change –per month)-Click forecast-
name new series as trend- change forecast period to July 2022
to December 2030-run-got forecast series-open nifty and trend
series as group-view graph-
2. Curvilinear Trend Forecasting
35,000
Curvilinear trend in the behaviour of a
time series can be analyzed with the help 30,000
of following eq
25,000
20,000
15,000
The slope coefficient (beta) of the time2
term represents the curvilinear trend in 10,000
the series. If the p value of t statistic is less
than 5% level of significance, it indicates 5,000
the presence of a statistically significant
0
long term trend in the time series. 08 10 12 14 16 18 20 22 24 26 28 30
CURVEF NIFTY
E-views
• Open eviews- Open nifty monthly data- Select nifty and time-open as
equation-ADD one more variable time2 - Change period to june2022-
coefficient shows trend (means nifty change –per month)-Click
forecast-name new series as trend- change forecast period to July
2022 to December 2030-run-got forecast series-open nifty and trend
series as group-view graph-
3. Exponential (Growth) Forecasting
35,000
20,000
15,000
The slope coefficient (beta) of the regression
model represents the value of the growth rate of 10,000
• Open eviews- Open nifty monthly data- Select nifty and time-open as
equation-ADD log to nifty only- Change period to june2022-coefficient
shows trend (means nifty change –per month)-Click forecast-name
new series as trend- change forecast period to July 2022 to December
2030-run-got forecast series-open nifty and trend series as group-
view graph-
Time Series Forecasting can also be done on the basis of
• Past momentum/inertia
(Auto Regressive
Behaviour)
An AR model is one where the current value of a variable y, depends upon only the
values that the variable took in previous periods plus an error term. An AR model of
order p, denoted as AR(p), can be expressed as
Let ut be a white noise process with zero mean & constant variance σ2. Then
States that the current value of some series y depends linearly on its own
previous values plus a combination of current and previous values of a white noise
error term.
where y′t is the differenced series (it may have been differenced more than once). The
“predictors” on the right hand side include both lagged values of yt and lagged errors.
We call this an ARIMA(p,d,q) model, where
• rnifty=diff(log(nifty))
• adf.test(rnifty)