DPdensity之学习Word文档格式.docx
- 文档编号:15761278
- 上传时间:2022-11-15
- 格式:DOCX
- 页数:49
- 大小:35.22KB
DPdensity之学习Word文档格式.docx
《DPdensity之学习Word文档格式.docx》由会员分享,可在线阅读,更多相关《DPdensity之学习Word文档格式.docx(49页珍藏版)》请在冰豆网上搜索。
ThisfunctiongeneratesaposteriordensitysampleforaDirichletprocessmixtureofnormalsmodel.
Usage
DPdensity(y,ngrid=1000,grid=NULL,prior,mcmc,state,status,method="
neal"
data=sys.frame(sys.parent()),na.action=na.fail)
Arguments
y
avectorormatrixgivingthedatafromwhichthedensityestimateistobecomputed.
ngrid
numberofgridpointswherethedensityestimateisevaluated.Thisisonlyusedifdimensionofyislowerorequalthan低于或等于2.Thedefaultvalueis1000.
grid
matrixofdimensionngrid*nvarofgridpointswherethedensityestimateisevaluated.Thisisonlyusedifdimensionofyislowerorequalthan2.Thedefaultvalue缺省值isNULLandthegridischosenaccordingtotherangeofthedata.由数据范围决定
prior
alistgivingthepriorinformation.Thelistincludesthefollowingparameter:
a0andb0givingthehyperparametersforpriordistributionoftheprecisionparameteroftheDirichletprocessprior,alphagivingthevalueoftheprecisionparameter(itmustbespecifiedifa0ismissing,seedetailsbelow),nu2andpsiinv2givingthehyperparametersoftheinvertedWishartpriordistributionforthescalematrix,Psi1,oftheinvertedWishartpartofthebaselinedistribution,tau1andtau2givingthehyperparametersforthegammapriordistributionofthescaleparameterk0ofthenormalpartofthebaselinedistribution,m2ands2givingthemeanandthecovarianceofthenormalpriorforthemean,m1,ofthenormalcomponentofthebaselinedistribution,respectively,nu1andpsiinv1(itmustbespecifiedifnu2ismissing,seedetailsbelow)givingthehyperparametersoftheinvertedWishartpartofthebaselinedistributionand,m1givingthemeanofthenormalpartofthebaselinedistribution(itmustbespecifiedifm2ismissing,seedetailsbelow)and,k0givingthescaleparameterofthenormalpartofthebaselinedistribution(itmustbespecifiediftau1ismissing,seedetailsbelow).超参数的给定
mcmc
alistgivingtheMCMCparameters.Thelistmustincludethefollowingintegers:
nburngivingthenumberofburn-inscans,nskipgivingthethinninginterval,nsavegivingthetotalnumberofscanstobesaved,andndisplaygivingthenumberofsavedscanstobedisplayedonscreen(thefunctionreportsonthescreenwheneveryndisplayiterationshavebeencarriedout).
state
alistgivingthecurrentvalue现值oftheparameters.Thislistisusedifthecurrentanalysisisthecontinuationofapreviousanalysis.
status
alogicalvariableindicatingwhetherthisrunisnew(TRUE)orthecontinuationofapreviousanalysis(FALSE).Inthelattercasethecurrentvalueoftheparametersmustbespecifiedintheobjectstate.
method
themethodtobeused.SeeDetails.
data
dataframe.
na.action
afunctionthatindicateswhatshouldhappenwhenthedatacontainNAs.Thedefaultaction(na.fail)causesDPdensitytoprintanerrormessageandterminateifthereareanyincompleteobservations.默认出现NA结束
Details
ThisgenericfunctionfitsaDirichletprocessmixtureofnormalmodelfordensityestimation(EscobarandWest,1995):
yi|mui,Sigmai~N(mui,Sigmai),i=1,…,n
(mui,Sigmai)|G~G
G|alpha,G0~DP(alphaG0)
where,thebaselinedistributionistheconjugatenormal-inverted-Wishart,
G0=N(mu|m1,(1/k0)Sigma)IW(Sigma|nu1,psi1)
Tocompletethemodelspecification,independenthyperpriorsareassumed(optional),
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)
Notethattheinverted-WishartpriorisparametrizedsuchthatifA~IWq(nu,psi)thenE(A)=psiinv/(nu-q-1).
Toletpartofthebaselinedistributionfixedataparticularvalue,setthecorrespondinghyperparametersofthepriordistributionstoNULLinthehyperpriorspecificationofthemodel.
Althoughthebaselinedistribution,G0,isaconjugatepriorinthismodelspecification,thealgorithmswithauxiliaryparametersdescribedinMacEachernandMuller(1998)andNeal(2000)areadopted.Specifically,theno-gapsalgorithmofMacEachernandMuller(1998),"
no-gaps"
andthealgorithm8withm=1ofNeal(2000),"
areconsideredintheDPdensityfunction.Thedefaultmethodisthealgorithm8ofNeal.
Value
AnobjectofclassDPdensityrepresentingtheDPmixtureofnormalsmodelfit.Genericfunctionssuchasprint,summary,andplothavemethodstoshowtheresultsofthefit.Theresultsincludethebaselineparameters,alpha,andthenumberofclusters.
ThefunctionDPrandomcanbeusedtoextracttheposteriormeanofthesubject-specificmeansandcovariancematrices.
TheMCMCsamplesoftheparametersandtheerrorsinthemodelarestoredintheobjectthetasaveandrandsave,respectively.Bothobjectsareincludedintheli
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- DPdensity 学习