极大似然比函数c语言实现,请教非线性函数的极大似然估计

这篇博客展示了如何在R语言中进行非线性回归分析。通过`nls()`函数,作者演示了使用不同算法(如selfStart模型、条件线性、Port's nl2sol算法)对DNase1数据集进行拟合,并提供了加权非线性回归的例子。此外,还对比了噪声数据和无噪声数据的拟合效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Type ?nls in R for more details!

Examples from R help

DNase1

## using a selfStart model

fm1DNase1

summary(fm1DNase1)

## using conditional linearity

fm2DNase1

data = DNase1,

start = list(xmid = 0, scal = 1),

alg = "plinear", trace = TRUE)

summary(fm2DNase1)

## without conditional linearity

fm3DNase1

data = DNase1,

start = list(Asym = 3, xmid = 0, scal = 1),

trace = TRUE)

summary(fm3DNase1)

## using Port's nl2sol algorithm

fm4DNase1

data = DNase1,

start = list(Asym = 3, xmid = 0, scal = 1),

trace = TRUE, algorithm = "port")

summary(fm4DNase1)

## weighted nonlinear regression

Treated

weighted.MM

{

## 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

(resp - pred) / sqrt(pred)

}

Pur.wt

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

y

yeps

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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值