本帖最后由 fantuanxiaot 于 2014-11-19 22:22 编辑
5 MCMC matlab.pdf
(1.14 MB, 下载次数: 349)
2014-11-19 22:12 上传
点击文件名下载附件
下载积分: 贝壳 -1
1.jpg (72.49 KB, 下载次数: 42)
2014-11-19 22:16 上传
2.jpg (78.69 KB, 下载次数: 21)
2014-11-19 22:16 上传
目录
1 Sampling from Random Variables 4
1.1 Standard distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Sampling from non-standard distributions . . . . . . . . . . . . . . . . . . . 7
1.2.1 Inverse transform sampling with discrete variables . . . . . . . . . . . 8
1.2.2 Inverse transform sampling with continuous variables . . . . . . . . . 11
1.2.3 Rejection sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Markov Chain Monte Carlo 15
2.1 Monte Carlo integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Markov Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Putting it together: Markov chain Monte Carlo . . . . . . . . . . . . . . . . 18
2.4 Metropolis Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5 Metropolis-Hastings Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6 Metropolis-Hastings for Multivariate Distributions . . . . . . . . . . . . . . . 26
2.6.1 Blockwise updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6.2 Componentwise updating . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7 Gibbs Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3 Basic concepts in Bayesian Data Analysis 39
3.1 Parameter Estimation Approaches . . . . . . . . . . . . . . . . . . . . . . . . 40
3.1.1 Maximum Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.1.2 Maximum a posteriori . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.1.3 Posterior Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2 Example: Estimating a Weibull distribution . . . . . . . . . . . . . . . . . . 42
3.3 Example: Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.4 Example: Mallows Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4 Directed Graphical Models 46
4.1 A Short Review of Probability Theory . . . . . . . . . . . . . . . . . . . . . 46
4.2 The Burglar Alarm Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2.1 Conditional probability tables . . . . . . . . . . . . . . . . . . . . . . 49
4.2.2 Explaining away . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2.3 Joint distributions and independence relationships. . . . . . . . . . . 52
4.3 Graphical Model Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.3.1 Example: Consensus Modeling with Gaussian variables . . . . . . . . 54
5 Approximate Inference in Graphical Models 57
5.1 Prior predictive distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.2 Posterior distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
5.2.1 Rejection Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
5.2.2 MCMC Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.2.3 Example: Posterior Inference for the consensus modelwith normally
distributed variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.2.4 Example: Posterior Inference for the consensus modelwith contaminants 66
6 Sequential Monte Carlo 69
6.1 Hidden Markov Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.1.1 Example HMM with discrete outcomes and states . . . . . . . . . . . 71
6.1.2 Viterbi Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.2 Bayesian Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.3 Particle Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.3.1 Sampling Importance Resampling (SIR) . . . . . . . . . . . . . . . . 74
6.3.2 Direct Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76