模型推理与平均课件_第1页
模型推理与平均课件_第2页
模型推理与平均课件_第3页
模型推理与平均课件_第4页
模型推理与平均课件_第5页
已阅读5页,还剩32页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

第八章模型推理与平均8.ModelInferenceandAverage,1,PPT学习交流,8.1概述,模型的拟合(学习):回归:最小化平方和分类:最小化交叉熵实际上,这两种方法都是最大似然方法拟合的实例本章的主要内容:模型的推理最大似然方法;用于推理的贝叶斯方法;自助法以及这三种推理方法的关系模型的平均和提高(improvement)Committeemethods,bagging,stacking,andbunping,2,PPT学习交流,8.1概述:基本概念,StatisticalInferenceUsingdatatoinferthedistributionthatgeneratedthedataObserveddata:Wewanttoinfer(orestimateorlearn)ForsomefeatureofFsuchasitsmean.StatisticalModelAsetofdistributions(orasetofdensities)ParametricmodelNonparametricmodel,3,PPT学习交流,8.1概述:基本概念,ParametricmodelAsetthatcanbeparameterizedbyafinitenumberofparametersE.g.Assumethedatacomefromanormaldistribution,themodelis:Aparametricmodeltakestheform:,4,PPT学习交流,Non-parametricmodelAsetthatcannotbeparameterizedbyafinitenumberofparametersE.g.Assumethedatacomesfrom,8.1概述:基本概念,Probabilitydensityfunction,PDF,f(x):Cumulativedensityfunction,CDF,F(x):,5,PPT学习交流,8.1概述:本章主要内容,ModelInferenceMaximumlikelihoodinference(8.2.2)EMAlgorithm(8.5)Bayesianinference(8.3)GibbsSampling(8.6)Bootstrap(8.2.1,8.2.3,8.4)ModelAveragingandimprovementBagging(8.7)Bumping(8.9),6,PPT学习交流,ASmoothingExampleTrainingdata,Z=z1,z2,zn,withzi=(xi,yi),xiisaone-dimensionalinputyiistheoutputN=50pointsWedecidetofitacubicsplinetothedata,withthreeknotsplacedatthequartilesoftheXvalues.,8.2TheBootstrapandMaximumLikelihoodMethods,7,PPT学习交流,8,PPT学习交流,Theusualestimateof,obtainedbyminimizingthesquarederroroverthetrainingset,isgivenby:Theestimatedcovariancematrixofis:Thestandarderrorofapredictionis:The95%pointwiseconfidencebandsfor:,9,PPT学习交流,Howwecouldapplythebootstrapinthisexample?nonparametricbootstrapWedrawB=200datasetseachofsizeN=50withreplacementfromourtrainingdata;Toeachbootstrapdataset,wefitacubicspline;Wefindthe2.5%200=fifthlargestandsmallestvaluesateachxtoforma95%pointwiseconfidencebandfromthepercentilesateachx.,10,PPT学习交流,11,PPT学习交流,Howwecouldapplythebootstrapinthisexample?parametricbootstrapWesimulatenewresponsesbyaddingGaussiannoisetothepredictedvalues:Theresultingbootstrapdatasetshavetheform:Thefunctionhasdistribution:Noticethatthemeanofthisdistributionistheleastsquaresestimate,andthestandarddeviationisthesameasthestandarderrorofaprediction.,12,PPT学习交流,8.2.2MaximumLikelihoodInference,Supposewehave,Butyoudontknowor,MLE:Forwhichismostlikely?,13,PPT学习交流,AGeneralMLEstrategy,Supposeisavectorofparameters.,Task:FindMLEfor,2.Workoutusinghigh-schoolcalculus,Write,3.Solvethesetofsimultaneousequations,4.Checkyouareatamaximum,14,PPT学习交流,PropertiesofMLE,Samplingdistributionsofthemaximumlikelihoodestimatorhasalimitingnormaldistribution.,Fisherinformation,istruevalueof,Informationmatrix,15,PPT学习交流,ThesmoothingExample,Theparametersare.Thelog-likelihoodis:MLEisobtained:Theinformationmatrixforisblock-diagonal,andtheblockcorrespondingtois:,16,PPT学习交流,BootstrapversusMaximumLikelihood,Inessencethebootstrapisacomputerimplementationofnonparametricorparametricmaximumlikelihood.Theadvantageofthebootstrapitallowsustocomputemaximumlikelihoodestimatesofstandarderrorsandotherquantitiesinsettingswherenoformulasareavailable.,17,PPT学习交流,8.3BayesianMethods,GivenasamplingmodelPr(Z|)andapriorPr()fortheparameters,estimatetheposteriorprobabilityDifferencestomerecounting(frequentistapproach)Prior:allowforuncertaintiespresentbeforeseeingthedataPosterior:allowforuncertaintiespresentafterseeingthedataTheposteriordistributionaffordsalsoapredictivedistributionofseeingfuturevalues,VS.,18,PPT学习交流,Thesmoothingexample,ConsideralinearexpansionThepriordistributionof:aGaussianpriorcenteredatzero.,Thedistributioniscalledanoninformativepriorfor.,19,PPT学习交流,TheposteriordistributionforisalsoGaussian,withmeanandcovarianceThecorrespondingposteriorvaluesfor,20,PPT学习交流,21,PPT学习交流,RelationshipbetweenBootstrapandBayesianInference,Consideraverysimpleexample:SingleobservationzdrawnfromanormaldistributionAssumeanormalpriorfor:Resultingposteriordistribution,22,PPT学习交流,Thebootstrapdistributionrepresentsan(approximate)nonparametric,noninformativeposteriordistributionforourparameter.ButthisbootstrapdistributionisobtainedpainlesslyWithouthavingtoformallyspecifyapriorWithouthavingtosamplefromtheposteriordistribution.HencewemightthinkofthebootstrapdistributionasapoormansBayesposterior.,23,PPT学习交流,8.5TheEMAlgorithm,概率模型的变量都是观测变量,MLEBayesianInference概率模型的变量既含有观测变量(observablevariable),又含有隐变量或潜在变量(latentvariable),EM算法是含有隐变量概率模型的极大似然估计。,24,PPT学习交流,引例,(三硬币模型)如果有3枚硬币,分别记做A,B,C,这些硬币正面出现的概率分别为,p和q。进行如下的掷硬币实验:先掷硬币A,根据其出现的结果选硬币B或硬币C,正面选硬币B,发面选硬币C;然后掷选出的硬币,掷硬币的结果,出现正面记做1,出现反面记做0,独立的重复n次实验(这里n=10)观测结果如下:1,1,0,1,0,0,1,0,1,1假设只能观测到掷硬币的结果,不能观测掷硬币的过程,问如何估计三硬币正面出现的概率,即三硬币模型的参数。,25,PPT学习交流,设y0,1是观测变量,z是隐变量,表示未观测到掷硬币A的结果;是模型参数。观测数据Y=(Y1,Y2,Yn)的似然函数:模型参数的极大似然估计,没有解析解。,26,PPT学习交流,定义,Y表示观测随机变量的数据,Z表示隐随机变量的数据;Y和Z连在一起称为完全数据(complete-data)观测数据Y称为不完全数据(incomplete-data)完全数据的似然函数为:P(Y,Z|)不完全数据的似然函数为:P(Y|)EM算法通过迭代求L()=log(Y|)的极大似然估计。Q函数定义:完全数据的对数似然函数logP(Y,Z|)关于在给定观测数据Y和当前参数下对未观测数据Z的条件概率分布P(Z|Y,)的期望,称为Q函数:,27,PPT学习交流,EMalgorithm,输入:观测变量数据Y,联合分布P(Y,Z|),条件分布P(Z|Y,)输出模型参数(1)选择参数的初值,开始迭代;(2)E步:记为第i次迭代参数的估计值,在第i+1步迭代的E步,计算:(3)M步:求使极大化的,确定i+1次迭代参数的估计值(4)重复(2)步和(3)步,直到收敛。,28,PPT学习交流,EM算法在高斯混合模型学习中的应用,高斯混合模型:高斯混合模型是指具有以下形式的概率分布模型:其中,是系数,是高斯分布密度,称为第k个分模型。,29,PPT学习交流,假设观测数据y1,y2,yN是由高斯混合模型生成其中,我们需要用EM算法估计高斯混合模型参数。,30,PPT学习交流,明确隐变量,写出完全数据的对数似然函数。假设观测数据yj,j=1,2,N是这样产生的:(1)首先,依概率选择第k个高斯分布模型(2)然后依第k个高斯分布模型的概率分布生成观测数据yj其中,反映观测数据y

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论