[R-SIG-Finance] Simulating inhomogeneous Poisson process without loop

Krishna kriskumar at earthlink.net
Sun Jul 3 18:09:52 CEST 2011


A reproducible example would help, have you tried FOREACH



On Jul 3, 2011, at 7:53 AM, Tristan Linke <tristan.linke at gmail.com>  
wrote:

> Dear all
>
> I want to simulate a stochastic jump variance process in which N is
> Bernoulli (Poisson approximation) with intensity lambda0 + lambda1*Vt.
> lambda0 is constant and lambda1 can be interpreted as a regression
> coefficient on the current variance level Vt. J is the scaling factor
>
> How can I rewrite this avoiding the loop structure which is very
> time-consuming for long simulations?
>
> for (i in 1:N){
> ...
> N <- rbinom(n=1, size=1, prob=(lambda0+lambda1*Vt))
> Vt <- ... + J*N
> ..
> }
>
> P.S. This is going towards the Duffie, Pan, Singleton 2000 Transform  
> Pricing
> paper, here stochastic volatility with state-dependent correlated  
> jumps
> (Eraker 2004).
>
> Thanks a lot in advance.
>
>    [[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.



More information about the R-SIG-Finance mailing list