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月月考生物试卷
网友关注
- 母亲节所思
- 给父母的一封廉洁家书33
- 广东省连州市星子镇中心幼儿园工程可行性研究报告-广州中撰咨询
- 如何对待逆反孩子
- 2010-2011学年北京市海淀区高三第二学期期末练习(语文)答案
- 小学古诗词归类整理
- 幼儿教育心得
- 方向与位置
- 对“留守学生”教育问题思考
- 洋县理光复印土管局大门北:幼儿园校安全工作日志
- 端午节放假安全教育材料
- 广东省深圳市西丽幼儿园分园装修工程可行性研究报告-广州中撰咨询
- 小学复习必背古诗词答案
- 父母永不放弃自我成长,是孩子最好的教育!
- 2015---2016年度小班名画欣赏
- 黄道婆
- 留守儿童之家读书活动安排意见
- 2010年浙江省金华一中高一上学期期中考试语文卷答案
- 留守儿童材料目录
- 福建省小学示范图书馆评估标准
- 小古文诵读100篇[1]
- 适合小孩子的运动
- 东华试题分类--阅读答案
- 幼儿不慎溺水应遵循的急救办法
- 《教育的力量》读后感
- 兰德公司“T项目”研究及其对我国学前教育的启示
- 2016年四川省内江市中考化学试卷
- 小学总务考核标准11
- 2016----2017年度小班名画欣赏
- 2010年海南省嘉积中学高二上学期第二次月考语文卷
网友关注视频
- 二年级下册数学第三课 搭一搭⚖⚖
- 沪教版牛津小学英语(深圳用) 五年级下册 Unit 7
- 【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
- 人教版二年级下册数学
- 六年级英语下册上海牛津版教材讲解 U1单词
- 沪教版牛津小学英语(深圳用) 五年级下册 Unit 10
- 30.3 由不共线三点的坐标确定二次函数_第一课时(市一等奖)(冀教版九年级下册)_T144342
- 苏科版八年级数学下册7.2《统计图的选用》
- 冀教版英语四年级下册第二课
- 冀教版小学数学二年级下册第二单元《有余数除法的简单应用》
- 沪教版牛津小学英语(深圳用) 六年级下册 Unit 7
- 青岛版教材五年级下册第四单元(走进军营——方向与位置)用数对确定位置(一等奖)
- 第19课 我喜欢的鸟_第一课时(二等奖)(人美杨永善版二年级下册)_T644386
- 苏科版数学 八年级下册 第八章第二节 可能性的大小
- 【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
- 河南省名校课堂七年级下册英语第一课(2020年2月10日)
- 七年级英语下册 上海牛津版 Unit3
- 外研版英语七年级下册module1unit3名词性物主代词讲解
- 外研版英语三起6年级下册(14版)Module3 Unit1
- 北师大版八年级物理下册 第六章 常见的光学仪器(二)探究凸透镜成像的规律
- 第五单元 民族艺术的瑰宝_16. 形形色色的民族乐器_第一课时(岭南版六年级上册)_T3751175
- 化学九年级下册全册同步 人教版 第25集 生活中常见的盐(二)
- 苏科版数学七年级下册7.2《探索平行线的性质》
- 【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,天津市
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 8
- 沪教版八年级下册数学练习册21.3(3)分式方程P17
- 七年级英语下册 上海牛津版 Unit5
- 冀教版小学英语五年级下册lesson2教学视频(2)
- 外研版英语三起6年级下册(14版)Module3 Unit2
- 第12章 圆锥曲线_12.7 抛物线的标准方程_第一课时(特等奖)(沪教版高二下册)_T274713
精品推荐
- 2016-2017学年高一语文人教版必修一+模块学业水平检测试题(含答案)
- 广西钦州市高新区2017届高三11月月考政治试卷
- 浙江省湖州市2016-2017学年高一上学期期中考试政治试卷
- 浙江省湖州市2016-2017学年高二上学期期中考试政治试卷
- 辽宁省铁岭市协作体2017届高三上学期第三次联考政治试卷
- 广西钦州市钦州港区2016-2017学年高二11月月考政治试卷
- 广西钦州市钦州港区2017届高三11月月考政治试卷
- 广西钦州市钦州港区2016-2017学年高一11月月考政治试卷
- 广西钦州市高新区2016-2017学年高二11月月考政治试卷
- 广西钦州市高新区2016-2017学年高一11月月考政治试卷
分类导航
- 互联网
- 电脑基础知识
- 计算机软件及应用
- 计算机硬件及网络
- 计算机应用/办公自动化
- .NET
- 数据结构与算法
- Java
- SEO
- C/C++资料
- linux/Unix相关
- 手机开发
- UML理论/建模
- 并行计算/云计算
- 嵌入式开发
- windows相关
- 软件工程
- 管理信息系统
- 开发文档
- 图形图像
- 网络与通信
- 网络信息安全
- 电子支付
- Labview
- matlab
- 网络资源
- Python
- Delphi/Perl
- 评测
- Flash/Flex
- CSS/Script
- 计算机原理
- PHP资料
- 数据挖掘与模式识别
- Web服务
- 数据库
- Visual Basic
- 电子商务
- 服务器
- 搜索引擎优化
- 存储
- 架构
- 行业软件
- 人工智能
- 计算机辅助设计
- 多媒体
- 软件测试
- 计算机硬件与维护
- 网站策划/UE
- 网页设计/UI
- 网吧管理