フィルターのクリア

Is numeric gradient estimation well-posed

3 ビュー (過去 30 日間)
Henrik Dam
Henrik Dam 2015 年 3 月 4 日
コメント済み: Chris McComb 2015 年 3 月 4 日
Dear matlabcentral,
I'm working on my thesis in mathematical finance. As a small part of it I am to numerically find a gradient of a function which is pretty demanding to evaluate (involving Fourier inversion and afterwards ordinary inversion of a highly non-linear function, it evaluates pretty fast though). Can I expect accurate results? Can you recommend a function or implementation which generally does a good job? Any package and version can be assumed attainable.
I have done some Matlab programming, but I am probably a novice compared to you guys. I have never formally studied these kind of problems (numerical analysis?), so I have no idea of the well-posedness of numerical differentiation.

回答 (1 件)

Chris McComb
Chris McComb 2015 年 3 月 4 日
It will depend a great deal on the characteristics of your function. If your function is smooth, then you can generally expect good results with numerical differentiation. However, if your function is noisy or discontinuous numerical differentiation becomes more troublesome.
When first implementing any method for finding the gradient, it may be a good idea to plot the original function in the same axes as the slope, to ensure that it is providing a good estimate.
As a starting point, I'd recommend MATLAB's gradient function.
  2 件のコメント
Henrik Dam
Henrik Dam 2015 年 3 月 4 日
Hi! Thanks. Theoretically it should be a smooth function. It will be of many variables though, would you suggest plotting one or two variables at a time holding the other variables fixed? What would be an upgrade compared to the gradient function?
Chris McComb
Chris McComb 2015 年 3 月 4 日
Yes, I'd suggest plotting one variable at a time to check that the computed gradient matches the function. This will also allow to build up a gradient vector one element at a time.
Since your function is smooth, MATLAB's gradient() should work well (you can decrease the distance between adjacent points to increase accuracy). If you want something else you'll probably have to code it yourself. This is a pretty good reference.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by