How to fit a polynomial to a step function??
5 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a noisy step from a scnner result. Is there any way to fit a higher order polynimial to step ? I am not sure which polynomial should work. Attached is the data and figure of my step.
0 件のコメント
回答 (1 件)
Walter Roberson
2019 年 3 月 28 日
No finite polynomial can possibly fit that -- not unless perhaps you swapped axes. What you have is more like a sigmoid function.
What might be acceptable is to fit it as a ratio of polynomials. If you use cftool and select Rational, and ask for numerator order 2 and denominator order 4, the fit is not terrible. (You might have to change the degree and change back again in order to get a fit that does not have singularities.)
2 件のコメント
Walter Roberson
2019 年 3 月 31 日
That status is not an error. It says that fmincon found a place it was willing to live with. It would have preferred that the difference between adjacent locations was smaller, but it has reached the minimum step size that you configured in (by default because you pass no options) and would need to take smaller steps to reduce the slope more. You can configure options to permit it to take smaller steps, but probably it would not help.
You appear to be fitting a phased gaussian. Those are notoriously difficult to fit well. When you fit with guassians, one of the common tendencies is for the fitting to push towards a narrow peak with a high phase, which is a adaptation to fit a noise spike.
参考
カテゴリ
Help Center および File Exchange で Linear and Nonlinear Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!