Skip to content

Instantly share code, notes, and snippets.

@aussetg
Created December 23, 2013 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aussetg/8095702 to your computer and use it in GitHub Desktop.
Save aussetg/8095702 to your computer and use it in GitHub Desktop.
g <- function(Z) {
prix <- apply(grid,2,cumsum)
prix <- grid
for (i in 1:n) {
prix[i,] <- S0*exp(sigma*prix[i,]+(r-sigma^2/2)*i/n*Time)
}
prix <- colMeans(prix) - K
prix[prix<0] <- 0
return(prix)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment