Hull White Tree pricing help

1 view (last 30 days)
MudraRakshasa
MudraRakshasa on 19 Dec 2014
Edited: MudraRakshasa on 19 Dec 2014
This example is taken from here:
Rates =0.075 * ones (10,1);
Compounding = 2;
StartDates = ['jan-1-2007';'jul-1-2007';'jan-1-2008';'jul-1-2008';'jan-1-2009';...
'jul-1-2009';'jan-1-2010'; 'jul-1-2010';'jan-1-2011';'jul-1-2011'];
EndDates =['jul-1-2007';'jan-1-2008';'jul-1-2008';'jan-1-2009';'jul-1-2009';...
'jan-1-2010';'jul-1-2010';'jan-1-2011';'jul-1-2011';'jan-1-2012'];
ValuationDate = 'jan-1-2007';
% define the RatesSpec
RateSpec = intenvset('Rates', Rates, 'StartDates', StartDates, 'EndDates',...
EndDates, 'Compounding', Compounding);
% use HWVolSpec to compute the interest-rate volatility
Volatility = 0.05*ones(10,1);
AlphaCurve = 0.01*ones(10,1);
AlphaDates = EndDates;
HWVolSpec = hwvolspec(ValuationDate, EndDates, Volatility, AlphaDates, AlphaCurve);
% use HWTimeSpec to specify the structure of the time layout for an HW interest-rate tree
HWTimeSpec = hwtimespec(ValuationDate, EndDates, Compounding);
% build the HW tree
HWTree = hwtree(HWVolSpec, RateSpec, HWTimeSpec);
% use the following arguments for a 1-year swap and 3-year swaption
ExerciseDates = 'jan-1-2010';
SwapSettlement = ExerciseDates;
SwapMaturity = 'jan-1-2012';
Spread = 0;
SwapReset = 2 ;
Principal = 100;
OptSpec = 'put';
Strike= 0.04;
Basis=1;
% price the swaption
PriceSwaption = swaptionbyhw(HWTree, OptSpec, Strike, ExerciseDates, ...
Spread, SwapSettlement, SwapMaturity,'SwapReset', SwapReset, ...
'Basis', Basis,'Principal', Principal)
Now how do I fix this if my point of valuation is not January 1st 2007 but December 1st 2006 or December 28th 2006 ?
Do the Timespec for building the tree have to be equally spaced? I tried to simply add the extra date to the current TimeSpec but that didn't work.
For a December 1st 2006 valuation date, I tried to construct the following time spec:
TimeSpec = hwtimespec(ValuationDate, daysadd(ValuationDate,30*(1:60),6), Compounding)
But that only worked when I changed the 'SwapReset' in swaptionbyhw from 4 to 12. Which I am not sure makes sense since these swaps reset every 3 months or 4 times a year.
Also, I don't know how to proceed if the ValuationDate was say Dec-15-2009, just 15 days prior to exercise date. Will I have to build my tree at 15 day intervals? Will my SwapReset be 24 times a year?

Answers (0)

Categories

Find more on Quadcopters and Drones in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!