ORIE 4630 — D. Ruppert
Homework #8 — due Friday, Oct 22, 2010
Students are required to work independently on homework.
code creates a function named
that approximates the
price of a call option by simulation and, as default values, uses 10,000,000 simulations with
a seed equal to 4360. The other inputs are deﬁned as in Section 8.17 of the textbook. The
is used to time the simulation.
returns the mean
and the standard deviation of the
simulations. The latter is useful for constructing a
conﬁdence interval for the price.
Put code here to specify the values of S, T, t, K, sigma, and r
BlackScholesSim = function(S,T,t,K,sigma,r,N=1e07,seed=4360)
Z = rnorm(N)
= S*exp(-sigma^2/2*(T-t) + sigma*sqrt(T-t)*Z) - K*exp(-r*(T-t))
Ind = as.numeric(X>0)
payoff = X*Ind
t1 = proc.time()
sim_results = BlackScholesSim(S,T,t,K,sigma,r)