怎么利用r语言做em算法估计混合双参数指数分布的数值模拟

Python014

怎么利用r语言做em算法估计混合双参数指数分布的数值模拟,第1张

建议你先看一下这本书:

Modeling Survival Data Using Frailty Models

chap 2. Some Parametric Methods

2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.2 Exponential Distribution . . . . . . . . . . . . . . . . . . . 20

2.3 Weibull Distribution . . . . . . . . . . . . . . . . . . . . . 21

2.4 Extreme Value Distributions . . . . . . . . . . . . . . . . 23

2.5 Lognormal . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.6 Gamma . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.7 Loglogistic . . . . . . . . . . . . . . . . . . . . . . . . . 29

2.8 Maximum Likelihood Estimation . . . . . . . . . . . . . 30

2.9 Parametric Regression Models

chap 6. Estimation Methods for Shared Frailty Models

6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . .105

6.2 Inference for the Shared Frailty Model . . . . . . . . . . 106

6.3 The EM Algorithm . . . . . . . . . . . . . . . . . . . . . . .108

6.4 The Gamma Frailty Model . . . . . . . . . . . . . . . . . . . 110

6.5 The Positive Stable Frailty Model . . . . . . . . . . . . . . 111

6.6 The Lognormal Frailty Model . . . . . . . . . . . . . . . . . 113

6.6.1 Application to Seizure Data . . . . . . . . . . . . . . . 113

6.7 Modified EM (MEM) Algorithm for Gamma Frailty Models 114

6.8 Application

然后用最基本的package "survival"

并参考你的模型可能用到的一些functions:

survreg(formula, data, weights, subset,na.action, dist="weibull",....)

survreg.distributions include "weibull", "exponential", "gaussian",

"logistic","lognormal" and "loglogistic"

frailty(x, distribution="gamma", ...)

distribution: either the gamma, gaussian or t distribution may be specified.

frailty.gamma(x, sparse = (nclass >5), theta, df, eps = 1e-05,

method = c("em","aic", "df", "fixed"),...)

我是用的pscl包,zeroinfl()函数零膨胀负二项模型(ZINB)mod <- zeroinfl(ReportedNumber~ A+B+C+D+E | F+G+H+I, data = zinb, dist = "negbin", EM = TRUE)ZINB模型由点模型和零膨胀模型两部分结合而成,ABCDE是点模型内变量, 影响因变量发生次数的多少,FGHI是零膨胀模型内变量,决定因变量是否能够发生(为0还是非0)。 http://www.ats.ucla.edu/stat/r/dae/zinbreg.htm 这个网站里讲的很清楚