Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
21 views44 pages

Timeseries Intro

This document provides an overview of time series analysis, including its definition, utility, and components such as secular trends, seasonal variations, cyclical variations, and random movements. It discusses various models for time series forecasting, including additive and multiplicative models, as well as ARIMA models, which are used for both stationary and non-stationary data. Additionally, it outlines methodologies for checking stationarity and selecting appropriate models for analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views44 pages

Timeseries Intro

This document provides an overview of time series analysis, including its definition, utility, and components such as secular trends, seasonal variations, cyclical variations, and random movements. It discusses various models for time series forecasting, including additive and multiplicative models, as well as ARIMA models, which are used for both stationary and non-stationary data. Additionally, it outlines methodologies for checking stationarity and selecting appropriate models for analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

UNIT-V: TIME SERIES

ANALYSIS
UNIT-V: Time series
Definition:
A time series is a set of observations taken at a specified time usually at
equal intervals.
Utility of time series
1. Useful to know the past history of time series data
2. Helps in planning the future operation
3. To predict the future demand, whether conditions etc.
4. Two or more time series can be compared
Components of Time Series
The various forces at work affecting the values of time series, can be
classified into the following four categories.
1. Secular Trend or Long term Movement
2. Periodic changes or short term Fluctuations
i) Seasonal variations ii) Cyclical variations
3. Random or Irregular Movements
Components of Time Series
1)Secular Trend :
The trend is the general, smooth, long-term, average tendency. It is not
necessary that the increase or decrease should be in the same direction
throughout the given period. However, the overall tendency may be
upward, downward or stable. Example: the effect of population
increase over a long period of time on the expansion of various sectors
like agriculture, industry, education, textiles, etc., is a continuous but a
gradual process.
Components of Time Series
2) Periodic changes
i) Seasonal variations:
These variations in a time series are due to the forces which affect in a
regular and periodic manner over a span of less than a year i.e., during
a period of 12 months and have the same or almost have the same
pattern year after year. Thus seasonal variations in a time series will be
there if the data are recorded quarterly, monthly, weekly, daily, hourly
and so on.
Example: prices, production and consumption of commodities; sales
and profits in a departmental store; bank clearings and bank deposits
etc., are all affected by seasonal variations.
Components of Time Series
ii) Cyclical variations:
Cyclic variations are upward, stable and downward movements in a
time series but the period of cycle is greater than one year. Also those
variations are not regular as seasonal variations. The cyclic movements
in a time series consists four phase cycle. They are
1) Prosperity 2) Recession 3) Depression 4) Recovery
Components of Time Series
3. Random or Irregular movements:
Apart from the regular variations, almost all the series contain another
factor called the random or irregular fluctuations. These fluctuations
are purely random, uncertain or uncontrolled are due to irregular
circumstances which are beyond the control of human hand such as
earthquakes, wars, floods, revolutions etc.
Time series graph
Plotting Time series data using R

data(AirPassengers)
ts.plot(AirPassengers) # to get time series plot
ts.plot(AirPassengers,main="Airpassengers
data",xlab="Time",ylab="airpassengers") # to get time series
plot with title, x axis &yaxis

(or)
AirPassengers
timeseries_data <- ts(AirPassengers, frequency=12, start=c(1949,1))
ts.plot(AirPassengers)
Cyclical fluctuations
Mathematical model of Time Series
i)Additive model of time series
ii) Multiplicative model of time series
i) Additive model of time series
This model assumes that the observed value at time t is the sum of the
components of time series

Where represents the observed value of time series at time t


represents the secular trend at time t
represents seasonal variations at time t
represents cyclical variations at time t
represents Irregular variations at time t
Additive model of time series
Additive model of time series assumes that all the four components of
time series operate independently of one another. It also assumes that
the behaviour of components is of additive in nature and none of the
components has any effect on the remaining three.
ii) Multiplicative model of time series
The model assumes that observed value at time t is obtained by
multiplying the four components.

The multiplicative model assumes that the components of the time


