mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.44k stars 891 forks source link

Power return NaN #1030

Open engrwuang opened 10 months ago

engrwuang commented 10 months ago

I would like to raise a question. When I use Fit.Power, it returns NaN, but if I change the model to Polynomial, there is no such error. I want to know if there are any restrictions on the Power method. I analyzed the program step by step and found that NaN occurred in Power's LinearCombination. I hope to get your answer. Here is my code: double[] y = y_data.ToArray(); double[] x = x_data.ToArray(); (double,double) powerFitResult = Fit.Power(x, y); By the way, I normalized the data, will it make a difference?