Hull White Handle Function explanation

2 vues (au cours des 30 derniers jours)
Davin
Davin le 3 Fév 2016
Commenté : Davin le 3 Fév 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 commentaires
Walter Roberson
Walter Roberson le 3 Fév 2016
Copyrighted code removed and linked to instead.
Davin
Davin le 3 Fév 2016
Sorry I didn't mention that even if that the matworks copyright at the end.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by