首页 > 解决方案 > 运行非线性回归模型时如何纠正此错误?

问题描述

两项研究 的高度(合并年份)随时间变化 旱地平均高度(avgheight)随时间变化(adjdap)

我正在尝试为遵循 sigmoidal 模式的增长曲线运行非线性模型,但我的一项研究遇到了一些问题。

这个特定的数据集是针对植物高度的,我正在尝试对两个生长季节的植物高度进行建模。我有这个模型,我一直在为每个新数据集进行调整,但它在我的其他生物量产量数据中运行正常。对于我的灌溉研究高度数据,它也可以正常运行。我的旱地研究模型只收到此错误。这是我的数据的一瞥:

Rows: 1,459
Columns: 17
$ ActDOY     <dttm> 2019-09-23, 2019-09-23, 2019-09-23, 2019-0~
$ DOY        <dbl> 265, 265, 265, 265, 265, 265, 265, 265, 265~
$ CDOY       <dbl> 242, 242, 242, 242, 242, 242, 242, 242, 242~
$ Date       <chr> "09/21", "09/21", "09/21", "09/21", "09/21"~
$ Year       <dbl> 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2~
$ avgheight  <dbl> 112.33333, 111.33333, 108.66667, 102.33333,~
$ Field      <chr> "F6", "F6", "F6", "F6", "F6", "F6", "F6", "~
$ Plot       <dbl> 101, 102, 112, 203, 210, 212, 301, 305, 307~
$ treatment  <dbl> 103, 103, 103, 103, 103, 103, 103, 103, 103~
$ heights    <dbl> 10.8, 15.2, 6.4, 10.8, 6.4, 15.2, 6.4, 15.2~
$ height     <chr> "medium", "high", "low", "medium", "low", "~
$ Block      <chr> "1", "1", "1", "2", "2", "2", "3", "3", "3"~
$ dap        <dbl> 80, 80, 80, 80, 80, 80, 80, 80, 80, 74, 74,~
$ irrigation <chr> "Irrigated", "Irrigated", "Irrigated", "Irr~
$ PD         <dttm> 2019-06-07, 2019-06-07, 2019-06-07, 2019-0~
$ ADAP       <dbl> 108, 108, 108, 108, 108, 108, 108, 108, 108~
$ AdjDAP     <dbl> 85, 85, 85, 85, 85, 85, 85, 85, 85, 75, 75,~

这是我目前的模型:

```{r}
metadrm(avgheight ~ AdjDAP,
      data = sunnHempht.dat %>% filter(irrigation == "Dryland"),
      fct = LL.3(),
      ind = Year,
      struct = "UN") ->  dry.metadrm
dry.start <- coef(dry.metadrm)

medrm(avgheight ~ AdjDAP, 
      data = sunnHempht.dat %>% filter(irrigation == "Dryland"),
      random = b + d + e ~ 1 | Year,
      fct = LL.3(),
      start = dry.start) ->  dry.medrm
dry.parms <- fixef(summary(dry.medrm))
summary(dry.medrm)
```

以下是导致的错误和警告:

Error in solve.default(pdMatrix(a, factor = TRUE)) : 
system is computationally singular: reciprocal condition number = 2.66326e-74
In addition: Warning message:
In nlme.formula(avgheight ~ meLL.3(AdjDAP, b, d, e), fixed = b +  :
  Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!

任何帮助将不胜感激我能做些什么来让它运行!谢谢!

标签: rnon-linear-regressionnlme

解决方案


推荐阅读