⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mess_g3d.asv

📁 计量工具箱
💻 ASV
字号:
% PURPOSE: An example of using mess_g3() on a small dataset% Gibbs sampling the matrix exponential spatial model% using Anselin's Columbus crime data% this function samples over both rho and #neighbors% to produce a joint posterior for all parameters in the model%                              %---------------------------------------------------% USAGE: mess_g3d%---------------------------------------------------clear all;% load Anselin (1988) Columbus neighborhood crime dataload anselin.dat;y = anselin(:,1);  n = length(y);x = [ones(n,1) anselin(:,2:3)];xc = anselin(:,4); % x-coordinatesyc = anselin(:,5); % y-coordinatesvnames = strvcat('crime','constant','income','hvalue');  % do Bayesian MCMC estimatendraw = 2500;nomit = 500;option.latt = xc;option.long = yc;option.mmin = 1;option.mmax = 10;option.rmin = .5;option.rmax = 1;res1 = mess_g3(y,x,option,ndraw,nomit);prt(res1,vnames);hist(res1.adraw);title('posterior distribution for alpha');pause;hist(res1.rdraw);title('posterior distribution for rho');pause;hist(res1.mdraw);title('posterior distribution for neigh');pause;option.xflag = 1;res2 = mess_g3(y,x,option,ndraw,nomit);prt(res2,vnames);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -