• 大小: 7.02MB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2024-01-28
  • 语言: Matlab
  • 标签: matlab  空间计量  

资源简介

matlab空间计量软件包,可以在matlab中进行数学建模,进行面板数据的空间计量模型,同时可以完成在stata软件中无法完成的LM检验,即进行空间面板模型的LM检验,选择合适的空间面板模型。

资源截图

代码片段和文件信息

function results =  acf(xkp)
% PURPOSE: Estimate the coefficients of the autocorrelation 
%          (covariance with its own lagged value)
%          function up to a particular lag {Xk = Cov[YtYt-k]}
%--------------------------------------------------------------
% USAGE: results = acf(xk)
% where:      x = a time-series vector
%             k = maximun lag considered 
%             p = Plot autocorrelations
%                 p =  1 Plot function 
%--------------------------------------------------------------
% RETURNS: a results structure
%         results.meth  = ‘acf‘
%         results.ac    = autocorrelation coefficients   
%         results.k     = dimension of the lag considered
%         results.lowb  = lower bound for 95% confidence interval
%         results.Topb  = Top bound for 95% confidence interval
%         results.qstat = Ljung-Box Q Statistic
%         results.prob  = area under de chi^(2) distribution
%                         used in testing the existance of 
%                         autocorrelation for the kth lag. 
%
%--------------------------------------------------------------
% SEE ALSO: 
%--------------------------------------------------------------
% References: 
% * Judge G. Hill C. Griffiths W. L黷kepohl H. Tsoung-Chao L
%   Introduction to the Theory and Practice of Econometrics 
%   1988 pg. 681-690.
% * Hill C. Computer Handbook to Accompany Introduction to the Theory 
%   and Practice of Econometrics1988 pg. 158-159.

% error checking on inputs
results.meth= ‘acf‘;

if (nargin > 3)
   error(‘Wrong # of arguments to acf‘);
elseif(nargin == 3)
   p = 1;
elseif(nargin == 2) 
   p = 0;
else
   k = round(rows(x)/4);
end;
 
if  (cols(x) > 1)
 error(‘acf cannot handle a matrix -- only vectors‘);
end;

nobs = rows(x);
results.k = k; 
%center data
xc= x-mean(x);
%variance
v0= (xc‘*xc)/nobs; %not v0 = cov(x) see reference 

for i=1:k
   yt= xc(1:nobs-i1);
   ytk= xc(1+i:nobs1);
   ck = (yt‘*ytk)/nobs;
   xk(i1)=ck/v0;
   %ckbar = (yt‘*ytk)/(nobs-k); 
   %xkbar(k1)=ck/v0; %asymptotically equivalent to xk
end

results.ac=xk;

%Significance of xk (95% confidence intervals)
   results.lowb= -2/sqrt(nobs)*ones(k1);
   results.topb= 2/sqrt(nobs)*ones(k1);
   
%Diagnostics (Ljung & Box 1978) Q-Statistic
qstat=zeros(k+11);
for j=2:k+1
   qstat(j1) = (xk(j-11)^2)/(nobs-(j-1))+ qstat(j-11);
   prob(j1)=  1-chis_prb(abs((nobs*(nobs+2))*qstat(j1))j);
end

qstat=trimr((nobs*(nobs+2))*qstat10);
prob =trimr(prob10);
results.qstat=qstat;
results.prob=prob;



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2631  2012-04-23 22:43  kongjian\coint\acf.m

     文件       2512  2012-04-23 22:43  kongjian\coint\adf.m

     文件        420  2012-04-23 22:43  kongjian\coint\adf_d.m

     文件       2861  2012-04-23 22:43  kongjian\coint\cadf.m

     文件        661  2012-04-23 22:43  kongjian\coint\cadf_d.m

     文件       1935  2012-04-23 22:43  kongjian\coint\contents.html

     文件       1497  2012-04-23 22:43  kongjian\coint\contents.m

     文件      16526  2012-04-23 22:43  kongjian\coint\crthegy.m

     文件       3042  2012-04-23 22:43  kongjian\coint\c_sja.m

     文件       3523  2012-04-23 22:43  kongjian\coint\c_sjt.m

     文件       1306  2012-04-23 22:43  kongjian\coint\detrend.m

     文件       9004  2012-04-23 22:43  kongjian\coint\FinalConsumption.wk1

     文件       9970  2012-04-23 22:43  kongjian\coint\hegy.m

     文件      10461  2012-04-23 22:43  kongjian\coint\hegy.zip

     文件       1754  2012-04-23 22:43  kongjian\coint\hegy_d.m

     文件       6381  2012-04-23 22:43  kongjian\coint\johansen.m

     文件       6382  2012-04-23 22:43  kongjian\coint\johansen.mbak

     文件        851  2012-04-23 22:43  kongjian\coint\johansen_d.m

     文件       4164  2012-04-23 22:43  kongjian\coint\make_html.m

     文件       4033  2012-04-23 22:43  kongjian\coint\phillips.m

     文件       1009  2012-04-23 22:43  kongjian\coint\phillips_d.m

     文件       6124  2012-04-23 22:43  kongjian\coint\prt_coint.m

     文件       1060  2012-04-23 22:43  kongjian\coint\ptrend.m

     文件      13194  2012-04-23 22:43  kongjian\coint\rztcrit.m

     文件      22317  2012-04-23 22:43  kongjian\coint\test.dat

     文件       6040  2012-04-23 22:43  kongjian\coint\WS_FTP.LOG

     文件       6068  2012-04-23 22:43  kongjian\coint\ztcrit.m

     文件    9128430  2012-04-23 22:43  kongjian\data\agriculture.dat

     文件       2668  2012-04-23 22:43  kongjian\data\agriculture.txt

     文件       1669  2012-04-23 22:43  kongjian\data\anselin.dat

............此处省略1213个文件信息

评论

共有 条评论