0
$\begingroup$

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

$\endgroup$
2
  • 2
    $\begingroup$ Please see stats.stackexchange.com/questions/160552 for some guidance in estimating initial values. In this case, it is attractive to provide meaningful estimates for a1 and a2 and compute the other initial values by regressing the square of d1 on the variables. Note, too, that your model is overdetermined: the factor of d is superfluous (unless you believe di could be negative!). This may be the source of the trouble. $\endgroup$
    – whuber
    Apr 30, 2019 at 16:05
  • $\begingroup$ Thank you for your commnet @whuber. Before replaying your comment, I made a deep research on the link you gave. In my case, d is the diameter at breast height (1.3 m above ground) of a tree. I asked the same question on stackoverflow in here. I have another data set that contains data of 100 trees (mine is 240) and with that dataset it works like a charm. But when I replace cvs files, trouble begins. You can find my dataset in my post on stackoverflow, if you want. Thank you in advance. $\endgroup$
    – Onur Alkan
    May 2, 2019 at 19:29

0

Your Answer

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