How to fit a polynomial to a step function??
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 28 de Mzo. de 2019
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 comentarios
Walter Roberson
el 31 de Mzo. de 2019
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.
Ver también
Categorías
Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!