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月月考生物试卷
网友关注
- A 2000-year palaeoflood record from northwest England from lake sediments
- 2015年课程设计报告模板
- _2012级线性代数A1试题
- 普化第六章2
- 高代 第四章 矩阵
- 华中师范大学2009年随机过程试题B卷附答案
- _2012级线性代数B2试题
- 线性代数补充习题与参考答案
- 基本概念复习题
- 12级实验讲义
- 大学物理复习题
- 《线性代数》课程教学大纲
- 毕业论文(终极版)
- 建筑力学答案
- 化学史说稿
- 工程数学作业4答案
- 线性代数课件16
- 华中师范大学2013年随机过程试题A卷附答案
- The endothelial cell tube formation assay on basement membrane turns 20_ state of the science
- 华中师范大学2009年随机过程试题A卷附答案
- 试题库
- 编写 - 副本
- 高频电子期末考试试题
- 传热复习题
- 线性代数考试题型
- 植物组织培养
- 工程数学作业1答案
- 华中师范大学2013年随机过程A卷试题
- 算法分析与设计
- _2012级线性代数B2答案
网友关注视频
- 【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,安徽省
- 苏教版二年级下册数学《认识东、南、西、北》
- 冀教版英语五年级下册第二课课程解读
- 第8课 对称剪纸_第一课时(二等奖)(沪书画版二年级上册)_T3784187
- 【部编】人教版语文七年级下册《过松源晨炊漆公店(其五)》优质课教学视频+PPT课件+教案,江苏省
- 第五单元 民族艺术的瑰宝_15. 多姿多彩的民族服饰_第二课时(市一等奖)(岭南版六年级上册)_T129830
- 人教版二年级下册数学
- 8 随形想象_第一课时(二等奖)(沪教版二年级上册)_T3786594
- 人教版历史八年级下册第一课《中华人民共和国成立》
- 北师大版数学四年级下册第三单元第四节街心广场
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 2
- 化学九年级下册全册同步 人教版 第25集 生活中常见的盐(二)
- 【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,辽宁省
- 冀教版小学数学二年级下册第二周第2课时《我们的测量》宝丰街小学庞志荣.mp4
- 8.对剪花样_第一课时(二等奖)(冀美版二年级上册)_T515402
- 外研版英语七年级下册module3 unit2第一课时
- 北师大版数学 四年级下册 第三单元 第二节 小数点搬家
- 青岛版教材五年级下册第四单元(走进军营——方向与位置)用数对确定位置(一等奖)
- 外研版英语七年级下册module3 unit1第二课时
- 外研版八年级英语下学期 Module3
- 苏科版数学 八年级下册 第八章第二节 可能性的大小
- 【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
- 北师大版数学四年级下册3.4包装
- 冀教版小学英语四年级下册Lesson2授课视频
- 外研版英语三起5年级下册(14版)Module3 Unit2
- 【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,广东省
- 沪教版八年级下册数学练习册21.3(3)分式方程P17
- 北师大版八年级物理下册 第六章 常见的光学仪器(二)探究凸透镜成像的规律
- 六年级英语下册上海牛津版教材讲解 U1单词
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 3
精品推荐
- 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
- 网吧管理