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

📄 moran_d.m

📁 计量工具箱
💻 M
字号:
% PURPOSE: An example of using moran()
%          to test for spatial error correlation
%          on a small data set                   
%---------------------------------------------------
% USAGE: moran_d
%---------------------------------------------------


load anselin.dat;

y = anselin(:,1);
n = length(y);

x = [ones(n,1) anselin(:,2:3)];

xc = anselin(:,4);
yc = anselin(:,5);
[j W j] = xy2cont(xc,yc);

result = moran(y,x,W);
prt(result);


% demo non-standardized weight matrix
Wns = zeros(n,n);
for i=1:n
   for j=1:n
    if W(i,j) ~= 0
      Wns(i,j) = 1.0;
    end;
   end;
end;

result = moran(y,x,Wns);
prt(result);


⌨️ 快捷键说明

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