nls troubles: Missing value or an infinity produced when evaluating the model

后端 未结 3 1488
别跟我提以往
别跟我提以往 2020-12-17 17:59

I am an R newbie trying to fit plant photosynthetic light response curves (saturating, curvilinear) to a particular model accepted by experts. The goal is to get estimated c

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 18:54

    minpack.lm to the rescue:

    library(minpack.lm)
    curve.nlslrc = nlsLM(photolrc ~ Am*(1-((1-(Rd/Am))^(1-(PARlrc/LCP)))),
                       start=list(Am=(max(photolrc)-min(photolrc)),
                                  Rd=-min(photolrc),
                                  LCP= (max(photolrc)-1)),
                       data = curvelrc)
    coef(curve.nlslrc)
      #      Am         Rd        LCP 
      #8.011311   1.087484 -20.752957
    
    plot(photolrc ~ PARlrc, data = curvelrc)
    lines(0:1300, 
          predict(curve.nlslrc, 
                  newdata = data.frame(PARlrc = 0:1300)))
    

    If you pass start = list(Am = 8, Rd = 1, LCP = -20) to nls you also get a successful fit.

    I don't know if the parameter values are sensible estimates considering the science behind this. Can LCP be negative?

提交回复
热议问题