教育资源为主的文档平台

当前位置: 查字典文档网> 所有文档分类> 高等教育> 理学> DPMdencens之学解

DPMdencens之学解

上传者:蒋鸣
|
上传时间:2015-05-07
|
次下载

DPMdencens之学解

DPMdencens示例

DPMdencens {DPpackage} R Documentation Bayesian density estimation for

interval-censored data using a DPM of

normals

Description

This function generates a posterior density sample for a Dirichlet process mixture of normals model for interval-censored data区间删失数据 .

Usage

DPMdencens(left,right,ngrid=100,grid=NULL,prior,mcmc,state,status) Arguments

left a vector or matrix giving the lower limit for each response variable. Note that

the responses are defined on the entire real line and that unknown limits

should be indicated by NA.

right a vector or matrix giving the upper limit for each response variable. Note that

the responses are defined on the entire real line and that unknown limits

should be indicated by NA.

ngrid number of grid points where the density estimate is evaluated. The default

value is 100.

grid matrix of dimension ngrid*nvar of grid points where the density estimate is

evaluated. The default value is NULL and the grid is chosen according to the range of the interval limits.

prior a list giving the prior information. The list includes the following

parameter: a0 and b0 giving the hyperparameters for prior distribution of the precision parameter of the Dirichlet process prior, alpha giving the value of the precision parameter (it must be specified if a0 is missing, see details

below), nu2 andpsiinv2 giving the hyperparameters of the inverted Wishart prior distribution for the scale matrix, Psi1, of the inverted Wishart part of the baseline distribution, tau1 and tau2 giving the hyperparameters for the gamma prior distribution of the scale parameter k0 of the normal part of the

DPMdencens示例

baseline distribution,m2 and s2 giving the mean and the covariance of the normal prior for the mean, m1, of the normal component of the baseline

distribution, respectively, nu1 andpsiinv1 (it must be specified if nu2 is

missing, see details below) giving the hyperparameters of the inverted

Wishart part of the baseline distribution and, m1giving the mean of the normal part of the baseline distribution (it must be specified if m2 is missing, see

details below) and, k0 giving the scale parameter of the normal part of the baseline distribution (it must be specified if tau1 is missing, see details

below).

mcmc a list giving the MCMC parameters. The list must include the following

integers: nburn giving the number of burn-in scans, nskip giving the thinning interval,nsave giving the total number of scans to be saved,

and ndisplay giving the number of saved scans to be displayed on screen (the function reports on the screen when every ndisplay iterations have been carried out).

state a list giving the current value of the parameters. This list is used if the current

analysis is the continuation of a previous analysis.

status a logical variable indicating whether this run is new (TRUE) or the

continuation of a previous analysis (FALSE). In the latter case the current

value of the parameters must be specified in the object state.

Details

This generic function fits a Dirichlet process mixture of normal model for density estimation (Escobar and West, 1995) based on interval-censored data:

yij in [lij,uij),i=1,…,n, j=1,…,m,

yi | mui, Sigmai ~ N(mui,Sigmai), i=1,…,n,

(mui,Sigmai) | G ~ G,

G | alpha, G0 ~ DP(alpha G0),

where, yi=(yi1,…,yim), and the baseline distribution is the conjugate normal-inverted-Wishart distribution,

G0 = N(mu| m1, (1/k0) Sigma) IW (Sigma | nu1, psi1)

To complete the model specification, independent hyperpriors are assumed (optional),

DPMdencens示例

alpha | a0, b0 ~ Gamma(a0,b0)

m1 | m2, s2 ~ N(m2,s2)

k0 | tau1, tau2 ~ Gamma(tau1/2,tau2/2)

psi1 | nu2, psi2 ~ IW(nu2,psi2)

Note that the inverted-Wishart prior is parametrized such that if A ~ IWq(nu, psi) then E(A)= psiinv/(nu-q-1).

