简体   繁体   English

numpy曲线拟合倒数函数

[英]numpy curvefit reciprocal function

I have hardly any experience with numpy curve fitting.我几乎没有使用 numpy 曲线拟合的经验。 I can get curve fits and formulas of polynomials with degree 0 and upwards with np.polyfit() , but I seem to need a reciprocal fit of the form 1/x for this dataset and I do not know how to obtain it.我可以使用np.polyfit()获得曲线拟合和多项式的公式,次数为 0 及以上,但我似乎需要此数据集的 1/x 形式的倒数拟合,但我不知道如何获得它。 It concerns this tiny dataset:它涉及这个小数据集:

M = np.array([int(x) for x in range(0,11)])
R = np.array([28*24,9*24+8,5*24+14,96,3*24+2,2*24+13,51,44,39,35,32])

If it might be of some use, I got an OK fit for an X-shifted power equation "R = a * numpy.power((Mb), c)" with parameters a = 3.3867896329655980E+02, b = -5.0677344974815763E-01, and c = -1.0081095967950331E+00 yielding RMSE = 0.2558 and R-squared = 0.999997如果它可能有一些用处,我得到了一个 X 位移幂方程“R = a * numpy.power((Mb), c)”的合适的参数 a = 3.3867896329655980E+02, b = -5.0677344974815763E -01,并且 c = -1.0081095967950331E+00 产生 RMSE = 0.2558 和 R 平方 = 0.999997 阴谋

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM