Page 1 of 1

VAR model with time varying coefficients

Posted: Thu Jul 28, 2011 4:30 pm
by lisa
Good evening,
Please can I estimate a VAR model with time varying coefficients. For ex, a VAR(2) model
y(t)=A0(t)+ A1(t) y(t-1)+A2(t) y(t-2)+u(t)
have the state space form:
y(t)=X(t) B(t)+u(t)
B(t)=B(t-1)+v(t)
where: X(t)=(1*In, y'(t-1)*In, y'(t-2)*In)
B(t)=vec (A0(t),A1(t),A2(t))
* is the kronecker product
Please if any one know how to estimate this model help me.
Thanks a lot.

Re: VAR model with time varying coefficients

Posted: Thu Jul 28, 2011 4:55 pm
by startz
You'll need to read about setting up a State Space object.

Re: VAR model with time varying coefficients

Posted: Thu Jul 28, 2011 5:12 pm
by lisa
I know how to estimate an univariate model (for example an AR(2) with time varying coefficients) using a state space object but not a multivariate (VAR) one.

Re: VAR model with time varying coefficients

Posted: Thu Jul 28, 2011 5:42 pm
by startz
Add one signal equation for each endogenous variable, and the accompanying state equations for the time-varying coefficients.

Re: VAR model with time varying coefficients

Posted: Fri Jul 29, 2011 3:05 am
by lisa
The method is maximum likelihood estimation based on the kalman filter, so I think that I can't estimate the model equation by equation.

Re: VAR model with time varying coefficients

Posted: Fri Jul 29, 2011 6:53 am
by startz
The method is maximum likelihood estimation based on the kalman filter, so I think that I can't estimate the model equation by equation.
I'm afraid I don't understand.

Re: VAR model with time varying coefficients

Posted: Fri Jul 29, 2011 7:42 am
by lisa
Please can you give me some details; I'm really lost and I don't inderstand how to start.
It's urgent, I need the result as soon as possible.
Thank you again.

Re: VAR model with time varying coefficients

Posted: Fri Jul 29, 2011 8:12 am
by startz
Why don't you show us the EViews state space model you'd use for a univariate model, say a VAR(2) with one endogenous variable, and maybe someone can show you how to extend it.

Re: VAR model with time varying coefficients

Posted: Fri Jul 29, 2011 9:14 am
by lisa
for an AR(2) model:
x(t)=a(t) x(t-1)+b(t) x(t-2)+u(t)
where: a(t)=a(t-1)+v(t)
b(t)=3 b(t-2)+w(t)
the program eviews is:
@signal x=a*x(-1)+b*x(-2)+[var=exp(c(1))]
@state a=a(-1)+[var=exp(c(2))]
@state b=3*b(-2)+[var=exp(c(3))]


It is possible to extend this program to estimate the VAR model?

Re: VAR model with time varying coefficients

Posted: Fri Jul 29, 2011 9:35 am
by startz
for an AR(2) model:
x(t)=a(t) x(t-1)+b(t) x(t-2)+u(t)
where: a(t)=a(t-1)+v(t)
b(t)=3 b(t-2)+w(t)
the program eviews is:
@signal x=a*x(-1)+b*x(-2)+[var=exp(c(1))]
@state a=a(-1)+[var=exp(c(2))]
@state b=3*b(-2)+[var=exp(c(3))]


It is possible to extend this program to estimate the VAR model?
I tried your program in EViews and it doesn't run.
Nonetheless, you might try extensions along the lines of

Code: Select all

@signal x1=a11*x1(-1)+b11*x1(-2)+a21*x2(-1)+b21*x2(-2)+[var=exp(c(1))] @signal x2=a12*x1(-1)+b12*x1(-2)+a22*x2(-1)+b22*x2(-2)+[var=exp(c(1))]

Re: VAR model with time varying coefficients

Posted: Fri Jul 29, 2011 5:07 pm
by lisa
thank you very much

Re: VAR model with time varying coefficients

Posted: Wed Feb 12, 2014 2:16 pm
by SeaWill
I'm using eviews 7.2 to estimate a tvp-VAR. The suggestion to include multiple signals is giving me a near sigular matrix.
My code is as follows:

sspace sspace1

sspace1.append @PARAM C(1) -.004726 C(2) .026090 C(3) -.134251 C(4) .917922 C(5) .1 c(6) .159931

sspace1.append @signal Z9 = c(1)*Z9(-1) + c(2)*Z9(-2) + sv1*pc1n(-1) + sv2*pc1n(-2) + sv3*pc2n(-1) + sv4*pc2n(-2) + sv5*pc3n(-1) + sv6*pc3n(-2) + [ename = e1]
sspace1.append @signal pc1n = sv1*Z9(-1) + sv2*Z9(-2) + sv1*pc1n(-1) + sv2*pc1n(-2) + sv3*pc2n(-1) + sv4*pc2n(-2) + sv5*pc3n(-1) + sv6*pc3n(-2) + [ename = e1]
sspace1.append @signal pc2n = sv1*Z9(-1) + sv2*Z9(-2) + sv1*pc1n(-1) + sv2*pc1n(-2) + sv3*pc2n(-1) + sv4*pc2n(-2) + sv5*pc3n(-1) + sv6*pc3n(-2) + [ename = e1]
sspace1.append @signal pc3n = sv1*Z9(-1) + sv2*Z9(-2) + sv1*pc1n(-1) + sv2*pc1n(-2) + sv3*pc2n(-1) + sv4*pc2n(-2) + sv5*pc3n(-1) + sv6*pc3n(-2) + [ename = e1]

sspace1.append @state sv1 = c(3) + c(4)*sv1(-1) + [ename = e2]
sspace1.append @state sv2 = c(5) + c(6)*sv2(-1) + [ename = e3]
sspace1.append @state sv3 = c(7) + c(8)*sv3(-1) + [ename = e4]
sspace1.append @state sv4 = c(9) + c(10)*sv4(-1) + [ename = e5]
sspace1.append @state sv5 = c(11) + c(12)*sv5(-1) + [ename = e6]
sspace1.append @state sv6 = c(13) + c(14)*sv6(-1) + [ename = e7]

sspace1.append @evar cov(e2, e3, e4, e5, e6) = exp(c(15))
sspace1.append @evar var (e2) = exp(c(16))
sspace1.append @evar var (e3) = exp(c(17))
sspace1.append @evar var (e4) = exp(c(18))
sspace1.append @evar var (e5) = exp(c(19))
sspace1.append @evar var (e6) = 0.1


any suggestions?