time series by h.v.s. de silva department of mathematics

24
TIME SERIES TIME SERIES by by H.V.S. DE SILVA H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS DEPARTMENT OF MATHEMATICS

Upload: warren-mathews

Post on 11-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

TIME SERIESTIME SERIES

byby

H.V.S. DE SILVAH.V.S. DE SILVA

DEPARTMENT OF MATHEMATICSDEPARTMENT OF MATHEMATICS

Page 2: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

ContentsContents::

Introduction to time seriesIntroduction to time series Fundamentals of time series analysisFundamentals of time series analysis

Basic theory of stationary processesBasic theory of stationary processes Time series Models:Time series Models:

-- -- MA modelMA model

-- -- AR modelAR model

-- -- ARIMA modelARIMA model Seasonal AdjustmentSeasonal Adjustment Some applications of social and Physical SciencesSome applications of social and Physical Sciences

Page 3: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

References:

• The analysis of time series: Theroy & Practice

- Chatfield , C

• The statistical analysis of time series

- Anderson,T.W.

• Time series - Kondall, Maurice

• The analysis of time series an introduction

- Chatfield, C.

Page 4: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

1. Introduction to time series

A time series is a collection of observations made sequentially in time.

Examples:Examples: In Economics, daily closing stock prices, weekly interest rates, In Economics, daily closing stock prices, weekly interest rates,

monthly price indices and yearly earnings.monthly price indices and yearly earnings. In Meteorology, hourly wind speed, daily temperature and In Meteorology, hourly wind speed, daily temperature and

annual rainfallannual rainfall In Social Sciences annual birth rates, mortality rates, accident In Social Sciences annual birth rates, mortality rates, accident

rates and various crime rates.rates and various crime rates.

Ctd…Ctd…

Page 5: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

In Engineering electric signals, voltage and In Engineering electric signals, voltage and sound.sound.

In Geophysics ocean waves, earth noise in an In Geophysics ocean waves, earth noise in an area.area.

EEG and EKG tracings in Medicine.EEG and EKG tracings in Medicine. In Agriculture annual crop production prices.In Agriculture annual crop production prices.

Page 6: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

1.1 Discrete & Continuous time series

A time series is said to be discrete when observations are taken only at specific time points.

A time series is said to be continuous when observations are made continuously.

During this lecture we consider only discrete time series that is when observations are taken at equal intervals.

Page 7: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

1.2 Objectives of Time series Analysis

To understand the variability of the time series.

To identify the regular and irregular oscillations of the time series.

To describe the characteristics of the oscillations.

To understand physical processes that give rise to each of these oscillations.

Page 8: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

1.3 Components of a time series

A time series is a collection of data obtained by observing a response variable at periodic points in time. Xt is used to denote the value of the variable x at time t.

A time series is made up of one or more components of the following :

1. Trend - Measures the average change in the variable per unit time. In other words it measures the change in the mean level of the time series. Ctd…

Page 9: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

2. Seasonal variations

- Periodic variations that occur with some degree of regulations within a year or shorter.

3. Cyclical variations - Recurring up and down movement which

are extended over a long period.( usually 2

years or more) 4. Irregular variations

- Random Fluctuations which happen due to errors.

Page 10: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

These four components areThese four components are combined in the additive time combined in the additive time series model.series model.

Time series models can be classifiedTime series models can be classified into into two types:two types:

Additive model & multiplicative modelAdditive model & multiplicative modelThe four components areThe four components are combined in the additive time series combined in the additive time series

model & model & multiplicativemultiplicative model as follows; model as follows;

