+ All Categories
Home > Documents > PITFALLS IN TIME SERIES ANALYSIS - New York...

PITFALLS IN TIME SERIES ANALYSIS - New York...

Date post: 22-May-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
22
PITFALLS IN TIME SERIES ANALYSIS Cliff Hurvich Stern School, NYU
Transcript
Page 1: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

PITFALLS IN TIME SERIES ANALYSIS

Cliff Hurvich

Stern School, NYU

Page 2: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

The t -Test

If x 1 , . . . , xn are independent and identically dis-tributed with mean 0, andn is not too small, then

t =s ⁄ √ nx −0_ _____

has a standard normal distribution, wherex is thesample mean ands is the sample standard devia-tion. But if the true meanµ is (say) positive, thentwill typically be large, in the right tail of a standardnormal distribution. If, for example, thet -statistic is3, we would have strong evidence that the truepopulation mean is not zero. Indeed, the probabilitythat a standard normal exceed 3 is just .0013.

So by looking att -statistics, we can draw conclu-sions from the data, while controlling the error rates(false positive, false negative).

Consider a data set of monthly global temperatures(n =1632). Is the plot sloping up (global warming),or is it just an illusion?

Page 3: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

Temperatures, Northern HemisphereMonthly: 1854-1989, Seasonally Adjusted

Month

Deg

rees

C

0 500 1000 1500

-1.5

-1.0

-0.5

0.0

0.5

Page 4: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 2 -

A simple approach to this: Look at the monthlychanges in temperature and test whether thesechanges have a zero population mean. We getx = .000754 Degrees C / Month andt =0.11.

No evidence of global warming.

Another way to approach the problem: Run a sim-ple linear regression of the temperatures on a timevariable. The estimated slope isβ̂ = .000322 DegreesC / Month, and thet -statistic for the slope ist =22.2.

Now get strong evidence of global warming!

There’s something strange here, since twoapparently reasonable methods give completely dif-ferent results. What’s the problem?

Page 5: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 3 -

Regression is also used for prediction. Let’s trypredicting this month’s stock return (yt ) based onthree logged financial ratios from the previousmonth (timet −1). Data for NYSE, December 1963- December 1994 (n =385).

The t -statistics for the least-squares coefficients oflog dividend yield, log Book-to-Market ratio andlog Earnings-to-Price ratio are 3.02, 2.40 and 2.43,respectively.

So we have strong evidence of predictability ofstock returns based on past financial ratios.

Page 6: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 4 -

Now, let’s see if current stock price can bepredicted from past stock price. Consider theRussell 2000 stock index. The slope in the linearregression of today’s price on yesterday’s price isβ̂ = .994, with at -statistic oft =260.

So price is highly predictable from past prices.

Page 7: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

400300200

400

300

200

lagRussell

Rus

sell

Today's Vs. Yesterday's Russell 2000 IndexJuly 27, 2000 - Jan 22, 2003. n=615

Page 8: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 5 -

Of course, to make money, we have to predictreturns. The scatterplot indicates that returns are nottoo predictable. Linear regression of today’s returnson yesterday’s yields an estimated slope ofβ̂ = .00292 andt = .07.

No evidence of predictability of stock returns basedon past returns.

Page 9: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

0.050.00-0.05

0.05

0.00

-0.05

lagRussRet

Rus

sRet

Today's Vs. Yesterday's Russell 2000 ReturnJuly 27, 2000 - Jan 22, 2003. n=615

Page 10: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 6 -

Another useful statistical tool is correlation. Con-sider daily US and UK bond yields (n =960). ThePearson correlation between the yields is .317,which is highly statistically significant, with ap -value less than.0005.

Could also try regressing UK yield against USyield. The slope isβ̂ = .3709, t =10.33. This slopeis essentially the same as the correlation in thiscase.

The two yields seem to be significantly linked.

Page 11: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 7 -

The problem: None of our conclusions above canbe trusted, because thet -statistic does not behave inthe usual way in these situations. In time series, wecannot assume that the observations are indepen-dent! This will often affect the distribution of thet -statistic, and invalidate the usual inferences.

Plan for the rest of the talk:

• Discuss correlation

• Describe the autoregressive model for time series

• Explain why above analyses were flawed

• Discuss cointegration to measure co-movement oftwo or more series.

Page 12: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 8 -

CorrelationSupposeX and Y are two random variables, e.g.,Yesterday’s Russell and Today’s Russell. They havetheoretical meansµx andµy .

So µx =E [X ] andµy =E [Y ].

Define Variance:Var (X ) =E [(X −µx )2].

Now definecovariance . This describes howX andY move together, orcovary .

Cov (X ,Y ) =E [(X −µx )(Y −µy )].

Note thatCov (X , X ) =Var (X ).

Finally, define correlation:

Corr (X ,Y ) =√ Var (X )Var (Y )

Cov (X ,Y )_ _____________.

Page 13: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 9 -

The Autoregressive ModelLet { xt } be a time series, i.e., a sequence of randomvariables. A very useful model for{ xt } is thefirst-order autoregressive (AR(1)) model. The modelis

xt = ρxt −1+εt , −1<ρ<1

where the{ε t } are independent normal with con-stant mean (say, zero) and constant variance.

Autocorrelation describes the correlations betweenthe series and its time-lagged values. We could plotxt versusxt −1 and estimate the slope. The estimatedand true slopes represent the sample and populationautocorrelation at lag 1. We could do the samething for any lag. So we get a sample and popula-tion autocorrelationsequence , {ρ̂ r } and {ρ r } , forr =0,1,2,....

For theAR (1) model, we haveρr = ρr .

