## ## Here we duplicate Figures 12.10 (gold price lattice) and 12.11 (Simplico gold mine) that consider the simplico gold mine. ## okular ../EBook/Investment_Science.djvu -p 353 & ## source('../Chapter12/utils.R') r = 0.1 ## the original example r = 0.04 ## setting for exercise 8 R = 1 + r ## one-year discount factor u = 1.2 ## the original example ##u = 1.3 ## setting for exercise 12 p_up = 0.75 d = 0.9 p_down = 0.27 ##q = 2/3 q = (R - d)/(u - d) er = 10000 ## extraction rate (ounces per year) ec = 200 ## extraction cost (per ounce) print( ( er*(1719.9 - ec) + q*16.9*1.e6 + (1-q)*12.3*1.e6 ) / R ) S0 = 400 ## current spot price ## Get the grid of gold spot prices: ## n_years = 10 SSpot = make_spot_table(S0, u, d, n_years) print('Spot gold price=') print(round(SSpot, 1)) ## Solve for the_value of the mine: ## n_steps = n_years+1 ## = number of columns = number of years + the initial spot_value n_rows = n_steps V = matrix(NA, nrow=n_rows, ncol=n_steps) for( jj in seq(n_rows, 1, -1) ){ for( ii in 1:jj ){ if( jj == n_steps ){ ## the final column/timestep V[ii, jj] = 0 }else{ pv_profit_from_mining = max( c(er * (SSpot[ii, jj] - ec)/R, 0) ) if( jj == n_steps-1 ){ V[ii, jj] = pv_profit_from_mining }else{ V[ii, jj] = pv_profit_from_mining + ( q*V[ii, jj+1] + (1-q)*V[ii+1, jj+1] )/R } } } } print(round(V/1.e6, 1))