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

📄 mess_g3d2.m

📁 计量工具箱
💻 M
字号:
% PURPOSE: An example of using mess_g3() on a large dataset%          Bayesian matrix exponential spatial model%---------------------------------------------------% USAGE: mess_g3d2 (see mess_g3d for a small data set)%---------------------------------------------------clear all;% NOTE a large data set with 3107 observations% from Pace and Barry, % test MCMC sampling on pace and barry data setclear all;load elect.dat;             % load data on votesy =  (elect(:,7)./elect(:,8));x1 = log(elect(:,9)./elect(:,8));x2 = log(elect(:,10)./elect(:,8));x3 = log(elect(:,11)./elect(:,8));n = length(y); x = [ones(n,1) x1 x2 x3];latt = elect(:,5);long = elect(:,6);vnames = strvcat('voters','const','educ','homeowners','income');clear elect;option.latt = latt;option.long = long;option.mmin = 25;option.mmax = 37;option.rmin = 0.8;option.rmax = 1;option.xflag = 1; % include spatial lags of x-variablesndraw = 5000; % if you're impatient, decrease thisnomit = 1000; % and this as well, 1250 and 250 should workres1 = 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;

⌨️ 快捷键说明

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