hw8 - ORIE 4630 D. Ruppert Homework #8 due Friday, Oct 22,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ORIE 4630 — D. Ruppert Homework #8 — due Friday, Oct 22, 2010 Note: Students are required to work independently on homework. The following R code creates a function named BlackScholesSim 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 defined as in Section 8.17 of the textbook. The function proc.time is used to time the simulation. BlackScholesSim returns the mean and the standard deviation of the N simulations. The latter is useful for constructing a confidence 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) { set.seed(seed) Z = rnorm(N) X = 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 c(mean(payoff),sd(payoff)) } t1 = proc.time() sim_results = BlackScholesSim(S,T,t,K,sigma,r) t2= proc.time() t2-t1[3] 1. Use
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

hw8 - ORIE 4630 D. Ruppert Homework #8 due Friday, Oct 22,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online