ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II Time Series A time series is a collection of data obtained by observing a response variable at various times. Examples The monthly Case-Shiller house price index; Yearly average global temperature; Daily Facebook stock price. Goals of time series analysis include: forecasting, such as Case-Shiller; measuring and understanding trends, such as in global temperature. 1 / 1 Time series What is a Time Series?
ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II Time Series Components Some find it helpful to think of a time series as a sum of components : Secular trend : a linear or other polynomial curve; Cyclical effect : variations around the secular trend, caused for example by business cycles or decadal climate variations; Seasonal variation : fluctuations that recur at known points in a cycle, such as monthly effects in the annual cycle, hourly effects in the daily cycle, weekday effects. Residual effect : random, unpredictable. 2 / 1 Time series What is a Time Series?
ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II Additive model: y t = T t + C t + S t + R t . Multiplicative model: y t = T t × C t × S t × R t . We could forecast each part, and combine them to forecast y t . Problem: no unique way to decompose y t into these four parts. 3 / 1 Time series What is a Time Series?
ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II Forecasting by Smoothing In many areas of business, time series such as demand and sales are forecast using ad hoc methods such as moving averages and exponential smoothing. The quality of a forecasting method is described using various definitions of error, such as MAPE: mean absolute percentage error. Several methods were proposed by Holt and Winters. 4 / 1 Time series What is a Time Series?
ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II The R package forecast implements some Holt-Winters methods: powload <- read.table("Text/Exercises&Examples/POWERLOADS.txt", header = TRUE) plot(powload$LOAD, type = "l") library(forecast) summary(holt(powload$LOAD)) 5 / 1 Time series What is a Time Series?
ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II Forecasting by Regression Extrapolating a linear trend: sales <- read.table("Text/Exercises&Examples/SALES35.txt", header = TRUE) with(sales, plot(T, SALES, xlim = c(0, 40), ylim = c(0, 200))) l <- lm(SALES ~ T, sales) summary(l) curve(predict(l, data.frame(T = x)), add = TRUE, lty = 2) # forecast next 5 values: newTimes <- 36:40 p <- predict(l, data.frame(T = newTimes), interval = "prediction") matlines(newTimes, p, col = c("red", "blue", "blue"), lty = c(2, 3, 3)) 6 / 1 Time series What is a Time Series?
ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II Indicator variables for seasonal effects: qp <- read.table("Text/Exercises&Examples/QTRPOWER.txt", header = TRUE) qp$load <- as.numeric(levels(qp$POWLOAD))[qp$POWLOAD] with(qp, plot(T, load, xlim = c(0, 20), ylim = c(90, 200))) l <- (lm(load ~ T + factor((T - 1) %% 4), qp)) summary(l) lines(qp$T[1:16], fitted(l), lty = 2) newTimes <- 17:20 p <- predict(l, data.frame(T = newTimes), interval = "prediction") matlines(newTimes, p, col = c("red", "blue", "blue"), lty = c(2, 3, 3)) 7 / 1 Time series What is a Time Series?
ST 430/514 Introduction to Regression Analysis/Statistics for Management and the Social Sciences II Issues with regression-based forecasts Forecasting involves extrapolation , and depends on continued validity of the fitted model. Less of an issue if we limit forecasts to the short term . The errors in time series regressions are often correlated with each other, which violates the usual assumptions. In particular, we cannot trust reported standard errors and P -values. But using time series models, we can exploit the correlation to improve forecasts. 8 / 1 Time series What is a Time Series?
Recommend
More recommend