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月月考生物试卷
网友关注
- 福建省小学示范图书馆评估标准
- 一年级下册语文测试八
- 父母永不放弃自我成长,是孩子最好的教育!
- 2010年海南省嘉积中学高二上学期第二次月考语文卷
- 2010年浙江省金华一中高一上学期期中考试语文卷答案
- 学生服使用单位履行质量义务情况专项检查记录表(幼儿园)
- 老虎照镜子剧本
- 广东省连州市星子镇中心幼儿园工程可行性研究报告-广州中撰咨询
- 关于幼儿园转让协议
- 兰德公司“T项目”研究及其对我国学前教育的启示
- 留守儿童材料目录
- 陕西艺术幼儿园音乐活动教研心得(3.14)
- 幼儿园班级消毒记录表
- 2015---2016年度小班名画欣赏
- 幼儿不慎溺水应遵循的急救办法
- 2010年拉萨中学高一下学期期末考试语文卷答案
- 适合小孩子的运动
- 幼儿带量食谱安排原则
- 幼儿教育心得
- 寒假前安全教育讲稿
- 小古文诵读100篇[1]
- 小学复习必背古诗词答案
- 2010-2011学年北京市海淀区高三第二学期期末练习(语文)答案
- 广东省深圳市西丽幼儿园分园装修工程可行性研究报告-广州中撰咨询
- 端午节安全教育
- 中班美术教学计划
- 对“留守学生”教育问题思考
- 端午节放假安全教育材料
- 如何对待逆反孩子
- 小学古诗词归类整理
网友关注视频
- 冀教版英语五年级下册第二课课程解读
- 19 爱护鸟类_第一课时(二等奖)(桂美版二年级下册)_T502436
- 【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
- 外研版八年级英语下学期 Module3
- 沪教版牛津小学英语(深圳用) 六年级下册 Unit 7
- 冀教版小学数学二年级下册第二周第2课时《我们的测量》宝丰街小学庞志荣
- 冀教版小学数学二年级下册第二单元《有余数除法的整理与复习》
- 第19课 我喜欢的鸟_第一课时(二等奖)(人美杨永善版二年级下册)_T644386
- 冀教版英语三年级下册第二课
- 【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,辽宁省
- 沪教版八年级下册数学练习册一次函数复习题B组(P11)
- 冀教版小学英语五年级下册lesson2教学视频(2)
- 沪教版八年级下册数学练习册20.4(2)一次函数的应用2P8
- 3月2日小学二年级数学下册(数一数)
- 【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,辽宁省
- 北师大版数学四年级下册第三单元第四节街心广场
- 青岛版教材五年级下册第四单元(走进军营——方向与位置)用数对确定位置(一等奖)
- 人教版二年级下册数学
- 七年级英语下册 上海牛津版 Unit9
- 沪教版八年级下册数学练习册21.3(2)分式方程P15
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 3
- 3.2 数学二年级下册第二单元 表内除法(一)整理和复习 李菲菲
- 外研版英语七年级下册module3 unit2第二课时
- 飞翔英语—冀教版(三起)英语三年级下册Lesson 2 Cats and Dogs
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 8
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 2
- 冀教版小学数学二年级下册1
- 化学九年级下册全册同步 人教版 第22集 酸和碱的中和反应(一)
- 【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,安徽省
- 第五单元 民族艺术的瑰宝_16. 形形色色的民族乐器_第一课时(岭南版六年级上册)_T1406126
精品推荐
- 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
- 网吧管理