I'm running a nonlinear multiple regression with the nls_multstart() function with one dependent variable and three independent variables.
this is my code:
NLS.2 <- nls_multstart(micro~(a*b*rad_nee/(a+b*rad_nee))*(1+(A1*gfc)+(A2*vwc_nee)),
data = GPP.micro_2019,
iter = 10500, convergence_count = FALSE,
start_lower = c(a=-10, b=-1, A1=0, A2=-5 ),
start_upper = c(a=10, b=1, A1=7.88, A2=5 ),
lower = c(a=-10, b=-1, A1=0, A2=-5),
upper=c(a=10, b=1, A1=7.88, A2=5))
and this is the summary of the model:
Formula: micro ~ (a * b * rad_nee/(a + b * rad_nee)) * (1 + (A1 * gfc) +
(A2 * vwc_nee))
Parameters:
Estimate Std. Error t value Pr(>|t|)
a -2.417472 0.404279 -5.980 7.06e-09 ***
b -0.008043 0.001542 -5.216 3.64e-07 ***
A1 7.880000 1.159270 6.797 6.81e-11 ***
A2 -0.013911 0.002599 -5.352 1.86e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.9265 on 270 degrees of freedom
Number of iterations to convergence: 27
Achieved convergence tolerance: 1.49e-08
$isConv
[1] TRUE
$finIter
[1] 27
$finTol
[1] 1.490116e-08
$stopCode
[1] 2
$stopMessage
[1] "Relative error between `par' and the solution is at most `ptol'."
As you can see A1 took the upper boundary provided, (if I change the boundaries of the other three coefficients, a, b, A2, they take always these values, but if I change A1 boundaries it takes always the upper boundary). However it seems to works.
But when I use nls() with the coefficients resulted from nls_multstart as starting values all the coefficients become non-significant even if the fit (modelled vs measured) is good. modelled vs measured plot here the summary of the nls()
Formula: micro ~ (a * b * rad_nee/(a + b * rad_nee)) * (1 + (A1 * gfc) +
(A2 * vwc_nee))
Parameters:
Estimate Std. Error t value Pr(>|t|)
a -0.2892654 0.2720112 -1.063 0.289
b -0.0008152 0.0007737 -1.054 0.293
A1 90.6142121 86.2457023 1.051 0.294
A2 0.0568188 0.0797072 0.713 0.477
Residual standard error: 0.8128 on 270 degrees of freedom
Algorithm "port", convergence message: relative convergence (4)
Can anybody tell me what is wrong with the code or if there is a way to improve it?
below a sample of the data:
micro vwc_nee rad_nee gfc
1 -1.0833333 22.7 165.885 0.1047220
2 -0.4768519 34.9 151.359 0.0626554
3 -0.6064815 21.4 157.745 0.0790994
4 -0.3270255 19.3 159.531 0.0378047
5 -1.6215278 26.7 147.391 0.2237490
6 -0.8333333 25.9 147.482 0.1659130