Marian Scott SAGES, March 2009

Slides:



Advertisements
Similar presentations
1 Statistical trends and time series a recap July 2012 Marian Scott and Adrian Bowman.
Advertisements

Time series modelling and statistical trends
Introduction to modelling extremes
Environmental change and statistical trends – some examples Marian Scott Dept of Statistics, University of Glasgow NERC August 2012.
Environmental change and statistical trends – some examples Marian Scott Dept of Statistics, University of Glasgow NERC September 2010.
Environmental change and statistical trends – some examples
Environmental change and statistical trends – some examples Marian Scott Dept of Statistics, University of Glasgow NERC September 2011.
Time Series Analysis -- An Introduction -- AMS 586 Week 2: 2/4,6/2014.
A.S. 3.8 INTERNAL 4 CREDITS Time Series. Time Series Overview Investigate Time Series Data A.S. 3.8 AS91580 Achieve Students need to tell the story of.
DSCI 5340: Predictive Modeling and Business Forecasting Spring 2013 – Dr. Nick Evangelopoulos Exam 1 review: Quizzes 1-6.
Decomposition Method.
©The McGraw-Hill Companies, Inc. 2008McGraw-Hill/Irwin Lesson 12.
Prediction from Quasi-Random Time Series Lorenza Saitta Dipartimento di Informatica Università del Piemonte Orientale Alessandria, Italy.
Part II – TIME SERIES ANALYSIS C5 ARIMA (Box-Jenkins) Models
Time Series Building 1. Model Identification
Time-Series Analysis and Forecasting – Part III
Trends and Seasonality Using Multiple Regression with Time Series Data Many time series data have a common tendency of growing over time, and therefore.
1 BIS APPLICATION MANAGEMENT INFORMATION SYSTEM Advance forecasting Forecasting by identifying patterns in the past data Chapter outline: 1.Extrapolation.
STAT 497 APPLIED TIME SERIES ANALYSIS
Moving Averages Ft(1) is average of last m observations
Chapter 5 Time Series Analysis
Data Sources The most sophisticated forecasting model will fail if it is applied to unreliable data Data should be reliable and accurate Data should be.
Chapter 13 Forecasting.
ARIMA Forecasting Lecture 7 and 8 - March 14-16, 2011
Macroeconomic Facts Chapter 3. 2 Introduction Two kinds of regularities in economic data: -Relationships between the growth components in different variables.
Part II – TIME SERIES ANALYSIS C2 Simple Time Series Methods & Moving Averages © Angel A. Juan & Carles Serrat - UPC 2007/2008.
Time Series and Forecasting
© 2003 Prentice-Hall, Inc.Chap 12-1 Business Statistics: A First Course (3 rd Edition) Chapter 12 Time-Series Forecasting.
Applied Business Forecasting and Planning
© 2002 Prentice-Hall, Inc.Chap 13-1 Statistics for Managers using Microsoft Excel 3 rd Edition Chapter 13 Time Series Analysis.
Time Series “The Art of Forecasting”. What Is Forecasting? Process of predicting a future event Underlying basis of all business decisions –Production.
The Forecast Process Dr. Mohammed Alahmed
Datta Meghe Institute of Management Studies Quantitative Techniques Unit No.:04 Unit Name: Time Series Analysis and Forecasting 1.
CLASS B.Sc.III PAPER APPLIED STATISTICS. Time Series “The Art of Forecasting”
Non-continuous Relationships If the relationship between the dependent variable and an independent variable is non-continuous a slope dummy variable can.
Temperature correction of energy consumption time series Sumit Rahman, Methodology Advisory Service, Office for National Statistics.
TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS
Business Forecasting Used to try to predict the future Uses two main methods: Qualitative – seeking opinions on which to base decision making – Consumer.
Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Intervention models Something’s happened around t = 200.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Time Series Forecasting Chapter 13.
Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 27 Time Series.
Definition of Time Series: An ordered sequence of values of a variable at equally spaced time intervals. The variable shall be time dependent.
Introductory Statistics Week 4 Lecture slides Exploring Time Series –CAST chapter 4 Relationships between Categorical Variables –Text sections.
It’s About Time Mark Otto U. S. Fish and Wildlife Service.
Chapter 6 Business and Economic Forecasting Root-mean-squared Forecast Error zUsed to determine how reliable a forecasting technique is. zE = (Y i -
Time series Decomposition Farideh Dehkordi-Vakil.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 15-1 Chapter 15 Time Series Forecasting and Index Numbers Statistics.
John G. Zhang, Ph.D. Harper College
© 1999 Prentice-Hall, Inc. Chap Chapter Topics Component Factors of the Time-Series Model Smoothing of Data Series  Moving Averages  Exponential.
Copyright © 2011 Pearson Education, Inc. Time Series Chapter 27.
Forecasting (prediction) limits Example Linear deterministic trend estimated by least-squares Note! The average of the numbers 1, 2, …, t is.
Learning Objectives Describe what forecasting is Explain time series & its components Smooth a data series –Moving average –Exponential smoothing Forecast.
1 BABS 502 Moving Averages, Decomposition and Exponential Smoothing Revised March 14, 2010.
Time-Series Forecast Models  A time series is a sequence of evenly time-spaced data points, such as daily shipments, weekly sales, or quarterly earnings.
Time Series and Forecasting Chapter 16 McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Ch16: Time Series 24 Nov 2011 BUSI275 Dr. Sean Ho HW8 due tonight Please download: 22-TheFed.xls 22-TheFed.xls.
Chapter 20 Time Series Analysis and Forecasting. Introduction Any variable that is measured over time in sequential order is called a time series. We.
Statistics for Business and Economics Module 2: Regression and time series analysis Spring 2010 Lecture 7: Time Series Analysis and Forecasting 1 Priyantha.
Chapter 15 Forecasting. Forecasting Methods n Forecasting methods can be classified as qualitative or quantitative. n Such methods are appropriate when.
Chapter 20 Time Series Analysis and Forecasting. Introduction Any variable that is measured over time in sequential order is called a time series. We.
Time Series Forecasting Trends and Seasons and Time Series Models PBS Chapters 13.1 and 13.2 © 2009 W.H. Freeman and Company.
Yandell – Econ 216 Chap 16-1 Chapter 16 Time-Series Forecasting.
What is Correlation Analysis?
BUSINESS MATHEMATICS & STATISTICS.
Chapter 6: Autoregressive Integrated Moving Average (ARIMA) Models
Statistics for Managers using Microsoft Excel 3rd Edition
“The Art of Forecasting”
CHAPTER 29: Multiple Regression*
“Measures of Trend” Dr. A. PHILIP AROKIADOSS Chapter 1 Time Series
Presentation transcript:

Marian Scott SAGES, March 2009 Time series modelling Marian Scott SAGES, March 2009

what is a time series? a time series is a sequence of measurements made over time. notationally, this would commonly be written as y1, y2,…, yi, ….yT the index i denotes the position in the sequence of observations for this early session, we will assume that the data are equally spaced-so that i is truly an index

how to plot the data a time series plot choice of the x-axis scale occasionally, each observation is indexed by its position in the sequence (OK if equally spaced) alternatively, we may use the actual timescale (e.g. if an annual series, years or a daily series, then days 1-365) or we may regard time on a continuous scale (time might be recorded in decimal form e.g. 1986.5- which would be June 1986)

How is biodiversity changing (EEA CSI 009) Populations of common and widespread farmland bird species in 2003 are only 71% of their 1980 levels. an annual indicator

Water quality- freshwater (CSI 020) Concentrations of P generally decreased Nitrate concentrations have remained constant What are the rates of change and are they significant?

Example 1- monthly mean CO2 levels

Example 2: a time series plot (daily values) the x-axis shows the actual date

Example 3- Some typical environmental series- Loch Leven (NERC-CEH)

Example 4- air quality, monitored through time (from EMEP programme) note the gaps and the rather extreme values- one strategy is to take logs

Time series data features patterns over time (both short and long term) often missing data- may cause problems for statistical analysis variation, which may not be constant over time so may need to consider transformations (log)

Seasonal patterns (cycles) in many environmental times series, we could imagine some periodicity (e.g. such as a monthly pattern in temperature) so it is common to produce a “seasonality plot” the index (x-axis scale) depends on the period over which the cycle repeats itself.

Example 1: daily observations, so the seasonal curve is plotted over days of the year

Example 2: Daily data- data are plotted over the days of the week

Example 3: Loch Leven, monthly data- data are plotted over the months of the year (Lowess smooth included)

what are the questions of interest? we want to know about trends, where a trend is defined to be: the long-term sweep of the data. we want to know about possible seasonality (or cycles) The seasonal component of a time series describes a regular fluctuation which has a period. (The period is the time interval between consecutive peaks or troughs.)

a descriptive model A useful descriptive model for a time series consists of 3 components: X = Trend + Seasonal Component + Irregular Component or X = T+S+I I is the irregular component, which is left over when the trend, and seasonal components are all accounted for. It is an irregular or random fluctuation (like residuals in regression).

smoothing a time series In many time series, the seasonal variation can be so strong that it obscures any trend or cyclical component. However, for understanding the process being observed (and forecasting future values of the series), trends and cycles are of prime importance. Smoothing is a process designed to remove seasonality so that the long-term movements in a time series can be seen more clearly

smoothing a time series one of the most commonly used smoothing techniques is moving average. difficult choice: the window over which to smooth smooth series: Yi = wkYi+k other smoothing methods (more modern) commonly used include Lowess

smoothing a time series LO(W)ESS, is a method that is known as locally weighted polynomial regression. At each point in the data set a low-degree polynomial is fit to a subset of the data, with explanatory variable values near the point whose response is being estimated. The polynomial is fit using weighted least squares, giving more weight to points near the point whose response is being estimated and less weight to points further away. Many of the details of this method, such as the degree of the polynomial model and the weights, are flexible.

Example 1: water surface temperature from Jan 1981- Feb 1992 (Piegorsch)- with lowess curve

Example 1: water surface temperature -seasonal pattern

Example 1: water surface temperature- seasonal pattern by week

Example 1: water surface temperature- variability by year

Example 1: water surface temperature-variability by month

Example 1: water surface temperature-moving average length 52

Example 2: different smoothing technique applied to air quality data (that have been logged)

harmonic regression another way of a) describing and b) hence being able to remove the periodic component is to use what is called harmonic regression remember sin and cos from school?

