I have a dataset that contains tree height and diameter measurements among the tree stem. I tried to fit my data with GNLS in R, but I'm getting this "step halving factor reduced below minimum in NLS step" error. I think my initial values are not accurate enough. I did some research and found a platform AD Model Builder which estimates initial parameter values for nls however I did not understand how to use that platform. I have this equation called Max&Burkhart (1976) Segmented taper equation that predicts the stem diameter (di) at a given height. The code is like below:
ComputeDi.MaxBurkhart <- function(hi, d, h, b1, b2, b3, b4, a1, a2){
x <- hi / h
x1 <- x - 1
x2 <- x ^ 2 - 1
di <- d * sqrt(b1 * x1 + b2 * x2 + b3 * (a1 - x) ^ 2 * ((a1 - x) >= 0.0) + b4 * (a2 - x) ^ 2 * ((a2 - x) >= 0.0))
return(di)
}
I'm gonna put a link to my whole data set so you may want to download. Mydata
I tried to dput my dataset but it's too long for dputting.
So, how can I estimate starting values for this model. I tried fitting data with NLS and using coef of nls as starting values of gnls however I get the error that I claimed above.
AD Model Builder approach seems pretty good for finding the initial parameters but I really have no idea how to use that platform. There is a user @dave fournier who is really good at Non-Linear regression. I hope he sees my question. Thank you all in advance.
Edit: Typo