I'm trying to conduct a non-linear least squares via the nls function. The right-hand side (non-linear) function is as follows:

$-7 \ sigmoid(\theta_1 - x\beta) - 3 \ sigmoid(\theta_2 -x\beta) - 4 \ sigmoid(\theta_3-x\beta) + 7,$

where $\theta_1,\theta_2,\theta_3,\beta$ are the unknown parameters to be estimated, while $sigmoid$ denotes the logistic function: $sigmoid(z) = \frac{1}{1+e^{-z}}$.

The algorithm stops instantly, stating "singular gradient", which is seemingly caused by the $\theta$ terms, because the Jacobian function shows fully-zero columns for $\theta_2$ and $\theta_3$. I know that a similar issue has been discussed here, and there's probably an obvious non-identifiability here between the $\theta$ parameters, but I'm yet to explicitly find it. Would appreciate it if someone could point it out.

PS. I made sure to use a well-informed starting point for my parameter estimates, coming from a fit based on a sound preliminary model.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.