【MCMC】基于贝叶斯优化的自适应MCMC算法仿真

1.软件版本

matlab2013b

2.本算法理论知识

首先参考文献《[1] Mahendran N ,  Wang Z ,  Hamze F , et al. Adaptive MCMC with Bayesian Optimization[C]// 2012.》

这个程序是我们的算法的整体上的实现,即论文中的

下面进行介绍和分析:

这个是主要的程序,每一行对应的注释,就是对应的上述的algorithm的各个步骤

 这个主函数下对应的如下几个子函数,这几个子函数只需要了解大概的功能就可,具体参数实现过程

1功能: 更新GP的统计参数

2功能: 论文中的说的高斯过程

3功能: 计算的程序

4功能: 马尔科夫链的程序

5功能: 画出马尔科夫链的图像效果显示。

3.部分源码

clc;
clear;
close all;
warning off;
addpath 'func\'


I     = 10;
nsimu = 1e4; 
npar  = 20;
D     = cell(1,I);
for i = 1:I
    %Run Markov chain for L steps with parameters θ
    chain = Markov_chain(nsimu,npar);
    %Use the drawn samples to obtain a noisy evaluation of the objective function: z
    noisy_evaluation = randn(size(chain))/100;
    Z     = func_h(chain) + noisy_evaluation;
    %Augment the data
    D{i}  = [chain;Z];
    %Update the GP’s su?cient statistics.
    D2{i} = func_GP(D{i});
    %Find θi+1by optimizing an acquisition function:
    thetamax{i} = func_optimizing(D2{i});
end
 
figure(1);
mcmcplot(thetamax{1},[],{'\theta_1'},'chainpanel')

4.仿真分析

5.参考文献

[1] Mahendran N ,  Wang Z ,  Hamze F , et al. Adaptive MCMC with Bayesian Optimization[C]// 2012.A16-42

猜你喜欢

转载自blog.csdn.net/ccsss22/article/details/125012555