# How to find lead-lag relation in two time series?

12 messages
Open this post in threaded view
|

## How to find lead-lag relation in two time series?

 Any systematic way in R of doing this? Thanks a lot!
Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

 Michael Jungle wrote: > Any systematic way in R of doing this? [find lead-lag relation in two time series?] >   Lots of them. What theory of lead-lag relationships are you trying to replicate?  On what type of data? (those are important inputs to answering what tools are available))   - Brian -- Brian G. Peterson http://braverock.com/brian/Ph: 773-459-4973 IM: bgpbraverock _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

 In reply to this post by Michael Jungle One possibility is to do the cross-correlation. What series shall I apply cross-correlation to? Price or return series? If I do cross-correlation on two price series, and found some large correlation numbers, and then do cross-correlation on two return series, and found no significant numbers(almost zero), What does that mean?
Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

 In reply to this post by Michael Jungle The standard approach is to estimate a vector autoregression involving your variables of interest and then test for Granger non-causality. See the vars package and in particular the causality() function. Eric Zivot                                 Professor and Gary Waterman Distinguished Scholar       Department of Economics                                 Adjunct Professor of Finance                             Adjunct Professor of Statistics Box 353330                  email:  [hidden email] University of Washington    phone:  206-543-6715             Seattle, WA 98195-3330 www:  http://faculty.washington.edu/ezivot                  -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Jungle Sent: Friday, February 19, 2010 2:47 PM To: [hidden email] Subject: [R-SIG-Finance] How to find lead-lag relation in two time series? Any systematic way in R of doing this? Thanks a lot! -- View this message in context: http://n4.nabble.com/How-to-find-lead-lag-relation-in-two-time-series-tp1562347p1562347.html Sent from the Rmetrics mailing list archive at Nabble.com. _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

 In reply to this post by Michael Jungle You want to use returns, not prices. Correlations with prices are spurious. (The extreme example is to think of a long set of series with inflation -- all the price series will be positively correlated.) On 19/02/2010 23:15, Michael Jungle wrote: > > One possibility is to do the cross-correlation. > > What series shall I apply cross-correlation to? Price or return series? > > If I do cross-correlation on two price series, and found some large > correlation numbers, > > and then do cross-correlation on two return series, and found no significant > numbers(almost zero), > > What does that mean? -- Patrick Burns [hidden email] http://www.burns-stat.com_______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

 For lead and lags cross-correlation: cc<-ccf(mdeaths, fdeaths,lag.max=4, plot=F) cc #but this function is rather ugly... Patrick Burns a écrit : > You want to use returns, not prices. > Correlations with prices are spurious. > (The extreme example is to think of > a long set of series with inflation -- > all the price series will be positively > correlated.) > > > On 19/02/2010 23:15, Michael Jungle wrote: >> >> One possibility is to do the cross-correlation. >> >> What series shall I apply cross-correlation to? Price or return series? >> >> If I do cross-correlation on two price series, and found some large >> correlation numbers, >> >> and then do cross-correlation on two return series, and found no >> significant >> numbers(almost zero), >> >> What does that mean? > _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|

## Re: [R-SIG-Finance] How to find lead-lag relation in two time series?

 In reply to this post by Patrick Burns-2 Thx but why? I want buy/short based on price correlations right? Not returns... On Saturday, February 20, 2010, Patrick Burns-2 [via R] <[hidden email]> wrote: > > > You want to use returns, not prices. > > Correlations with prices are spurious. > > (The extreme example is to think of > > a long set of series with inflation -- > > all the price series will be positively > > correlated.) > > > > On 19/02/2010 23:15, Michael Jungle wrote: > >> > >> One possibility is to do the cross-correlation. > >> > >> What series shall I apply cross-correlation to? Price or return series? > >> > >> If I do cross-correlation on two price series, and found some large > >> correlation numbers, > >> > >> and then do cross-correlation on two return series, and found no significant > >> numbers(almost zero), > >> > >> What does that mean? > > -- > > Patrick Burns > > [hidden email]  > > http://www.burns-stat.com> > _______________________________________________ > > [hidden email]  mailing list > > https://stat.ethz.ch/mailman/listinfo/r-sig-finance> -- Subscriber-posting only. If you want to post, subscribe first. > > -- Also note that this is not the r-help list where general R questions should go. > > > > > View message @ http://n4.nabble.com/How-to-find-lead-lag-relation-in-two-time-series-tp1562347p1562668.html> > > To unsubscribe from Re: How to find lead-lag relation in two time series?, click here . > > >
Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

 Price time series will usually have a positive drift and thus are non-stationary. As far as I know most methods of time series analysis deal with stationary series and if you want to analyze a non-stationary series, you should transform  the series and obtain a stationary version of the raw data first. Return time series are usually (or at least assumed to be) stationary and thus your focus should lie on returns rather than prices.. Hth Thomas Michael Jungle schrieb: > Thx but why? I want buy/short based on price correlations right? Not returns... > > On Saturday, February 20, 2010, Patrick Burns-2 [via R] > <[hidden email]> wrote: >   >> You want to use returns, not prices. >> >> Correlations with prices are spurious. >> >> (The extreme example is to think of >> >> a long set of series with inflation -- >> >> all the price series will be positively >> >> correlated.) >> >> >> >> On 19/02/2010 23:15, Michael Jungle wrote: >> >>     >>> One possibility is to do the cross-correlation. >>>       >>> What series shall I apply cross-correlation to? Price or return series? >>>       >>> If I do cross-correlation on two price series, and found some large >>>       >>> correlation numbers, >>>       >>> and then do cross-correlation on two return series, and found no significant >>>       >>> numbers(almost zero), >>>       >>> What does that mean? >>>       >> -- >> >> Patrick Burns >> >> [hidden email]Â >> >> http://www.burns-stat.com>> >> _______________________________________________ >> >> [hidden email]Â mailing list >> >> https://stat.ethz.ch/mailman/listinfo/r-sig-finance>> -- Subscriber-posting only. If you want to post, subscribe first. >> >> -- Also note that this is not the r-help list where general R questions should go. >> >> >> >> >> View message @ http://n4.nabble.com/How-to-find-lead-lag-relation-in-two-time-series-tp1562347p1562668.html>> >> >> To unsubscribe from Re: How to find lead-lag relation in two time series?, click hereÂ < (link removed) =>. >> >> >> >>     > >   > ------------------------------------------------------------------------ > > _______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-sig-finance> -- Subscriber-posting only. If you want to post, subscribe first. > -- Also note that this is not the r-help list where general R questions should go. _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

Open this post in threaded view
|

## Re: How to find lead-lag relation in two time series?

 But we trade on prices, right? How do you trade on returns? My preliminary understanding is "whatever we trade on, we should find correlation, etc. there...". If you find lead-lag relations on returns, how do you trade them?