如果你有安装Matlab garch toolbox,则GJR (P,Q)model 应该是你所要的.
里面即有 Source code可供你参考.
% Consider the following general ARMAX(R,M,nX)/GJR(P,Q) form:
% y(t) = C + AR(1)y(t-1) + ... + AR(R)y(t-R) + e(t)
% + MA(1)e(t-1) + ... + MA(M)e(t-M) + B(1)X(t,1) + ... + B(nX)X(t,nX)
% h(t) = K + G(1)h(t-1) + ... + G(P)h(t-P)
% + A(1)e(t-1)^2 + ... + A(Q)e(t-Q)^2
% + L(1)[e(t-1) < 0]e(t-1)^2 + ... + L(Q)[e(t-Q) < 0]e(t-Q)^2
%
% where the terms [e(t-i) < 0] are Boolean indicators that equal 1 when
% e(t-i) < 0 and 0 when e(t-i) >= 0. These provide the asymmetric leverage
% response to negative shocks.