Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Pricing call option using Monte-Carlo Method
- #Package Utilised
- library(MASS)
- # Given parameters
- S0 = 100; # Initial Stock Price
- m = 10; # Number of stocks with dynamics under the risk neutral measure
- K = 100*m; # Strike Price
- r = 0.04; # Risk free rate
- sig = 0.15; # Standard deviation
- T = 1;
- p = 0.2; # Correlation
- N = 10000; # Number of simulations
- # Covariance Matrix
- SIG = diag(rep(1-p,10)) + matrix(p,10,10);
- # Monte Carlo simulation
- W <- mvrnorm(n = N, rep(0,10), SIG);
- SP <- (S0 * exp((r - (sig**2)/2)*T + (sig*W)));
- P_est <- rowSums(SP)
- P <- exp(-r*T)*pmax(P_est - K, 0);
- C_mc <- mean(P)
- C_mc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement