楼主: cymbidium
84205 185

[吴玉鸣] 欢迎清华大学博士后,华东理工大学商学院(原西南城市与区域发展研究中心)吴玉鸣教授 [推广有奖]

131
吴玉鸣 在职认证  发表于 2011-6-27 22:18:43
lxq1212 你好!
    确实是读取数据的语句。你修改成你自己的打算模拟的数据文件格式就行。譬如:xlread cigardemo.xls; xlread spat-sym-us.xls,视你使用的数据的格式来定!
第十届空间统计与空间计量经济分析培训研讨会成功举办。 http://ecust.mooc.chaoxing.com/

132
凤凰翔天 在职认证  发表于 2011-6-29 12:27:57
吴老师讲解的很详细,谢谢!我也明白在Matlab中怎样读取数据了

133
zcyouwillwin 发表于 2011-7-22 15:20:41
吴老师您好:想问一下在matlab空间计量工具箱中做空间面板计量的程序中只有关于截距项的固定和随机效应模型,没有固定效应变系数模型的程序么?有什么材料可以参考么?想做变系数模型要用什么函数呢?有没有相关程序可以下载呢?

134
pingadmire 发表于 2011-7-22 16:18:31
欢迎吴教授,吴教授的到来,一会给论坛带来新的内容。

135
zcyouwillwin 发表于 2011-7-22 17:11:39
125# 吴玉鸣
吴老师您好:想问一下在matlab空间计量工具箱中做空间面板计量的程序中只有关于截距项的固定和随机效应模型,没有固定效应变系数模型的程序么?有什么材料可以参考么?想做变系数模型要用什么函数呢?有没有相关程序可以下载呢?

136
吴玉鸣 在职认证  发表于 2011-7-22 22:36:13

RE:

楼上你好!
据我所知,目前尚未开发出变系数的空间面板计量经济模型的程序。
第十届空间统计与空间计量经济分析培训研讨会成功举办。 http://ecust.mooc.chaoxing.com/

137
zcyouwillwin 发表于 2011-7-23 12:01:21
137# 吴玉鸣

谢谢吴老师!

138
吴玉鸣 在职认证  发表于 2011-7-23 22:08:21

不用客气!

可以先计算出空间滞后项WY或空间误差项Wu等,然后使用Eviews或Stata等软件的面板数据变系数模型的估计技术来估计参数!
第十届空间统计与空间计量经济分析培训研讨会成功举办。 http://ecust.mooc.chaoxing.com/

139
wuchangtianke 发表于 2011-7-29 09:56:52
您好,吴老师,这是我在网上找的LM lag PANAL 命令,但是我不知道如何修改部分参数以适应我自己的数据,直接运行之后出现这样一行字:
??? Error using ==> lmlag_panel
Wrong # of arguments to lmlag_panel。不知道该怎么办?谢谢您



LM lag panal命令如下


function result = lmlag_panel(y,x,W)% PURPOSE: LM lag statistic for omitted spatial lag
%          of a panel regression model
% ---------------------------------------------------
%  USAGE: result = lmlag(y,x,W)
%  where: y = dependent variable vector
%         x = independent variables matrix
%         W = contiguity matrix (standardized)
% ---------------------------------------------------
%  RETURNS: a structure variable
%         result.meth = 'lmlag_panel'
%         result.lm   = LM statistic
%         result.prob = marginal probability
%         result.chi1 = 6.635 (chi-squared 1 dof at 99% level)
%         result.nobs = # of observations
%         result.nvar = # of variables
% ---------------------------------------------------
% NOTE: lm > 6.635,  => small prob,
%                    => reject HO: of no spatial correlation
% ---------------------------------------------------
% See also:  walds, lratios, moran
% ---------------------------------------------------
% REFERENCES: Elhorst JP (2009) Spatial Panel Data Models. In Fischer MM,
% Getis A (Eds.) Handbook of Applied Spatial Analysis, pp. 377-407.
% Springer: Berlin Heidelberg New York. http://www.springerlink.com/content/u8086626076458v0/
% ---------------------------------------------------


% written by:


% Donald J. Lacombe
% Research Associate Professor
% Regional Research Institute
% 886 Chestnut Ridge Road
% PO Box 6825
% Morgantown, WV 26506-6825
% donald.lacombe@mail.wvu.edu


% Based on the lmerror code of James P. LeSage
% jlesage@spatial-econometrics.com


if nargin ~= 3
error('Wrong # of arguments to lmlag_panel');
end;


[N C] = size(W);
T = length(y)/N;
NT = N*T;
[junk k] = size(x);


xpxi = (x'*x)\eye(k);      % Faster way of computing inv(x'*x)
b = xpxi*(x'*y);           % OLS coefficients
M = speye(NT) - x*xpxi*x';   % M matrix
e = M*y;                   % Calculate residuals
sighat = (e'*e)/NT;        % Calculate sigma hat


It = speye(T);
ItWn = kron(It,W);


Tw = trace(W*W + W'*W);                                  % Tw in Elhorst
term1 = [((ItWn)*x*b)'*M*(ItWn)*x*b+(T*Tw*sighat)];      
J = (1/(sighat))*term1;                                  % J term in Elhorst
lm1 = (e'*(ItWn)*y)/sighat;                              % Equation (11) Elhorst
lmlag = (lm1*lm1)*(1/(J));                               % Equation (11) Elhorst
prob = 1-chis_prb(lmlag,1);




result.meth = 'lmlag_panel';
result.lm = lmlag;
result.prob = prob;
result.chi1   = 6.64;
result.nobs = NT;
result.nvar = k;
result.T    = T;

redirect.php?goto=findpost&pid=9754590&ptid=306098]139#[/url] 吴玉鸣

140
zcyouwillwin 发表于 2011-7-29 16:40:30
139# 吴玉鸣
  PURPOSE: uses x,y coordinates to produce spatial contiguity weight matrices
           with delaunay routine from MATLAB version 5.2
  ------------------------------------------------------
  USAGE: [w1 w2 w3] = xy2cont(xcoord,ycoord)
  where:     xcoord = x-direction coordinate
             ycoord = y-direction coordinate
  ------------------------------------------------------
  RETURNS:
           w1 = W*S*W, a symmetric spatial weight matrix (max(eig)=1)
           w2 = W*W*S, a row-stochastic spatial weight matrix, where S represents
                the adjacency matrix from Delaunay triangles (Voronoi tesselation).
           w3 = diagonal matrix with i,i equal to 1/sqrt(sum of ith row)
  ------------------------------------------------------
  References: Kelley Pace, Spatial Statistics Toolbox 2.0
  ------------------------------------------------------
老师 w1 w2 w3哪个才是所用到的空间权重矩阵呢

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
扫码
拉您进交流群
GMT+8, 2026-1-18 10:15