Hull White Handle Function explanation

1 次查看(过去 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.
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 个评论
Walter Roberson
Walter Roberson 2016-2-3
Copyrighted code removed and linked to instead.
Davin
Davin 2016-2-3
Sorry I didn't mention that even if that the matworks copyright at the end.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by