Hull White Handle Function explanation
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying the execute the following the code, which is the pricing of a bermudan swaption but I am getting an error which I am not able to solve.
the error is the following :
Error using instargswaption (line 212)
Swap components of Swaptions must have the same settlement date.
Error in parseswaptionargs (line 44)
[OptSpec, Strike, ExerciseDates, Spread,...
Error in swaptionbyirtree (line 27)
[OptArgs, OptFields, SwapArgs, SwapFields, options] = parseswaptionargs(varargin);
Error in swaptionbyhw (line 91)
Price = swaptionbyirtree(HWTree, varargin{:});
Error in
@(x)SwaptionBlackPrices(relidx)-swaptionbyhw(hwtree(hwvolspec(Settle,'03-Feb-2016',x(2),'03-Feb-2016',x(1)),RateSpec,TimeSpec),'call',SwaptionStrike(relidx),EurExDatesFull(relidx),0,EurExDatesFull(relidx),EurMatFull(relidx))
Error in lsqnonlin (line 194)
initVals.F = feval(funfcn{3},xCurrent,varargin{:});
Error in BermudaSwap (line 132)
HW1Fparams = lsqnonlin(HW1Fobjfun,x0,lb,ub,options);
Caused by:
Failure in initial user-supplied objective function evaluation. LSQNONLIN cannot continue.
The code is at http://www.mathworks.com/help/fininst/examples/pricing-bermudan-swaptions-with-monte-carlo-simulation.html
I tried to analyse the handle function
HW1Fobjfun = @(x) SwaptionBlackPrices(relidx) - ...
swaptionbyhw(hwtree(hwvolspec(Settle,'03-Feb-2016',x(2),'03-Feb-2016',x(1)), RateSpec, TimeSpec), 'call', SwaptionStrike(relidx),...
EurExDatesFull(relidx), 0, EurExDatesFull(relidx), EurMatFull(relidx))
But I am having difficulties to comprehend x(2), x(1)...
Would be great if you could help me on that.
Thank you
D
2 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Financial Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!