資源簡介
TVP-VAR模型的MATLAB代碼,修改變量與數據可以直接運行,很方便!

代碼片段和文件信息
%%--------------------------------------------------------%%
%%????????????????????TVP-VAR?package?????????????????????%%
%%--------------------------------------------------------%%
%%
%%??[]?=?drawimp(vt?fldraw)
%%
%%??“drawimp“?draws?time-varying?impulse?response
%%
%%??[input]
%%???(fldraw?=?1)
%%?????vt:???m*1?vector?of?horizons?to?draw?impulse
%%???(fldraw?=?0)
%%?????vt:???m*1?vector?of?time?points?to?draw?impulse
%%
function?[]?=?drawimp(vt?fldraw)
global?m_ns?m_nk?m_nl?m_asvar;
ns?=?m_ns;??
nk?=?m_nk;?
nl?=?m_nl;?
mimpr?=?xlsread(‘tvpvar_imp.xlsx‘);
mimpm?=?mimpr(:?3:end);
nimp?=?size(mimpm?1)?/?m_ns;
mline?=?[0?.5?0;?0?0?1;?1?0?0;?0?.7?.7];
vline?=?{‘:‘?‘--‘?‘-‘?‘-.‘};
nline?=?size(vt?2);
????
figure
for?i?=?1?:?nk
??for?j?=?1?:?nk
????id?=?(i-1)*nk?+?j;
????mimp?=?reshape(mimpm(:?id)?nimp?ns)‘;
????subplot(nk?nk?id);
????if?fldraw?==?1
????????
??????for?k?=?1?:?nline
????????plot(mimp(:?vt(k)+1)?char(vline(k))?...
?????????????‘Color‘?mline(k?:))
????????hold?on
??????end
??????vax?=?axis;
??????axis([nl+1?ns+1?vax(3:4)])
??????if?vax(3)?*?vax(4)?0
????????line([nl+1?ns+1]?[0?0]?‘Color‘?ones(13)*0.6)
??????end
??????if?id?==?1
????????vlege?=?[‘-period?ahead‘];
????????for?l?=?2?:?nline
??????????vlege?=?[vlege;?‘-period??????‘];
????????end
????????legend([num2str(vt‘)?vlege])
??????end
????else
????????
??????for?k?=?1?:?nline
????????plot(0:nimp-1?mimp(vt(k)?:)?char(vline(k))?...
?????????????‘Color‘?mline(k?:))
????????hold?on
??????end
??????vax?=?axis;
??????axis([0?nimp-1?vax(3:4)])
??????if?vax(3)?*?vax(4)?0
????????line([0?nimp-1]?[0?0]?‘Color‘?ones(13)*0.6)
??????end
??????if?id?==?1
????????vlege?=?[‘t=‘];
????????for?l?=?2?:?nline
??????????vlege?=?[vlege;?‘t=‘];
????????end
????????legend([vlege?num2str(vt‘)])
??????end
????????
????end
????hold?off
????title([‘$\varepsilon_{‘?char(m_asvar(i))?...
???????????‘}\uparrow\?\rightarrow\?‘?...
???????????char(m_asvar(j))?‘$‘]?‘interpreter‘?‘latex‘)
??end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????2104??2018-10-26?15:57??tvpvar_m\drawimp.m
?????文件?????????631??2018-10-26?15:55??tvpvar_m\fAt.m
?????文件?????????768??2018-10-26?15:55??tvpvar_m\fGeweke.m
?????文件?????????544??2018-10-26?15:55??tvpvar_m\finvm.m
?????文件?????????872??2018-10-26?15:55??tvpvar_m\ftsvar.m
?????文件?????????534??2018-10-26?15:55??tvpvar_m\fXh.m
?????文件?????????559??2018-10-26?15:55??tvpvar_m\fXt.m
?????文件????????1197??2018-10-26?15:55??tvpvar_m\impulse.m
?????文件???????14080??2018-10-26?15:55??tvpvar_m\mcmc.m
?????文件????????2390??2018-10-26?15:55??tvpvar_m\setvar.m
?????文件????????2871??2018-10-26?15:55??tvpvar_m\ssmooth.m
?????文件????????5542??2018-10-26?15:57??tvpvar_m\svsamp.m
?????文件???????20285??2018-10-26?15:59??tvpvar_m\tvpvar_a.xlsx
?????文件???????20178??2018-10-26?15:59??tvpvar_m\tvpvar_ai.xlsx
?????文件???????12966??2018-10-26?15:55??tvpvar_m\tvpvar_ex.xlsx
?????文件?????????952??2018-10-26?15:59??tvpvar_m\tvpvar_ex1.m
?????文件????????1166??2018-10-26?15:55??tvpvar_m\tvpvar_ex2.m
?????文件??????228309??2018-10-26?15:59??tvpvar_m\tvpvar_imp.xlsx
?????文件???????48209??2018-10-26?15:55??tvpvar_m\tvpvar_m.pdf
?????文件???????20204??2018-10-26?15:59??tvpvar_m\tvpvar_vol.xlsx
?????文件????????1669??2018-10-26?15:58??tvpvar_m\TVPVAR-Package.m
- 上一篇:Matlab關于csi信道信息獲取
- 下一篇:matlab讀xm
l文檔
評論
共有 條評論