首页 > 其他 > 详细

Granger Causality

时间:2020-08-06 09:18:27      阅读:75      评论:0      收藏:0      [点我收藏+]

取阈值:首先进行回归分析,然后得到的参数,进行排序,根据极端冲击,负极端取0.1,正极端取0.9,作为相应变量的阈值

10个类别(9个是积极,正常,消极的组合,剩下一个是传统格兰特方法)

{shockprc:分类}

\[\begin{array}{l} \left(X_{t}^{+}, Y_{t}^{+}\right),\left(X_{t}^{+}, Y_{t}^{*}\right),\left(X_{t}^{+}, Y_{t}^{-}\right) \\left(X_{t}^{*}, Y_{t}^{*}\right),\left(X_{t}^{*}, Y_{t}^{-}\right),\left(X_{t}^{*}, Y_{t}^{+}\right) \\left(X_{t}^{-}, Y_{t}^{*}\right),\left(X_{t}^{-}, Y_{t}^{+}\right),\left(X_{t}^{-}, Y_{t}^{-}\right) \end{array}\]


时间序列的ADF检验:修正的?池信息准则(AIC)--HJC准则 lag length suggested by HJ--平稳性

\[\mathrm{HJC}=\ln \left(\left|\widehat{\Omega}_{j}\right|\right)+\mathrm{j}\left(\frac{n^{2} \ln T+2 n^{2} \ln (\ln T)}{2 T}\right), \mathrm{j}=0, \cdots, \mathrm{p} \]

{lag_length2}

input:矩阵(观测数据),lag length最小值,p为lag length最大值

output: hjclag - Lag length suggested by Hatermi-J criterion.

{hjcA} - Matrix of coefficient estimates 利用 HJC


{VARLAGS}:VAR(2)--根据分类所得的矩阵(两列)

input:lags,矩阵

output:x-根据lag输出input矩阵的一部分(T - lags) x K matrix, the last T-lags rows of var

\[Z_{t}:=\left(\begin{array}{c} 1 \P_{t}^{+} \P_{t-1}^{+} \\vdots \P_{t-p+1}^{+} \end{array}\right) \text {for } t=1 \ldots, T\]


{rstrctvm}:input:VAR()阶数,变量数,addlags--限制系数(Granger Causality in Multi-variate Time Series using a Time Ordered Restricted Vector Autoregressive Model)

\[H_{0}:C\beta=0 \]

\(C\) is a \(p*n(1=np)\) 指标符矩阵

----OUTPUT: 只含0/1的矩阵

Rvector1:A 1 indicates which coefficient is 限制到 zero; 0 is given 没有限制

(Rmatrix1)indicator matrix--\(C\)


{EstVar_Params}:为bootstraps提供数据

\[Y^{*}=\widehat{D} Z+\delta^{*} \]

Ahat:得到所需要的系数参数\(\widehat{A}\)

(1)首先在公式(3-37)成立的基础上,估计式(3-33)的系数,将残差保存
下来;
(2)等概率从(1)式保存的残差中抽样,并保证每一组残差样本的均值为 0,
以此方法来获得 bootstrap 样本 \(\hat{e}_{t}\);
(3)利用公式 \(Y^{*}=\hat{Y}_{t}^{+}+\hat{e}_{t},\) 通过 (1),(2) 估计得到的 \(\hat{Y}_{t}^{+}, \hat{e}_{t},\) 可以得到 bootstrap
数据;

leverages:保证正常的方差

\[\text { at } V=\left(Y_{-1}^{\prime}, \cdots, Y_{-k}^{\prime}\right) \text { and } V_{i}=\left(Y_{i,-1}^{\prime}, \cdots, Y_{i,-k}^{\prime}\right) \]

\[l_{1}=\operatorname{diag}\left(V_{1}\left(V_{1}^{\prime} V_{1}\right)^{-1} V_{1}^{\prime}\right), \text { and } l_{2}=\operatorname{diag}\left(V\left(V^{\prime} V\right)^{-1} V^{\prime}\right) \]


{W_test:}

\[\text { Wald }=(C \beta)^{\prime}\left[C(Z Z)^{-1} \otimes S_{U} C\right]^{-1}(C \beta) \]

input:y:data matrix based on lag ,x:lagged values for y

Ahat,Rmatrix1--\(C\)

output: Wstat - vector of Wald statistics(得到的W统计量)


{Bootstrap_Toda}

\[\hat{u}_{i t}^{m}=\frac{\hat{u}_{i t}}{\sqrt{1-l_{i t}}} \]

decent distribution

using the previously 确定的最佳 lag order for the original data and an assumed order of integration

假定的整合顺序

yhat = Xhat(2:size(Xhat,1),2:(numvars+1));
Xhat = Xhat(1:size(Xhat,1)-1,:);
[AhatTU,unneededleverage] = estvar_params(yhat,Xhat,0,0,order,addlags);%estvar_params
Wstat = W_test(yhat,Xhat,AhatTU,Rmatrix1);

:根据显著值分类0.01/0.005/0.1

    onepct_index = bootsimmax - floor(bootsimmax/100);
    fivepct_index = bootsimmax - floor(bootsimmax/20);
    tenpct_index = bootsimmax - floor(bootsimmax/10);

OUTPUT:
Wcriticalvals - matrix of critical values for Wald statistics(W统计量的临界值--分位点)

WW\(\leftarrow\)[得到的W统计量,W统计量的临界值]

利用循环做不同列的对比,取0/1--代表是否具有格兰特因果关系

Granger Causality

原文:https://www.cnblogs.com/zonghanli/p/13444135.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!