📄 bvar_d.m
字号:
% PURPOSE: An example of using bvar(), % to estimate a vector autoregressive model % (with Minnesota prior) %---------------------------------------------------% USAGE: bvar_d%---------------------------------------------------load test.dat; % a test data set containing % monthly mining employment for % il,in,ky,mi,oh,pa,tn,wv% data covers 1982,1 to 1996,5vnames = [' il', ' in', ' ky', ' mi', ' oh', ' pa', ' tn', ' wv']; y = test;[nobs neqs] = size(y);nlag = 2; % number of lags in var-modeltight = 0.1;decay = 0.1;weight = 0.5; % symmetric weights% this is an example of using 1st-order contiguity% of the states as weights as in LeSage and Pan (1995)% `Using Spatial Contiguity as Bayesian Prior Information % in Regional Forecasting Models'' International Regional % Science Review, Volume 18, no. 1, pp. 33-53, 1995.w = [1.0 1.0 1.0 0.1 0.1 0.1 0.1 0.1 1.0 1.0 1.0 1.0 1.0 0.1 0.1 0.1 1.0 1.0 1.0 0.1 1.0 0.1 1.0 1.0 0.1 1.0 0.1 1.0 1.0 0.1 0.1 0.1 0.1 1.0 1.0 1.0 1.0 1.0 0.1 1.0 0.1 0.1 0.1 0.1 1.0 1.0 0.1 1.0 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.1 0.1 0.1 1.0 0.1 1.0 1.0 0.1 1.0];% estimate the modelresults = bvar(y,nlag,tight,w,decay);% print results to a file% fid = fopen('bvar.out','wr');fid = 1;prt_var(results,vnames,fid);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -