全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
5706 9
2008-05-02
现有非线性函数的参数要估计,需用极大似然法,使用什么软件可以实现啊
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2008-5-14 19:23:00
R can do it.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-5-14 22:44:00

NLS in R

Type ?nls in R for more details!

Examples from R help

     DNase1 <- subset(DNase, Run == 1)

     ## using a selfStart model
     fm1DNase1 <- nls(density ~ SSlogis(log(conc), Asym, xmid, scal), DNase1)
     summary(fm1DNase1)

     ## using conditional linearity
     fm2DNase1 <- nls(density ~ 1/(1 + exp((xmid - log(conc))/scal)),
                      data = DNase1,
                      start = list(xmid = 0, scal = 1),
                      alg = "plinear", trace = TRUE)
     summary(fm2DNase1)

     ## without conditional linearity
     fm3DNase1 <- nls(density ~ Asym/(1 + exp((xmid - log(conc))/scal)),
                      data = DNase1,
                      start = list(Asym = 3, xmid = 0, scal = 1),
                      trace = TRUE)
     summary(fm3DNase1)

     ## using Port's nl2sol algorithm
     fm4DNase1 <- nls(density ~ Asym/(1 + exp((xmid - log(conc))/scal)),
                      data = DNase1,
                      start = list(Asym = 3, xmid = 0, scal = 1),
                      trace = TRUE, algorithm = "port")
     summary(fm4DNase1)

     ## weighted nonlinear regression
     Treated <- Puromycin[Puromycin$state == "treated", ]
     weighted.MM <- function(resp, conc, Vm, K)
     {
         ## Purpose: exactly as white book p. 451 -- RHS for nls()
         ##  Weighted version of Michaelis-Menten model
         ## ------------------------------------------------------------
         ## Arguments: 'y', 'x' and the two parameters (see book)
         ## ------------------------------------------------------------
         ## Author: Martin Maechler, Date: 23 Mar 2001, 18:48

         pred <- (Vm * conc)/(K + conc)
         (resp - pred) / sqrt(pred)
     }

     Pur.wt <- nls( ~ weighted.MM(rate, conc, Vm, K), data = Treated,
                   start = list(Vm = 200, K = 0.1),
                   trace = TRUE)
     summary(Pur.wt)

     ## The two examples below show that you can fit a model to
     ## artificial data with noise but not to artificial data
     ## without noise.
     x <- 1:10
     y <- x                                  # perfect fit
     yeps <- y + rnorm(length(y), sd = 0.01) # added noise
     nls(yeps ~ a + b*x, start = list(a = 0.12345, b = 0.54321),
          trace = TRUE)
     ## Not run:
     nls(y ~ a + b*x, start = list(a = 0.12345, b = 0.54321),
          trace = TRUE)
     ## End(Not run)      

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-5-6 00:32:00
stata 就可以做 
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-2-3 14:14:54
我觉得matlab也可以做
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-2-3 14:15:32
我觉得matlab也可以做
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群