フィルターのクリア

Hull White Handle Function explanation

1 回表示 (過去 30 日間)
Davin
Davin 2016 年 2 月 3 日
コメント済み: Davin 2016 年 2 月 3 日
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 Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by