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

📄 mess_d.m

📁 计量工具箱
💻 M
字号:
% PURPOSE: An example of using mess() on a small dataset%          matrix exponential spatial specification%                              %---------------------------------------------------% USAGE: mess_d%---------------------------------------------------% load Anselin (1988) Columbus neighborhood crime dataload anselin.dat; n = length(anselin);x = [ones(n,1) anselin(:,2:3)]; latt = anselin(:,4);long = anselin(:,5);vnames = strvcat('crime','constant','income','hvalue');load wmat.dat; W = sparse(wmat(:,1),wmat(:,2),wmat(:,3));;% do Monte Carlo generation of an SAR modelsige = 100; evec = randn(n,1)*sqrt(sige);beta = ones(3,1);rho = 0.6; lam = 0.25; A = eye(n) - rho*W;  AI = inv(A);y = AI*x*beta + AI*evec; % generate some data% do MESS model using W as weight matrixoption.D = W;res1 = mess(y,x,option);prt(res1,vnames);% do MESS model using latt, long and neighbors% to form a weight matrixoption2.latt = latt;option2.long = long;option2.rho = 0.75;option2.neigh = 7;res2 = mess(y,x,option2);prt(res2,vnames);% do MESS model with spatially lagged x-variablesoption3.latt = latt;option3.long = long;option3.rho = 0.9;option3.neigh = 10;option3.xflag = 1;res3 = mess(y,x,option3);prt(res3,vnames);

⌨️ 快捷键说明

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