[R-SIG-Finance] LPPL model for bubble burst forcasting

Wind windspeedo99 at gmail.com
Mon Jul 20 10:57:56 CEST 2009

Some progress.   The LPPL curve could be plotted with the following codes.
The problem now is how to get the best fit parameters.
Some researchers  use python or matlab for LPPL calibrating.     It
seems that some of them prefer tabu search for optimums locating.   It
seems that there's still no general function for tabu search in R.
At the end of codes, I give the possible parameter combinations to be
searched in, maybe there are other functions for optimum searching in
Any suggestion would be appreciated.

## Financial Bubbles, Real Estate bubbles, Derivative Bubbles, and the
Financial and Economic Crisis
## http://arxiv.org/abs/0905.0220
## Fig. 23 S&P500 index (in logarithmic scale)in  Page 39


	#function in page 26 of http://arxiv.org/abs/0905.0220
	#the basic form of LPPL

	f<-lm(log(p) ~ x1+x2)

	#derived function for optim

	#x axis for predicting

#get the SP500 index


#something like the Fig. 23 in  Page 39 of http://arxiv.org/abs/0905.0220
#but obviously the result is not calibrated well
#using optim like this can not calibrate the LPPL model

##crash point after dtc days

##appropraite range of the parametes of LPPL
##according to Dr. W.X. Zhou's new book which is in Chinese
##the increments of the sequences are added according to my own judement

##millions possible combinations
#complete test would be difficult

##methods for minimum sigma searching within the parameter combinations
##not implemented yet


On Thu, Jul 16, 2009 at 9:25 PM, Brian G. Peterson<brian at braverock.com> wrote:
> So first, using your real name and ideally your professional identity, ask
> for the python code.  Better yet, get an academic buddy to do it. Usually
> getting access to the code isn't too tough.  Mention things like "repeatable
> research" and "collaboration" in your email.  Two of the authors publish
> their email addresses in one of the papers you reference, so contacting them
> should be easy.
> Next port the python code to R.
> If you can't do that, then replicate the model in R "from scratch".  A
> trivial scan of the paper in question lends several techniques that are well
> covered in R: AR, GARCH, power laws, linear regression, stochastic discount
> factor, Ornstein-Uhlenbeck, etc.
> There are volumes of information available on these topics from within R, in
> numerous books, and in the archives of this mailing list and r-help.
> You're going to have to do your replication in pieces, probably starting
> with their implementation of the log periodic power law (LPPL), for which I
> do not believe there is an existing direct analogue in R though all the
> component parts necessary to replicate it should be readily available.
> As you work on each step of the replication, share your code with this list
> and the problems you are having with a particular step.  Ask specific,
> directed questions with code to back them up.  Someone will likely help you
> solve the specific problem.
> In R generally, it is not necessary that you be able to *do* the math (think
> pencil and paper), but if you plan to replicate published work, it will be
> necessary to *understand* at least some of how the math works, and to be
> able to pick out the names of techniques that you can search for an utilize.
> Basically, I'm recommending that you (specifically) and others (more
> generally) should share the process of replicating a technique like this, as
> well as the final product, to give all the rest of us who are likely to be
> helping "you" get all this done. quid pro quo.
> Cheers,
>  - Brian
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
> Wind wrote:
>> Prof. Sornette has spent years forcasting bubble burst with
>> "log-periodic power law".    The latest paper  gives "a
>> self-consistent model for explosive financial bubbles, which combines
>> a mean-reverting volatility process and a stochastic conditional
>> return which reflects nonlinear positive feedbacks and continuous
>> updates of the investors' beliefs and sentiments."
>> And his  latest  predicting is the burst of Chinese equity bubble at
>> the end of July.     http://arxiv.org/abs/0907.1827
>> While waiting to see the result, I wonder whether it is possible to
>> replicate the forcast with R.  The model is in the page 10 of the "A
>> Consistent Model of `Explosive' Financial Bubbles With Mean-Reversing
>> Residuals",  http://arxiv.org/abs/0905.0128  .   The output chart is
>> in the page 3 of "The Chinese Equity Bubble: Ready to Burst",
>> http://arxiv.org/abs/0907.1827 .   I guess the authors of the latter
>> paper use the same model as described in the first paper.
>> Because statistics is still challenging for me though I could use R
>> for  basic data manipulations,  I wonder which package or function
>> would be necessary to implement the model in the paper.  The model
>> seems more complicated than the models in the R tutorials for me.
>> By the way, the author of the paper used Python and the codes are
>> private.
>> Any suggestion would be highly appreciated.

More information about the R-SIG-Finance mailing list