[R-SIG-Finance] Implementation of Lee Strazicich Unit Root Test for R - Optimization
johannes.lips at gmail.com
Mon Jul 13 07:58:26 CEST 2015
On 11.07.2015 17:35, Joshua Ulrich wrote:
> On Fri, Jul 10, 2015 at 5:01 AM, Johannes Lips <johannes.lips at gmail.com> wrote:
>> Dear list,
>> I have implemented the test from Lee and Strazichich (2003, 2004) in R and
>> uploaded it to github. 
>> The advantage of this test is, that it endogenously determines the dates of
>> up to two possible structural breaks and
>> it includes these structural breaks under the null and also the alternative
>> I also implemented a General-to-Specific Approach to determine the number of
>> lagged augmented terms to include in the test equation.
>> At the moment it's not very efficient in regard to computing time, so I
>> would be glad if someone could point out improvements to make the code
>> faster and more efficient.
> If you provide an example I can run, I can profile it to look for
> bottlenecks. From a quick look at the code, one thing that should
> help a fair amount is to avoid calls to lm() and call lm.fit()
Thanks for your reply. For preliminary testing I often used a generated
time series, which only has a break in the intercept at t=75.
After reading the csv file the test can be applied to the time series.
y <- read.csv("y.csv", col.names= c("t","y"))[,2]
ur.ls(y=y , model = "crash", breaks = 1, lags = NULL, method = "GTOS",pi
= 0.1 )
The test call only looks for one break, but uses the general-to-specific
approach, which is also quite time-consuming.
I will look into lm.fit() today and will try to implement it.
Thanks a lot for your suggestion!
>> Thanks in advance!
>> Best regards,
>> Johannes Lips
>>  https://github.com/hannes101/LeeStrazicichUnitRoot
>> Lee, Junsoo and Mark C. Strazicich (2003). “Minimum Lagrange Multiplier Unit
>> Root Test with Two Structural Breaks”. In: The Review of Economics and
>> Statistics 85.4, pp. 1082–1089.
>> Lee, Junsoo and Mark C. Strazicich (2004). “Minimum LM Unit Root Test with
>> One Structural Break”. In: 04-17. url:
>> https://ideas.repec.org/p/apl/wpaper/04-17.html (visited on 02/04/2015).
>> R-SIG-Finance at r-project.org mailing list
>> -- 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3483 bytes
Desc: not available
More information about the R-SIG-Finance