Yi = 0 +  sin (2[ti - ]/p) + i harmonic regression build a regression model using the sine function. sin () lies between -1 and +1, where  measured in radians. for a periodic time series Yi we can build a regression model Yi = 0 +  sin (2[ti - ]/p) + i to make this simpler, if we assume that p is known, this can be written as a simple multiple linear regression model

Yi = 0 +  sin (2[ti - ]/p) + i harmonic regression for a periodic time series Yi we can build a regression model Yi = 0 +  sin (2[ti - ]/p) + i to make this simpler, Yi = 0 + 1ci + 2si + i where ci = cos(2ti/p) and si = sin(2ti/p)

Example 2: red curve shows the harmonic pattern (superimposed on a declining trend).

correlation through time in many situations, we expect successive observations to show correlation at adjacent time points (most likely stronger the closer the time points are), strength of dependence usually depends on time separation or lag for regularly spaced data, we typically make use of the autocorrelation function (ACF)

correlation through time for regularly spaced time series, with no missing data, we define the sample mean in the usual way then the sample autocorrelation coefficient at lag k ( 0), r(k) correlation between original series and a version shifted back k time units horizontal lines show approximate 95% confidence intervals for individual coefficients.

Example 1: ACF of water temperature data

correlation through time ACF shows a very marked cyclical pattern interpretation of the ACF we need to have removed both trend and seasonality we hope that (for simplicity in subsequent modelling) that only a few correlation coefficients (at small lags) will be significant. ACF an important diagnostic tool for time series modelling (formal models ARIMA). Formal time series models …see later session on trends how should we remove the seasonal pattern or the trend?

differencing a common way of removing a simple trend (eg linear) is by differencing define a new series Zt = Yt – Yt-1 a common way of removing seasonality (if we know the period to be p), is to take pth differences Zt = Yt – Yt-p

Example 1: ACF of water temperature data

Example 1: ACF of water temperature data- difference order 12

a descriptive model A useful descriptive model for a time series consists of 3 components: X = Trend + Seasonal Component + Irregular Component or X = T+S+I I is the irregular component, which is left over when the trend and seasonal components are all accounted for. It is an irregular or random fluctuation (like residuals in regression).

simple algorithm obtain rough estimate of trend (smoothing but one not affected by seasonality): subtract estimated trend estimate seasonal cycle from detrended series what is left is the irregular component, good alternative- STL (seasonal trend lowess) decompostion (stl() command in R)

a couple of examples for you to try for monthly temperature data obtain the acf use the stl() command for dissolved oxygen in River Clyde fit a seasonal regression model In the final session on trend detection we will return to regression for time series.