完全的matlab菜鸟,用matlab做空间面板时程序出现下面的错误,不知道如何解决,求大神指导!!!
程序:
% dimensions of the problem
T=15; % number of time periods
N=17; % number of regions
% row-normalize W
W=normw(w2); % function of LeSage
y=pc(:,[1]); % column number in the data matrix that corresponds to the dependent variable
x=pc(:,[2]); % column numbers in the data matrix that correspond to the independent variables
xconstant=ones(N*T,1);
[nobs K]=size(x);
% ----------------------------------------------------------------------------------------
% ols estimation
results=ols(y,[xconstant x]);
vnames=strvcat('lngdp','intercept','lnfdi');
prt_reg(results,vnames,1);
sige=results.sige*((nobs-K)/nobs);
loglikols=-nobs/2*log(2*pi*sige)-1/(2*sige)*results.resid'*results.resid
LMsarsem_panel(results,W,y,[xconstant x]); % (Robust) LM tests
%moran 检验
I=eye(T);W1=kron(I,W);
res=moran(y,[xconstant x],W2);
prt(res);
出现的问题:
未定义与 'double' 类型的输入参数相对应的函数 'normw'。
matlab版本是2014a,不知道是不是版本的问题???数据类型是double型。跪求指导。