Skip to content

Commit

Permalink
new way to compute exponential F=expm(Adt)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mu Niu committed Mar 8, 2020
1 parent e01cf5a commit 059830a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion SolveSdeBM.r
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@

solvesdeBM<-function(A,dt,alpha,beta,rho,sigma)
{
F = as.matrix( expm(A*dt) )
#F = as.matrix( expm(A*dt) )
#F = as.matrix( expm::expm(A*dt) )

fe <- exp((-alpha)*dt)

F = diag(nai+2)
F = F*fe
F[3:(nai+2), 2] = 1 - fe
F[1,1]=1
F[2,2]=1

### Var = delta - e^At*delta*e^A't Q variance or \Xi in paper
# csigma=Pinf-F%*%Pinf%*%t(F)
Expand Down

0 comments on commit 059830a

Please sign in to comment.