matlab doesn't calibrate via lsqnonlin when initial values depart from the actual parameters

2 ビュー (過去 30 日間)
Hi guys,
I have written a program that calibrates two parameters from the option prices. I have simulated 10 option prices for known parameters and now try to check my calibration function.
If I set initial values of the paramters close to the actual one (the difference is not more that 0.4) then it calibrates the right parameters in 4 seconds. When I set the initial values slightly different from the initial (e.g. I set it equal to 2 when actual is 1), or when I change the upper and lower bounds and run the calibration, matlab calibration doesn't converge - it is always busy and I have to kill the process. ( I even left it for 1 night, the result was still "busy")
Please help me, changing the accuracy and number of function evaluation doesn't help!
  4 件のコメント
Matt J
Matt J 2013 年 7 月 6 日
編集済み: Matt J 2013 年 7 月 6 日
OK. Well, given it's complexity, it might be easier to help if you write the function you're trying to minimize in mathematical form, rather than code form.
For now, I'll just remark that non-differentiable operations like abs(beta) are probably "illegal", since lsqnonlin uses smooth algorithms.
Daniel
Daniel 2013 年 7 月 6 日
編集済み: Daniel 2013 年 7 月 6 日
this is the function that has two parameters beta and с (с is inside the delta)
r(u) and b(u) are constants

サインインしてコメントする。

採用された回答

Matt J
Matt J 2013 年 7 月 6 日
It sounds like you have a highly ill-conditioned problem which could be slowing convergence. The non-differentiability menationed in my Comment above might also be a factor.
Because it's only a 2-variable problem, you can probably investigate what's going on by making a surf() plot of the objective function (the squared residual) and see if it's shaped funny.
It might also help to terminate the algorithm early, using MaxIterations or similar, and seeing where it's getting stuck. Then, look for this location on the surf plot and see if the local shape of the surface is behaving oddly there.
  7 件のコメント
Matt J
Matt J 2013 年 7 月 6 日
Did you locate which line?
Daniel
Daniel 2013 年 7 月 6 日
編集済み: Daniel 2013 年 7 月 7 日
it stops here
%%%%%%%%%%%%%Default part of the option %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Def=1-exp(-integral(bfunc,0,T))*...(x^2/tau)^(1/(2*abs(beta)))*momentum(-1/(2*abs(beta)),delta,x^2/tau);
The problem is in hypergeom function, for some values of the parameters it gives NaN
That's actually very bad for the calibration, because I don't know which upper and lower bounds and initial values I should set...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by