Solved – Finding starting values for nls for critical exponential function

nonlinear regression

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!

Best Answer

As I have stated many times, there is a simple, general method for solving these kinds of problems. It involves using the predicted observed values as parameters in the model, i.e one reparameterizes the model in terms of the predicted observed $y$'s. Note that the original parametrization is linear in the three parameters $a$, $b$, and $c$. For the predicted $y$'s we pick Y1, Ymid, and Yn as the parameters where the Ymid is the predicted value for the largest observed $y$, that is for the sixth observation. For the first phase of the estimation we fix these parameters and maximize for r.

phase 1 fit to data

Note how the curve goes through the three y values exactly.

In the second phase we maximize over all four parameters.

phase 2 fit to data

The parameter estimates together with their estimated standard deviations are (these are the original a,b,c,and r).

           value     std dev
 r      9.8813e-01 6.2881e-03
 a     -2.8590e-01 8.6950e-01
 b     -1.9750e+00 1.6021e+00
 c      4.3028e-02 1.5931e-02
Related Question