📄 raftery_d.m
字号:
% PURPOSE: demo of raftery()% Raftery and Lewis convergence diagnostics% %---------------------------------------------------% USAGE: raftery_d%---------------------------------------------------n=100; k=3; % set number of observations and variablesrandn('seed',10101);x = randn(n,k); b = ones(k,1); % generate data setrandn('seed',20201);y = x*b + randn(n,1);ndraw = 600; nomit = 100; % set the number of draws r = [1.0 1.0 1.0]'; % prior b meansR = eye(k); T = eye(k); % prior b variance rval = 2; % hetroscedastic prior for r-valueprior.beta = r;prior.bcov = T;prior.rmat = R;prior.rval = rval;% generate some Gibbs drawsresult = ols_g(y,x,ndraw,nomit,prior);vnames = strvcat('beta1','beta2','beta3');q = 0.025; r = 0.005; s = 0.95;res = raftery(result.bdraw,q,r,s);prt(res,vnames);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -