Calculates European exchange option for risky bond vs. Risk free bond 2D tree is based on Schonbucher's book "Credit derivative pricing models" section 7.4. 1D tree is based on method as described in appendix for Brigo's "Interest rate models"
Following inputs are needed: 1.Term structure of risk free rates as piecewise flat forward indexed by 6 months 2.Market Cap volatilties indexed by 6 months 3.Term structure of piecewise flat forward indexed by 6 months which is obtained for risky bonds 4.Model parameters for default risk hull white process. 5.Correlation of default risk vs. risk free rate. 6.Exchange option data
Outputs are : 1.Hull white model parameters for risk free rate process. 2.Exchange option price calculated using 2D trinomial tree
"Regress later" is a monte carlo method suggested by Glasserman and Yu. It is different from Longstaff and Schwartz method that the regession takes place one time step ahead. To do this the authors suggest use basis functions in regression which are martingales.
Assume: N : no of simulations M : no of time steps
Algorithm: 1.Initialize N x M stock prices grid with stock price evolution using GBM dynamics.
2.Create these N x M matrices CC : stores continuation values CE : store immediate exercise values EF : Stores exercise flag
3.Initialize last column of CE,CE,EF using option payoff
4.Start Iterating for each time step backwards
4a.Create a matrix of regression independent variables using basis functions 1, X, X^2 and set X=stock price at the node stepof the next time Note : pick only those points which have a positive immediate exercise value. rest of the nodes with 0 or negative payoff are ignored for regresion input
4b.Set input dependent/ observations vector to immediate exercise values of the next time step
4c.Perform Ordinary Least sqaures to get parameters for coeffcients of basis functions. It is basically a regression of stock variables at the next time step to option values at the next timestep. Since both the independent and dependent variables are taken at same timestep, the values for comparision using these regression parameters do not need to get discounted.
4d.Now compute continuation values at this node using the parameter values obtained from 4c.Note that Longstaff method comapres discounted contunation value from next step to current immediate exercise value. While Glasserman compares regressed values whose parameters were basically computed using stock variables and option values at the next step.
4e.Compare continuation values obtained from regression in 4d vis-a-vis the immediate exercise values
4f.If immediate exercise value is more than regressed continuation value, choose to exercise and Populate EF matrix flag at the node.
4g.Populate continuation value : If exercise flag at node is set then set it to immediate exercise value else set it to discounted value of continuation value at next timestep
4h.Repeat 4a until simualtions are done
5.Observe the EF matrix and think that actual exercise decision was made when EF flag=1. Accordingly calculate expected payoff by averaging. This gives the MC option price
NOTE: I have tried comparing results to following run from Quantlib: Option type = Put Maturity = May 17th, 1999 Underlying price = 36 Strike = 40 Risk-free interest rate = 6.000000 % Dividend yield = 0.000000 % Volatility = 20.000000 %
Using same input parameters in excel file and timesteps=100 and simualtions=10000, I am getting price around 4.47
To get an idea of the underlying process, there is an additional option of dumping the matrices of stock prices,continuaiton values,exercise flags and immediate exercise values at each node. To enable this option, tiemsteps and simulations should be less than 100
Calculates American put option price using Brennan Schwartz method, using Implicit finite difference scheme. While doing rollback of option price vector in the finite difference grid, option values are calculated at each timestep as if there is no constraints. Then after getting the vector, constraint condition is satisfied by taking max values. Note that this is only first order accurate and convergence is slower than penalty method.
It calculates price of American put option.Input parameters are option and finite difference grid specifications and tolernance parameter required for penalty algorithm.
Iterations are continued until formula (4.20) is satisfied
Longstaff and Schwartz (1992) had devised a method to value American options using Monte carlo simulation. This spreadhsheet implements valuation of a call/put option of american exercise type. (Increasing the no of timesteps tend to approach american price)
Assume: N : no of simulations M : no of time steps
Algorithm: 1.Initialize N x M stock prices grid with stock price evolution using GBM dynamics.
2.Create these N x M matrices CC : stores continuation values CE : store immediate exercise values EF : Stores exercise flag
3.Initialize last column of CE,CE,EF using option payoff
4.Start Iterating for each time step backwards
4a.Create a matrix of regression independent variables using basis functions 1, X, X^2 and set X=stock price at the node. Note : Logstaff recommends to pick only those points which have a positive immediate exercise value. rest of the nodes with 0 or negative payoff are ignored for regresion input
4b.Set input dependent/ observations vector to immediate exercise values
4c.Perform Ordinary Least sqaures to get parameters for coeffcients of basis functions. It is basically a regression of stock variables at the current time step to cotinuation values at the next timestep.
4d.Now compute back continuation values using the parameter values obtained from 4c.
4e.Compare continuation values obtained from regression vis-a-vis the immediate exercise values
4f.If immediate exercise value is more than regressed continuation value, choose to exercise and Populate EF matrix flag at the node.
4g.Populate continuation value : If exercise flag at node is set then set it to immediate exercise value else set it to discounted value of continuation value at next timestep
4h.Repeat 4a until simualtions are done
5.Observe the EF matrix and think that actual exercise decision was made when EF flag=1. Accordingly calculate expected payoff by averaging. This gives the MC option price
NOTE: I have tried comparing results to following run from Quantlib: Option type = Put Maturity = May 17th, 1999 Underlying price = 36 Strike = 40 Risk-free interest rate = 6.000000 % Dividend yield = 0.000000 % Volatility = 20.000000 %
Using same input parameters in excel file and timesteps=100 and simualtions=10000, I am getting price around 4.50
To get an idea of the underlying process, there is an additional option of dumping the matrices of stock prices,continuaiton values,exercise flags and immediate exercise values at each node. To enable this option, tiemsteps and simulations should be less than 100