YYt t = T+S+C+R(additive)= T+S+C+R(additive) YYt t = T.S.C.R(multiplicative= T.S.C.R(multiplicative

Where Where YYtt is the is the actual valueactual value

T – trend or long-term movementT – trend or long-term movement S – seasonal movementS – seasonal movement C – cyclical movementC – cyclical movement R - residual or random movementR - residual or random movement (irregular variation)(irregular variation)

Page 11: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

The components of a time series are easily The components of a time series are easily Identified and explained pictorially in a time Identified and explained pictorially in a time series plotseries plot..A time series plot is a sequence plot with the time A time series plot is a sequence plot with the time series variable Yseries variable Ytt the vertical axis and time t on the vertical axis and time t on the horizontal axis.the horizontal axis.The figure 1.1 shows a trend in the time series values. The figure 1.1 shows a trend in the time series values. The trend component describes the tendency of the The trend component describes the tendency of the value of the variable to increase or decrease over a value of the variable to increase or decrease over a long period of time.long period of time.

Page 12: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Figure 1.1 :Figure 1.1 : Trend in a time series Trend in a time series

Page 13: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

A cyclical effect in a time seriesA cyclical effect in a time series as shown in the as shown in the figure 1.2 describes the fluctuation about the figure 1.2 describes the fluctuation about the trend line.trend line.

In business the fluctuations are called business In business the fluctuations are called business cycles.cycles.

figure 1.2 : cyclic variations in a time seriesfigure 1.2 : cyclic variations in a time series

Page 14: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

A seasonal variation in a series describes the fluctuations that recur during specific portions of each year ( monthly or seasonally), You can see in the figure 1.3 that the pattern of change in the time series within a year tends to be repeated from year to year producing a wavelike or oscillating curve.Figure 1.4 : seasonal variations in a time series

Page 15: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

The final component, the residual effect The final component, the residual effect is what remains after the trend, cyclical is what remains after the trend, cyclical and seasonal components have been and seasonal components have been removed. removed.

This component is not systematic and This component is not systematic and may be attributed to unpredictable may be attributed to unpredictable influences.influences.

Thus the residual effect represents the Thus the residual effect represents the random error component of a time random error component of a time series.series.

Page 16: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

• One of the objectives of time series is to One of the objectives of time series is to forecast some future values of the series.forecast some future values of the series.

• To obtain forecast some type of model that To obtain forecast some type of model that can be projected into the future must be can be projected into the future must be used to describe the time series.used to describe the time series.

• One of the most widely used models is the One of the most widely used models is the additive model.additive model.

Page 17: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Filtering( Smoothing techniques)

• A procedure to remove random variation revealing more clearly the underlying trend and cyclic components in a set of time series data, converting one time series to another by performing a linear operation for the use of forecasting.

Moving Average

- Smooth out (reduce) fluctuations and gives

trend values to a fair degree of accuracy.

- The average value of a number of adjacent time

series values is taken as the trend value for the

middle point.

Page 18: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Using linear regression technique the equation of the straight line trend can be estimated.

Exponential Smoothing

- This is a very popular scheme to produce a

smooth time series.

- weigh past observations with exponentially

decreasing weights to forecast future values.

Page 19: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Differencing

- This is the common method of filtering.

- A popular and effective method of removing trend from a

time series.

- Differencing of a time series { x } in discrete time t is the

transformation of the series {x } to a new series { x }

where the values x are the differences between

values of consecutive x .

Page 20: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Time series operators

Difference operator

- First difference operator

-Second difference operator• - Higher order difference operator

Lag operator (Backward shift operator)

-Transforms an observation of a time series to the

previous one.

Page 21: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Autocorrelation

This is the correlation(relationship) between members of a time series.

Autocorrelation coefficient at lag k is given by

Page 22: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Suppose we have a set of n values, {xt}, which represent measurements taken at different time periods, t=1,2,3,4,…n, of the closing daily price of a stock or commodity. The following Figure shows a typical stock price time series: the blue line is the closing stock price on each trading day; the red and black looped lines highlight the time series for 7 and 14 day intervals or ‘lags’, i.e. the sets {xt,xt+7,xt+14,xt+21,...} and {xt,xt+14,xt+28,xt+42,...}.

Page 23: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

Time series of stock price and volume data

Page 24: TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS

The pattern of values recorded and graphed might show that commodity prices, exhibits some regularity over time. For example, it might show that days of high commodity prices are commonly followed by another day of high commodity prices , and days of low commodity prices are also often followed by days of low commodity prices . In this case there would be a strong positive correlation between commodity prices on successive days, i.e. on days that are one step or lag apart. We could regard the set of “day 1” values as one series, {xt,1} t=1,2,3…n‑1, and set of “day 2” values as a second series {xt,2} t=2,3…n, and compute the correlation coefficient for these two series in the same manner as for the r expression above.