[R-SIG-Finance] Geometric Brownian Motion with Jumps MLE
John-Paul Taylor
johnpaul.taylor at ryerson.ca
Fri Apr 3 14:30:33 CEST 2009
Hi,
I have been using maxLik to do some MLE of Geometric Brownian Motion Process and everything has been going fine, but know I have tried to do it with jumps. I have create a vector of jumps and then added this into my log-likelihood equation, know I am getting a message:
NA in the initial gradient
My codes is hear
#
n<-length(combinedlr)
j<-c(1,2,3,4,5,6,7,8,9,10)
gbmploglik<-function(param){
mu<-param[1]
sigma<-param[2]
lamda<-param[3]
nu<-param[4]
gama<-param[5]
logLikVal<- - n*lamda - .5*n*log(2*pi) + sum(log(sum(for(j in 1:10)(cat((lamda^j/factorial(j))*(1/((sigma^2+j*gama^2)^.5)*exp( - (combinedlr-mu-j*nu)^2/2*(sigma^2+j*gama^2))))))))
logLikVal
}
rescbj<- maxLik(gbmploglik, grad = NULL, hess = NULL, start=c(0,1,1,1,1), method = "Newton-Raphson")
summary(rescbj)
#
I am also was wondering if anyone know if there was a package that dealt with Geometric Brownian Motion Process augmented with jumps. Then I could just put that into my code and might resolve the issue.
Any suggest as to how to resolved this issue, are greatly apprecaited.
Yours truly,
JP
More information about the R-SIG-Finance
mailing list