series due to various causes not necessarily independent. It also
assumes that the behaviour of components is of multiplicative in
nature.
In practice most of the time series relating to economic and business
data confirm to multiplicative model.
Measurement of Secular Trend

Methods:
i) Graphical method or Trend by inspection
ii) Semi Averages
iii) Moving Averages
iv) Curve fitting by Principles of Least Squares
i) Trend by inspection
A free hand smooth curve obtained on plotting the values against t
enables us to form an idea about the general trend of the series.
Smoothing of the curve eliminates other components i.e. regular and
irregular fluctuations.
ii) Semi - Averages method
In this method the whole data is divided in to two equal parts with
respect to time. E.g. if we are given data from 1971-1982 over a period
of 12 years, the two equal parts from 1971 to 1976 and 1977 to 1982.
In case of odd number of years the two parts are obtained by omitting
the value corresponding to middle year, e.g. for the data from 1971-
1981; the two parts would be the values for 1971-75 and 1977-81, the
value corresponding to middle year 1976 being omitted. Next we
compute the arithmetic mean for each part and plot these two
averages against the mid values of the respective periods covered by
each part. The line obtained on joining these two points is the required
trend line and may be extended both ways to estimate intermediate or
future values.
Example.1

Fit a trend line to the following data by the method of semi-averages.


Year Bank clearings(in Year Bank clearings(in
Rs. Crores) Rs. Crores)
1971 53 1977 105
1972 79 1978 87
1973 76 1979 79
1974 66 1980 104
1975 69 1981 97
1976 94 1982 92
Example.2
iii) Moving Average method

Case-I: when period is odd


Procedure: (Three yearly moving average)
Step 1: obtain three yearly moving total starting from 1st year and put
against the middle of year
Step 2: Now leaving first year and adding successor year, find total of
group and place it against the middle of years
Step 3: Keep on continuing unless all values are utilized
Step 4: Now divide each three years moving total by 3 to get the
moving average
Step 5: Plot the original data and moving averages on a graph.
ii) Moving Average Method
Case II: When period is even
Procedure: (Four yearly moving average)
Step 1: Add the values of first four years and place total between the
second and third year
Step 2: Leaves the 1st year value and add the values of next four years
and place it in between third and fourth year continuing the process.
Step 3: Divide four years moving totals by 4 to get four year moving
averages.
Step 4: Add first two moving averages and divide it by 2 to get moving
average centered and place it against third year and so on.
ARIMA models

Autoregressive Integrated Moving Average models (ARIMA models)


were popularized by George Box and Jenkins in the early 1970s.

ARIMA models are a class of linear models that is capable of


representing stationary as well as non-stationary time series.

ARIMA models do not involve independent variables in their


construction. They make use of the information in the series itself to
generate forecasts.
Model
Identification

Methodology
Model Estimation

Diagnostic
checking

Model forecasting
Auto regressive process/AR (p) process
It is a fundamental concept in time series analysis and forecasting. This
model is used for relationship between an observed and several lagged
(previous time series ) values. The objective of the autoregressive
model is that the current value of a time series can be expressed as a
linear combination of its past values with some white noise.
AR (p) model
It is the process of determining a current value using p lagged value
with white noise and it is given by
AR(p) Model:
Y t=c+Ф1Yt-1 + Ф2Yt-2 + Ф3Yt-3 +---------+ Фp Y t-p + zt
where c=constant
p is the order of AR model
zt =white noise(random component)
Y t is the value of time series at time t
Yt-1 is the value of time series one period ago and so on.
Types of AR(p) model

If p=1;
AR(1) Model:
AR(1) is the process of determining a current value using 1 lagged value
with white noise and it is given by
Y t=c+Ф1Yt-1 + zt
AR(2) Model:
Y t=c+Ф1Yt-1 + Ф2Yt-2 + zt
Lagged values in time series data
Moving Average model/ MA (q)process