Page 14: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 10 -

The AR (1) process ismean reverting: The nextvalue is expected to be closer to the mean (zero)than the current value.

The conditional mean ofxt +1 is ρxt , and ρ <1.

The autocorrelation leads to predictability. As longas ρ≠0, the process is predictable. The best predic-tor of xt +1 is ρxt .

However, there is a downside to correlation: It typi-cally invalidates the standard methods of statisticalinference.

In the global temperatures example, the tempera-tures show autocorrelation (potentially with a trendadded). When you adequately account for the auto-correlation, thet -statistic for global warming basedon a regression on time becomest =2.44. This ismuch less than the valuet =22.2 we got earlierassuming no autocorrelation, but still providesmoderately strong evidence of global warming.

The autocorrelation also affects the variance of thesample mean, thereby invalidating the correspondingt -statistic.

Page 15: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 11 -

In the example on prediction of stock returns basedon financial ratios, it turns out that the financialratios show strong autocorrelation. If we devise anAR(1) model for the ratios, together with a regres-sion model for the stock returns, there will be acorrelation between the errors in the two models.

The net result of this is that the least-squarescoefficients will be biased (they estimate the wrongthing, on average), and thet -statistics will not bevalid.

When we correctly account for these problems, thet -statistics on the financial ratios become 1.96, 1.31and 1.25, as compared to the original (incorrect)values of 3.02, 2.40 and 2.43.

So the evidence for predictability of stock returnsbased on financial ratios is actually quite marginal,and far weaker than it seemed before.

Page 16: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 12 -

The Random WalkIn the AR (1) model, asρ approaches 1, the meanreversion becomes weaker: We get longer excur-sions from zero.

For anAR (1) model, we have

Var (xt ) =1−ρ2

Var (εt )_ ______ .

As ρ approaches 1,Var (xt ) goes to∞.

When ρ becomes exactly equal to 1, we get theRandom Walk,

xt =xt −1+εt .

The random walk is not stationary, and has aninfinite variance.

In a random walk, the expected waiting time to getback to the current value is infinite. (Extremely longexcursions!).

In a random walk starting from zero, the path ismuch more likely to spend almost all of its timeabove zero than it is to spend about 50% of its timeabove zero.

Page 17: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 13 -

Stock prices follow a random walk, as long asmarkets are efficient. If the price change werepredictable, investors would quickly figure this out,thereby removing the predictability. In an efficientmarket, the best forecast of the future price is thecurrent price, and the best forecast of the futurereturn is zero.

Since the variance of a random walk is infinite, itmakes no sense to talk about the correlationbetween stock prices (assuming that the prices fol-low a random walk, or simply assuming that priceshave an infinite variance).

Page 18: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

500400300200100

30

20

10

0

-10

Index

xtTwo independent random walks

Estimated Correlation = .53

Page 19: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 14 -

It can be shown that if we take two random walksthat are completely independent of each other, thereis a very high probability of finding a (spuriously)high correlation coefficient between them. (Thismay explain the bond yield example). This under-scores the futility of looking at correlations betweentwo price series.

The t -statistic in the regression of one independentrandom walk on the other goes to∞ as the samplesize increases. So even though there is no relation-ship between the two series, we are guaranteed todeclare (wrongly) that there is a relationship if weuse naive regression methods and the sample size islarge enough.

My two simulated independent random walks seemto move together, but it’s just an illusion. The Pear-son correlation is .53, and the estimated regressioncoefficient is .74, with at -statistic of 13.87.

All of this "structure" is spurious!

Page 20: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 15 -

Unit Root TestsThe random walk nature of prices also invalidatesthe t -statistic in the regression of current price onpast price.

To try to determine whether our price data camefrom a random walk, we can test whether the trueslope is 1. But thet -statistic for this hypothesisdoes not have an approximately standard normaldistribution, even if we really have a random walk.

Fortunately, the distribution of thist -statistic hasbeen determined (Dickey and Fuller), and tables areavailable. The result is aunit root test. In the unitroot test, we test the null hypothesis that the seriesis a random walk against the alternative hypothesisthat it is anAR (1) with ρ<1.

Note that under the alternative hypothesis, the seriesis stationary, and therefore mean reverting, whileunder the null hypothesis is it nonstationary.

Page 21: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 16 -

CointegrationSuppose we have two nonstationary series{ xt } and{ yt } , both (approximately) random walks. How dowe measure their tendency to move together? Corre-lation is meaningless here.

Both series wander all over the place, since they arenonstationary.

Instead of looking at how they wander from a par-ticular point (such as zero), let’s look at how theywander from each other. Maybe the "spread"{ yt −xt } is stationary.

Then even though both series wander all over theplace separately, they are tied to each other in thatthe spread between them is mean reverting. So wecan make bets on the reversion of this spread.

More generally, maybe there is aβ such that thelinear combination{ yt − βxt } is stationary. If so,then we say that{ xt } and { yt } arecointegrated.

Page 22: PITFALLS IN TIME SERIES ANALYSIS - New York Universitypeople.stern.nyu.edu/churvich/Forecasting/Handouts/CourantTalk2.pdfStern School, NYU. The t-Test ... makes no sense to talk about

- 17 -

A simple approach to cointegration is first to dounit root tests on{ xt } and { yt } separately. Next,estimateβ by an (ordinary) regression of{ yt } on{ xt } , and finally do a unit root test on the residuals{ yt −β̂xt } .

If the tests indicate that{ xt } and { yt } are nonsta-tionary, but{ yt −β̂xt } is stationary, then we declarethat { xt } and { yt } are cointegrated, with cointegrat-ing parameterβ̂.


Recommended