EM-JumpDiffusion-package {EMJumpDiffusion} | R Documentation |
Calculates parameters for jump diffusion processes via EM-algorithm. The jumps-times are considered to be Bernoulli distributed (jump probability lambda) with normally distributed jump-sizes (mean mu_d and variance sigma_d). The diffusion process uses drift mu and volatility sigmad. Is S_t a given set of stock price data, then it's log-returns are considered to follow the distribution:
log(S_t/S_(t-1))~(1-lambda) N(mu-sigma/2,sigma^2)+lambda N(mu-sigma/2+mu_d,sigma^2+sigma_d^2)
.
Package: | EM-JumpDiffusion |
Type: | Package |
Version: | 1.4.1 |
Date: | 2009-05-05 |
License: | GPL (version 2 or later) |
Use simulate
to create log-returns or use real data.
Use EMjump
to calculate to optimize parameters of the jump diffusion process.
The Viterbi-algorithm viterbi
will calculate the most probable jump-times, given a set of log-returns.
When using simulated data, scores
can compare the original path of jumps with the calculated path of viterbi
.
Matthias Graser, <matthias.graser@gmx.de>
Matthias Graser (2009). Expectation-Maximization-Algorithmus fuer Sprung-Diffusionsmodelle. Diploma thesis, Stuttgart.
Rama Cont, Peter Tankov (2003). Financial modelling with Jump Processes. Chapman & Hall / CRC Press.
Olivier Cappe, Eric Moulines, Tobias Ryden (2005). Interference in Hidden Markov Models. Springer Series in Statistics.
## Will use every function in this package ## Data simulation theta <- c(0.2, 0.1, 0.05, -0.5, 0.7) X <- simulate(theta, 30) # simulates 30 log-returns and uses function rbern plot(X[,1],type="h",main="log returns",xlab="time",ylab="value") start<-c(0.3, -0.1, 0.1, 0.3, 1) # starting vector ## Parameter calculation calc <- EMjump(start, X[,1]) ## Viterbi-algorithm calculation calcpath <- viterbi(calc, X[,1]) ## Comparison of original path with calculated path scores(X[,2],calcpath)