time-varying coefficients in a linear model

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
hipolit
Posts: 6
Joined: Tue Jun 07, 2011 5:24 am

time-varying coefficients in a linear model

Unread post by hipolit »

I want to estimate a linear model with time-varying coefficients

Y_t = alfa_t + beta_t*X1_t + lambda_t*X2_t

The programa I use is the following

Code: Select all

Allocate 574
open data c:\HED9809.xls
data(format=xls,org=obs) / Y X1 X2

nonlin alfa beta lambda v walfa wbeta wlambda

*I introduce the following values for initialization 

compute  ALFA = -0.001, BETA = 0.6, LAMBDA = 1.0, V = 0.002,WALFA = 0.0004, WBETA = 0.8, WLAMBDA=0.35

declare symmetric sw
compute sw=%DIAG(||walfa,wbeta,wlambda||)

dec frml[rect] a
frml a = ||1.0, 0.0, 0.0|0.0, 1.0, 0.0|0.0, 0.0, 1.0||

dlm(y=lnds,c=||1.0,X1,X2||,a=a,sv=v,sw=sw,type=smooth,method=BFGS,condition=4) / xstates vstates

*THE RESULT IS THE FOLLOWING

Code: Select all

DLM - Estimation by BFGS
Convergence in     7 Iterations. Final criterion was  0.0000027 <=  0.0000100
Usable Observations                       570
Rank of Observables                       570
Log Likelihood                       620.6579

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  ALFA                         -0.001000000  0.000000000      0.00000  0.00000000
2.  BETA                          0.600000000  0.000000000      0.00000  0.00000000
3.  LAMBDA                        1.000000000  0.000000000      0.00000  0.00000000
4.  V                             0.000579180  0.000122125      4.74253  0.00000211
5.  WALFA                         0.000400000  0.000000000      0.00000  0.00000000
6.  WBETA                         0.800000000  0.000000000      0.00000  0.00000000
7.  WLAMBDA                       0.350000000  0.000000000      0.00000  0.00000000

*AS CAN BE SEEN THE ESTIMATION DOES NOT PROGRESS FROM ITS INITIAL VALUES.

*HOW CAN I IMPROVE THE PROGRAM?

I am sure it is a basic mistake. I write in this forum after several days trying to find a solution by myself. Any suggestion is very welcomed.
Last edited by hipolit on Tue Apr 23, 2013 7:42 am, edited 1 time in total.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: time-varying coefficients in a linear model

Unread post by TomDoan »

You have A as a FRML when it's fixed, and SW as fixed when it's a FRML (depends upon parameters). The setup for those two should read:

declare frml[symm] sw
frml sw = %DIAG(||walfa,wbeta,wlambda||)

dec rect a
compute a = ||1.0, 0.0, 0.0|0.0, 1.0, 0.0|0.0, 0.0, 1.0||


What are the alfa, beta and lambda in the parameter set supposed to do? As written currently, they don't enter the calculation at all.
hipolit
Posts: 6
Joined: Tue Jun 07, 2011 5:24 am

Re: time-varying coefficients in a linear model

Unread post by hipolit »

Thank you very much
Now:
alfa beta and lambda are the time-varying parameters.
How can I introduce them if the linear equation to estimate is

Y_t = alfa_t +beta_t*X1_t+lambda_t*X2_t

Thanks in advance
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: time-varying coefficients in a linear model

Unread post by TomDoan »

Those are your three state variables. You might want to look at http://www.estima.com/forum/viewtopic.p ... 381&p=1739.
hipolit
Posts: 6
Joined: Tue Jun 07, 2011 5:24 am

Re: time-varying coefficients in a linear model

Unread post by hipolit »

Thank you, now is ok! :)
Post Reply