小编aSp*_*guy的帖子

R 错误:参数没有起始值

非线性真实世界数据,n=2,600

SAMPLE 
X values    71.33   74.98   80  85.35   90.03
Y values    119.17  107.73  99.72   75  54.59
Run Code Online (Sandbox Code Playgroud)

我手动绘制了一个起点的公式,

formula:  y = b/x^2+a
manual:   y = 800000/x^2-39.5
sum of residuals = 185
correlation forecast to actual =0.79 
Run Code Online (Sandbox Code Playgroud)

在 R 中使用 nls 公式,我收到一条错误消息:

a_start = -39.5
b_start = 800000
m<-nls(y~b/(x^2)+a, start=list(a=a_start,b=b_start))

Error in nls(y~ b/(x^2) + a, start = list(a = a_start, b = b_start)) : 
parameters without starting value in 'data': y, x
Run Code Online (Sandbox Code Playgroud)

不确定我在这里缺少什么。

r non-linear-regression

4
推荐指数
1
解决办法
7277
查看次数

标签 统计

non-linear-regression ×1

r ×1