mu = 0.1 sigma = 0.3 nu = mu - 0.5 * sigma^2 delta_t = 1/12 ## Part (a): ## n_years = 4000 n_samples = n_years * 12 ## Our random epsilons: ## eps = rnorm(n_samples) ## Create the random component in Eq.~11.20: ## Z = exp(nu * delta_t + sigma * eps * sqrt(delta_t)) S0 = 1.0 ST = cumprod(Z * S0) ## the value of S(t_{k+1}) one_over_log_S = log(ST)/(1:n_samples) ##postscript('../../WriteUp/Graphics/Chapter11/chap_11_ex_10_convergence.eps', onefile=FALSE, horizontal=FALSE) plot((1:n_samples)/12, one_over_log_S, ylim=c(0, 0.01), type='l', xlab='year') grid() ##dev.off()