[R-SIG-Finance] Artificial price series

Worik worik.stanton at gmail.com
Wed Apr 13 01:02:01 CEST 2011


On 13/04/11 07:40, Mark Leeds wrote:
> Hi Horace: I'm actually not looking for anything. Someone sent in a question
> asking for a way
> of simulating a stock price series in a realistic way. So, some people said
> take a stock series
> and bootstrap it. My suggestion was totally different but depending on the
> goal in mind,
> could possibly be realistic enough ? I don't have any more details but
> that's why I sent it.
This is all very good, thanks people.

The bootstrapping idea I should have thought of.   Intriguing idea.

The Brownian motion code is better than the code I had - I have not 
looked closely at the differences yet, but it gave me what I need.

The Jump Diffusion process I'll leave for another day.  I did not need 
data too realistic.

cheers
Worik

>
>
> On Tue, Apr 12, 2011 at 3:32 PM, Horace Tso<Horace.Tso at pgn.com>  wrote:
>
>>   Mark, not sure what you're looking for. Simulating a compound Poisson or
>> a Cauchy process is not hard. I'm aware of EMJumpDiffusion to fit and
>> simulate these sort of things. I'm sure other R packages could do similar
>> simulation, too.
>>
>> H
>>
>>   ------------------------------
>> *From:* Mark Leeds [mailto:markleeds2 at gmail.com]
>> *Sent:* Tuesday, April 12, 2011 12:09 PM
>> *To:* Horace Tso
>> *Cc:* Mark Breman; r-sig-finance at stat.math.ethz.ch; David St John
>>
>> *Subject:* Re: [R-SIG-Finance] Artificial price series
>>
>> Thanks Horace. That type of thing might be in the book too ? I don't know.
>> I just glanced and saw that one method. but your'e right. and , if anyone
>> knew exactly, they probably wouldn't say anyway !!!!!!
>>
>>
>> Mark
>>
>>
>> On Tue, Apr 12, 2011 at 3:02 PM, Horace Tso<Horace.Tso at pgn.com>  wrote:
>>
>>> Mark, except in some rare instances, evidence is clear that financial
>>> prices are anything but brownian motion. And i think that's the reason Worik
>>> notices in some qualitative way random walk simulation appears unreal. One
>>> of the key differences is real price series have jumps. All these recent
>>> papers by Ait-Sahalia (2010, 2009, 2008, 2004) and others have shown one is
>>> better off with a semimartingale model with some compound Poisson process.
>>>
>>> In fact, the guy is arguing whether brownian motion is even necessary to
>>> model high frequency data (Annals of Statistics 2010, Vol. 38, No. 5,
>>> 3093-3128).
>>>
>>> H
>>>
>>>
>>> -----Original Message-----
>>> From: r-sig-finance-bounces at r-project.org [mailto:
>>> r-sig-finance-bounces at r-project.org] On Behalf Of Mark Leeds
>>> Sent: Tuesday, April 12, 2011 11:05 AM
>>> To: Mark Breman
>>> Cc: r-sig-finance at stat.math.ethz.ch; David St John
>>> Subject: Re: [R-SIG-Finance] Artificial price series
>>>
>>> Hi: if you can assume that returns follow brownian motion, then, in his
>>> book
>>> Simulation and Infernce for Stochastic Differential equations  on pg 26,
>>> Stefano Iacus shows how to generate the  trajectory of the stock price of
>>> S_N starting at S_0 and using increments of deltaT.  The code below is
>>> from
>>> the book directory of his sde package and is labelled ex1.10.R. If you
>>> don't
>>> have his book, the explanation for below is also in Hull and any other
>>> decent derivatives text.
>>>
>>>
>>> #==============================================================================
>>>
>>> set.seed(123)
>>> r<- 1
>>> sigma<- 0.5
>>> x<- 10
>>> N<- 100   # number of end points of the grid including T
>>> T<- 1 # length of the interval [0,T] in time units
>>> Delta<- T/N # time increment
>>> W<- numeric(N+1) # initialization of the vector W
>>> t<- seq(0,T, length=N+1)
>>> for(i in 2:(N+1))
>>>         W[i]<- W[i-1] + rnorm(1) * sqrt(Delta)
>>> S<- x * exp((r-sigma^2/2)*t + sigma*W)
>>> plot(t,S,type="l",main="geometric Brownian motion")
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Apr 12, 2011 at 1:28 PM, Mark Breman<breman.mark at gmail.com>
>>> wrote:
>>>
>>>> Hi David,
>>>>
>>>> That's what i like so much about following this list: you regularly read
>>>> about things you never knew existed!
>>>> This package looks great David.
>>>>
>>>> -Mark-
>>>>
>>>> 2011/4/12 David St John<dstjohn at math.uic.edu>
>>>>
>>>>> Make sure to use bootstrap() for returns data and generateSample() for
>>>>> price
>>>>> data.  bootstrap() only makes sense for a stationary series.  The
>>>>> stationarity assumptions make it desirable to sample from the returns.
>>>>> generateSample() creates returns from prices, bootstraps them, then
>>>>> calculates the random prices from the bootstrapped returns.
>>>>> -David
>>>>>
>>>>>         [[alternative HTML version deleted]]
>>>>>
>>>>> _______________________________________________
>>>>> R-SIG-Finance at r-project.org 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.
>>>>>
>>>>         [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> R-SIG-Finance at r-project.org 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.
>>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-SIG-Finance at r-project.org 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.
>>>
>>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org 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.
>


-- 
If we amplify everything, we hear nothing.
--



More information about the R-SIG-Finance mailing list