library(nlmrt)
test <- nlxb(expf2, start= c(b0=.1, b1=1, th=.1), trace=TRUE, data=cl)
Thus I started with .1 1 and .1. The "solution" from nlxb, which is using analytic derivatives
and a very aggressive Marquardt code to keep trying even in bad situations, was
as you included below. Note that the singular values of the Jacobian are given (they are
recorded on the same table as the parameters, but do NOT correspond to the parameters.
The placement was simply a tidy place to put these numbers.)
The ratio of these sv's is 1.735e+16/0.004635 or approx 4E+18, so the condition number
of the traditional Gauss Newton approach is about 1E+37. Not a nice problem!
You probably should reformulate.
JN
On 16-10-10 10:41 AM, Pinglei Gao wrote:
> Thanks very much for your kindness help. I run your script then came out
> lots of outputs and I also studied the solution you posted. Forgive my
> ignorance, I still can't find the suitable starting values. Did I
> misunderstand something?
>
> Best,
>
> Pinglei Gao
>
> -----邮件原件-----
> 发件人: ProfJCNash [mailto:profj...@gmail.com]
> 发送时间: 2016年10月10日 10:41
> 收件人: Gabor Grothendieck; Pinglei Gao
> 主题: Re: [R] Finding starting values for the parameters using nls() or
> nls2()
>
> I forgot to post the "solution" found by nlmrt:
>
> nlmrt class object: x
> residual sumsquares = 1086.8 on 15 observations
> after 5001 Jacobian and 6991 function evaluations
> name coeff SE tstat pval gradient
> JSingval
> b0 5.3274e-14 NA NA NA -6.614e+13
> 1.735e+16
> b1 33.5574 NA NA NA -3.466
> 11518
> th -0.00721203 NA NA NA -740.8
> 0.004635
>
>
> Note the singular values -- this is the worst SV(max)/SV(min) ratio I've
> observed!
>
> JN
I am working on a paper about weed seeds dispersal with harvest machine. I
found three general models for seed dispersal and retention after a review
of relevant literature. All models were optimized using nonlinear least
squares via the nls function in the statistical package R. The model that
best described the data will be determined by comparing Akaike Information
Criterion (AIC) values and the model with the lowest AIC score will be
selected.
The first general model incorporated simple exponential and power
exponential functions, its starting value was easily to be found. But, I am
stuck with model 2 (which was mentioned previously) and model 3 with the
form: Retention = (b0*Area^th+1)^b1. The model 3 is totally different to
others. I tried the measures that you were mentioned. But I still can’t
find suitable starting values because of my limited knowledge. I hope you
can do me the favor again. I can send the draft to you when I finished the
paper, if it is necessary. Maybe you can give me some constructive
suggestion about statistic and model construction and I can name you as a
coauthor for your contributions.
Best,
Pinglei Gao
-----邮件原件-----
发件人: peter dalgaard [mailto:pda...@gmail.com]
发送时间: 2016年10月10日 7:41
收件人: Pinglei Gao
抄送: Andrew Robinson; R help (r-h...@r-project.org); Bert Gunter
主题: Re: [R] Finding starting values for the parameters using nls() or
nls2()
-pd
>>> + 33.04, 23.46,
Best,
Pinglei Gao
-----邮件原件-----
发件人: ProfJCNash [mailto:profj...@gmail.com]
发送时间: 2016年10月10日 10:41
收件人: Gabor Grothendieck; Pinglei Gao
主题: Re: [R] Finding starting values for the parameters using nls() or
nls2()
I forgot to post the "solution" found by nlmrt:
nlmrt class object: x
residual sumsquares = 1086.8 on 15 observations
after 5001 Jacobian and 6991 function evaluations
name coeff SE tstat pval gradient
JSingval
b0 5.3274e-14 NA NA NA -6.614e+13
1.735e+16
b1 33.5574 NA NA NA -3.466
11518
th -0.00721203 NA NA NA -740.8
0.004635
Note the singular values -- this is the worst SV(max)/SV(min) ratio I've
observed!
JN
______________________________________________
Bests,
PG
-----邮件原件-----
发件人: dave fournier [mailto:da...@otter-rsch.com]
发送时间: 2016年10月20日 5:47
收件人: r-h...@r-project.org; gaopi...@163.com
主题: Re: [R] Finding starting values for the parameters using nls() or nls2()
Actually this converges very nicely if you use these starting values that I obtained with AD Model Builder
th 9.1180e-01
b0 5.2104e+00
b1 -4.6725e-04
The R result looks like
nls.m2
Nonlinear regression model
model: Retention ~ expFct(Area, b0, b1, th)
data: structure(list(Area = c(521.5, 689.78, 1284.71, 2018.8, 2560.46, 524.91, 989.05, 1646.32, 2239.65, 2972.96, 478.54, 875.52, 1432.5, 2144.74, 2629.2), Retention = c(95.3, 87.18, 44.94, 26.36, 18.12, 84.68, 37.24, 33.04, 23.46, 9.72, 97.92, 71.44, 44.52, 24.44, 15.26)), .Names = c("Area", "Retention"), row.names = c(NA, -15L), class = "data.frame")
b0 b1 th
5.2104466 -0.0004672 0.9118029
residual sum-of-squares: 686.8
Number of iterations to convergence: 1
Achieved convergence tolerance: 1.75e-06
______________________________________________