I'm trying to fit a critical exponential function using nls
. The function is of the form $y = a+ (b + cx)r^x$ and has a single maximum/minimum, a single inflection point and an asymptote.
I can sort of estimate starting values for the parameters from the data (eg the asymptote), and this works some of the times, but I'd like a more rigorous method to estimating the parameters prior to using nls
.
I found a suggestion here, which uses expected-value parameters to estimate the parameters for an exponential curve. I tried to do something similar, but the extra parameter makes things complicated.
I also found a reparameterisation of the function which removes the c
parameter by using expected-value parameter
$$
y=[b(1-x/x_1)+(x/x_1)(y_1-a)/r^{x_1}]r^x+a
$$
where y1
corresponds to $x=x_1$, but I can't figure out how to estimate the remaining parameters.
Any suggestions as to how to approach this would be appreciated!
Some test data:
xvals=c(30.0, 46.0, 62.0, 78.0, 94.0, 110.0, 126.0, 142.0, 158.0, 174.0, 190.0, 206.0, 222.0, 238.0, 254.0)
yvals=c(-0.42286827, -0.6666351, -0.38212553, 0.10617201, 0.88309403, 0.97816225, 0.7471844, 0.3668751, 0.09183945, 0.11818037, 0.18587128, 0.22363502, 0.32338324, 0.27689159, 0.32192359)
Thanks!