本文介绍了R 中的 Sigmoidal 建模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试建模和绘制具有少量点的 sigmoidal 曲线.

I am currently trying to model and plot a sigmoidal curve with a low amount of points.

>myExperiment
 V1  N mean
0.1  9 0.9
  1  9 0.8
 10  9 0.1
  5  9 0.2

我正在使用 minpack.lm 包中的 nlsLM 函数.

I am using the nlsLM function from the minpack.lm package.

> nlsLM(mean2 ~ -a/(1 + exp(-b * (v1-o))))
Nonlinear regression model
  model: mean2 ~ -a/(1 + exp(-b * (v1 - o)))
   data: parent.frame()
     a      b      o
-1.452 -0.451  1.292
 residual sum-of-squares: 0.007017

Number of iterations to convergence: 27
Achieved convergence tolerance: 1.49e-08
Warning message:
In nlsLM(mean2 ~ -a/(1 + exp(-b * (v1 - o)))) :
  No starting values specified for some parameters.
Initializing ‘a’, ‘b’, ‘o’ to '1.'.
Consider specifying 'start' or using a selfStart model

使用这些起始值时我收到此错误.

Using those starting values I receive this error.

> nls(mean~-a/(1 + exp(-b * (v1-o))), start=list(a=-1.452, b=-0.451, o=1.292))
Error in nls(mean ~ -a/(1 + exp(-b * (v1 - o))), start = list(a = -1.452,  :
  step factor 0.000488281 reduced below 'minFactor' of 0.000976562

我对统计数据没有很好的研究,不知道这是语法 R 错误还是统计失败.我哪里做得不好?

I am not well studied in stats to know if this is a syntax R error or a stats failure. What am I doing poorly?

-谢谢

推荐答案

这看起来像二项式剂量反应数据.无论如何,我会提出一个更简单的模型,比如两参数对数逻辑模型,渐近线在 0 和 1.很多 sigmoidal 模型已经在 drc 包中编码.

This looks like binomial dose-response data. In any case, I would propose a simpler model, like the two parameter log-logistic model, with asymptotes at 0 and 1. A lot of sigmoidal models have been coded up in the drc package.

myExperiment = read.table(header = TRUE, text =
" V1  N mean
0.1  9 0.9
  1  9 0.8
 10  9 0.1
  5  9 0.2")

library(drc)

m.ll2 <- drm(mean ~ V1,
  data = myExperiment,
  type = "binomial",
  fct = LL.2(),
  weights = N)

plot(m.ll2, ylim = c(0, 1))

这篇关于R 中的 Sigmoidal 建模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-11 18:04