Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@aussetg /g.r

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.