Hull White Handle Function explanation

2 Ansichten (letzte 30 Tage)
Davin
Davin am 3 Feb. 2016
Kommentiert: Davin am 3 Feb. 2016
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 Kommentare
Walter Roberson
Walter Roberson am 3 Feb. 2016
Copyrighted code removed and linked to instead.
Davin
Davin am 3 Feb. 2016
Sorry I didn't mention that even if that the matworks copyright at the end.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Financial Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by