Library: | finance |
See also: | BlackScholesPathIndependentMDDiv BlackScholesPathIndependentMD BlackScholesPathDependend1D BlackScholesPathDependent1DQMC |
Quantlet: | BlackScholesPathIndependent1D | |
Description: | calculates the option price and its standard deviation for path independent options in the Black Scholes model by Monte Carlo simulation. |
Usage: | {z,v} = BlackScholesPathIndependent1D(s0,r,vola,dt,payoff,iterations,gennum) | |
Input: | ||
s0 | scalar, price of the underlying at time 0. | |
r | scalar, risk free interest rate 5% = 0.05 | |
vola | scalar, volatility of the log price process 20% = 0.2 | |
dt | scalar, time to maturity in years | |
payoff | string, name of the payoff function for the option product | |
iterations | scalar, number of simulations | |
gennum | scalar, number of the random source which is used in the simulation | |
Output: | ||
z | scalar, estimated option price | |
v | scalar, standard deviation of the price estimate |
library("finance") proc(v) = Put(s0) v =(s0<100) .*(100-s0) endp BlackScholesPathIndependent1D(100,0.045,0.2,1,"Put",10000,3)
The results can slightly vary with every execution of this example! Contents of _tmp.z [1,] 5.6505 Contents of _tmp.v [1,] 0.088035