To let part of the baseline distribution fixed at a particular value, set the corresponding hyperparameters of the prior distributions to NULL in the hyperprior specification of the model.

Although the baseline distribution, G0, is a conjugate prior in this model specification, an algorithm based on auxiliary parameters is adopted. Specifically, the algorithm 8 with m=1 of Neal (2000) is considered in the DPMdencens function.

Finally, note that this function can be used to fit the DPM of normals model for ordinal data proposed by Kottas, Mueller and Quintana (2005). In this case, the arbitrary cut-off points must be specified in left and right.

Samples from the predictive distribution contained in the (last columns) of the object randsave (please see below) can be used to obtain an estimate of the cell probabilities.

Value

An object of class DPMdencens representing the DP mixture of normals model fit. Generic functions such as print, summary, and plot have methods to show the results of the fit. The results include the baseline parameters, alpha, and the number of clusters.

The function DPrandom can be used to extract the posterior mean of the subject-specific means and covariance matrices.

DPMdencens示例

The MCMC samples of the parameters and the errors in the model are stored in the object thetasave and randsave, respectively. Both objects are included in the listsave.state and are matrices which can be analyzed directly by functions provided by the coda package.

The list state in the output object contains the current value of the

parameters necessary to restart the analysis. If you want to specify different starting values to run multiple chains set status=TRUE and create the list state based on this starting values. In this case the list state must include the following objects:

ncluster an integer giving the number of clusters.

muclus a matrix of dimension (nobservations+100)*(nvariables) giving the means

of the clusters (only the first ncluster are considered to start the chain). sigmaclus a matrix of dimension

(nobservations+100)*( (nvariables)*((nvariables)+1)/2) giving the lower matrix of the covariance matrix of the clusters (only the firstncluster are considered to start the chain).

ss

alpha

m1

k0

psi1

y an interger vector defining to which of the ncluster clusters each observation belongs. giving the value of the precision parameter. giving the mean of the normal components of the baseline distribution. giving the scale parameter of the normal part of the baseline distribution. giving the scale matrix of the inverted-Wishart part of the baseline distribution. giving the matrix of imputed data points.

Author(s)

Alejandro Jara

References

Escobar, M.D. and West, M. (1995) Bayesian Density Estimation and Inference Using Mixtures. Journal of the American Statistical Association, 90: 577-588.

DPMdencens示例

Kottas, A., Mueller, P., Quintana, F. (2005). Nonparametric Bayesian modeling for multivariate ordinal data. Journal of Computational and Graphical Statistics, 14: 610-625.

Neal, R. M. (2000). Markov Chain sampling methods for Dirichlet process mixture models. Journal of Computational and Graphical Statistics, 9: 249-265.

See Also DPrandom, DPdensity

Examples

## Not run:

####################################

# Bivariate example:

# Censored data is artificially

# created

####################################

data(airquality)

缺失数据为NA

attach(airquality)

将数据中变量能直接读取

ozone <- Ozone**(1/3)

开立方根

radiation <- Solar.R

重新赋名

y <- na.omit(cbind(radiation,ozone))

删除带有na的行,并给出行号

# create censored-data

xxlim <- seq(0,300,50)

yylim <- seq(1.5,5.5,1)

生成两个数列

left <- matrix(0,nrow=nrow(y),ncol=2)

right <- matrix(0,nrow=nrow(y),ncol=2)

生成与变量y同行,列为2的全0阵

for(i in 1:nrow(y))

