- Joined
- 3/20/13
- Messages
- 14
- Points
- 11
I've tried to price an american option based on the Normal Inverse Gaussian Process using montecarlo method. But the problem is that R (the sofware i'm using) does not recognize the code of the inverse normal distribution. Could someone help me? I'm putting my Rcode.
NIG:
require(fImport)
data <- yahooSeries("AMZN", from="2013-01-15",to="2013-04-15")
S <- data[, "AMZN.Close"]
X <- returns(S)
S0 <- 142.2
K <- 120
T <- 61
alpha2 <- 0.2
beta <-0.5
delta <- 1.2
alpha <-3.2
r <- 0.003
d <- 0.002
m <- 0.01
Montecarlo:
n<- 50000
t <- rinvgauss(n,shape=delta*sqrt(alpha2^2-beta^2)),scale=delta)
N <- rnorm(n,0,1)
X <- beta*delta^2*t+N*delta*sqrt(t)
omega <- delta*(sqrt(alpha2^2-(beta+1)^2-sqrt(alpha2^2-beta^2))
S <- S0*exp(m*T+omega*T+X)
payoff <- sapply(S, function (x)max(x-K,0))
mean(payoff)*exp(-r*T)