Moving average model is a type of time series model and is used for
forecasting the trend and understand the pattern of the time series
data. Moving average process is the method of evaluating the present
value of the time series depends on the linear combination of the past
error terms of the time series.
Here q is the order of the moving average model. In other words the
moving average process is that the current value of the time series will
depend on the past error terms.
Moving Average process/ MA(q) process
MA(q) Model:
Y t=c+ϴ1 et-1 + ϴ2 et-2 + ϴ3 et-3 +---------+ ϴq et-q + et
where Y t is the current value of the time series at time t
c is the constant

ϴ1, ϴ2, …… ϴq are the parameters or the effect of error terms on the
current value
et = error at time t
MA(1) model
Moving average of first order represents the current value of the time
series influenced by the previous period error term and is given by
If q=1;
MA(1) model:
Y t=c+ϴ1 et-1 + et

MA(2) model:
Y t=c+ϴ1 et-1 + ϴ2 et-2 + et
MA(2) model

It represents a moving average model of order 2. This means the


current value of time series is influenced by the two proceeding error
terms.

Y t=c+ϴ1 et-1 + ϴ2 et-2 + et


ARIMA(p ,d , q) Model:
Y t=c+Ф1Yt-1 + Ф2Yt-2 + Ф3Yt-3 +---------+ Фp Y t-p + et - ϴ1 et-1 - ϴ2 et-2 - ϴ3 et-3
- ------ - ϴq et-q
Stationarity of time series data
Stationarity means no growth or decline. Here data fluctuates around a
constant mean independent of time and variance of the fluctuation
remains constant over time.
For testing the stationarity of time series the following methods can be
used.
1. Visual inspection
Plot the time series data and observe whether there is trend and
seasonality. If the data appears to fluctuate around a constant mean
and constant variance.
i.e. Plot shows no change in the means over time
No obvious change in the variance over time.
Stationarity of time series data
2. Summary statistics
Calculate the mean and variance of the time series. If they are
constant, the time series may be considered as stationary.
3. Augmented Dickey Fuller Test
This is a statistical test used to check if a time series data is stationary. It
is a unit root test that tests for the presence of a unit root, which
indicates non-stationarity in the time series.
Stationarity is a fundamental assumption for many time series models,
and the ADF test helps determine if data needs to be transformed to
achieve stationarity before model fitting.
Stationary and Non-Stationary Time series
Non Stationary of time series
In non stationary time series, the statistical properties change over time
and there is a trend and seasonality component. It is difficult to draw
reliable inference or make accurate forecast. As the statistical
properties keep changing the model based on non stationary time
series may not provide reliable results.
Therefore, analysing stationary data is easier and reliable than non
stationary time series data.
Methodology
Identification

Data preparation

Transform data to stabilize variance

Differencing data to obtain stationary series

Model selection

Examine data, ACF and PACF to identify potential

models
Components of ARIMA
Autoregressive (AR) Component:
This part models the relationship between a value and its past values. For
example, if today's sales depend on sales from the past few days, an AR
model can capture this.
Integrated (I) Component:
This component handles non-stationary data, which means the statistical
properties (like mean and variance) change over time. Differencing
(subtracting consecutive values) is applied to make the data stationary.
Moving Average (MA) Component:
This part models the relationship between a value and the error terms (or
residuals) from past predictions. It helps account for random shocks or
fluctuations in the data.
ARIMA methodology steps
1. Data Preparation:
Gather and prepare the time series data, which might involve handling missing values and ensuring data
quality.
2. Stationarity Check:
Determine if the data is stationary. If not, differencing (I component) is applied until the data becomes
stationary.
3. Model Identification:
Analyse the Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) plots to identify
potential AR and MA orders (p and q).
4. Parameter Estimation:
Estimate the parameters (p, d, q) of the ARIMA model using statistical methods.
5. Model Checking:
Evaluate the model's performance using diagnostic tests (e.g., examining residuals for randomness) and
choose the best model based on criteria like AIC or BIC.
6. Forecasting:
Once a suitable model is identified, it can be used to forecast future values.
Example:

An ARIMA(1,1,1) model would mean:


1: One lag (past value) is used in the AR component.
1: One difference is applied to make the data stationary.
1: One lag of the error term is used in the MA component

You might also like