{

left[i,1] <- NA

right[i,1] <- NA

版权声明:此文档由查字典文档网用户提供,如用于商业用途请与作者联系,查字典文档网保持最终解释权!

下载文档

热门试卷

2016年四川省内江市中考化学试卷
广西钦州市高新区2017届高三11月月考政治试卷
浙江省湖州市2016-2017学年高一上学期期中考试政治试卷
浙江省湖州市2016-2017学年高二上学期期中考试政治试卷
辽宁省铁岭市协作体2017届高三上学期第三次联考政治试卷
广西钦州市钦州港区2016-2017学年高二11月月考政治试卷
广西钦州市钦州港区2017届高三11月月考政治试卷
广西钦州市钦州港区2016-2017学年高一11月月考政治试卷
广西钦州市高新区2016-2017学年高二11月月考政治试卷
广西钦州市高新区2016-2017学年高一11月月考政治试卷
山东省滨州市三校2017届第一学期阶段测试初三英语试题
四川省成都七中2017届高三一诊模拟考试文科综合试卷
2017届普通高等学校招生全国统一考试模拟试题(附答案)
重庆市永川中学高2017级上期12月月考语文试题
江西宜春三中2017届高三第一学期第二次月考文科综合试题
内蒙古赤峰二中2017届高三上学期第三次月考英语试题
2017年六年级(上)数学期末考试卷
2017人教版小学英语三年级上期末笔试题
江苏省常州西藏民族中学2016-2017学年九年级思想品德第一学期第二次阶段测试试卷
重庆市九龙坡区七校2016-2017学年上期八年级素质测查(二)语文学科试题卷
江苏省无锡市钱桥中学2016年12月八年级语文阶段性测试卷
江苏省无锡市钱桥中学2016-2017学年七年级英语12月阶段检测试卷
山东省邹城市第八中学2016-2017学年八年级12月物理第4章试题(无答案)
【人教版】河北省2015-2016学年度九年级上期末语文试题卷(附答案)
四川省简阳市阳安中学2016年12月高二月考英语试卷
四川省成都龙泉中学高三上学期2016年12月月考试题文科综合能力测试
安徽省滁州中学2016—2017学年度第一学期12月月考​高三英语试卷
山东省武城县第二中学2016.12高一年级上学期第二次月考历史试题(必修一第四、五单元)
福建省四地六校联考2016-2017学年上学期第三次月考高三化学试卷
甘肃省武威第二十三中学2016—2017学年度八年级第一学期12月月考生物试卷

网友关注视频

沪教版牛津小学英语(深圳用)五年级下册 Unit 1
北师大版八年级物理下册 第六章 常见的光学仪器(二)探究凸透镜成像的规律
青岛版教材五年级下册第四单元(走进军营——方向与位置)用数对确定位置(一等奖)
《空中课堂》二年级下册 数学第一单元第1课时
【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,安徽省
第4章 幂函数、指数函数和对数函数(下)_六 指数方程和对数方程_4.7 简单的指数方程_第一课时(沪教版高一下册)_T1566237
北师大版小学数学四年级下册第15课小数乘小数一
【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
冀教版小学数学二年级下册第二单元《租船问题》
二年级下册数学第三课 搭一搭⚖⚖
精品·同步课程 历史 八年级 上册 第15集 近代科学技术与思想文化
苏教版二年级下册数学《认识东、南、西、北》
冀教版英语四年级下册第二课
沪教版八年级下册数学练习册一次函数复习题B组(P11)
二次函数求实际问题中的最值_第一课时(特等奖)(冀教版九年级下册)_T144339
冀教版英语三年级下册第二课
二年级下册数学第二课
【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,广东省
沪教版八年级下册数学练习册21.4(1)无理方程P18
化学九年级下册全册同步 人教版 第25集 生活中常见的盐(二)
苏科版数学 八年级下册 第八章第二节 可能性的大小
沪教版八年级下册数学练习册20.4(2)一次函数的应用2P8
外研版英语三起6年级下册(14版)Module3 Unit1
沪教版八年级下册数学练习册21.3(2)分式方程P15
沪教版八年级下次数学练习册21.4(2)无理方程P19
二年级下册数学第一课
3月2日小学二年级数学下册(数一数)
苏科版数学八年级下册9.2《中心对称和中心对称图形》
六年级英语下册上海牛津版教材讲解 U1单词
北师大版数学四年级下册第三单元第四节街心广场