large panel dynamic factor model

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

basil2013
Posts: 7
Joined: Wed Jul 03, 2013 3:04 am

large panel dynamic factor model

Postby basil2013 » Tue Jul 09, 2013 9:40 am

Hi

I am working on dynamic factor models, using sspace and a large panel of time series as observation variables, and I am looking for a method to define the signal and state equations within loops.

The problem is as follows:

in matrix notation the observation equation is:
X(t) = A*F(t) + e(t), where the dimensions are: X(t) - nx1, A - nxr, F(t) - rx1, e(t) - nx1

and the state equation is:
F(t) = B*F(t-1) + u(t), where the dimensions are: B - rxr (or r*lags x r*lags if I have more lags), u(t) - qx1

thus, I have to specify n signal equations with r+1 (r columns of F plus constant term) terms plus the error term
and r state equations with r terms plus the error term

Specifying the n and r equations accordingly doesn't seem to be a problem as I use the following for example:

for !i = 1 to !n
' define observation equation
ss1.append @signal sig{!i} = c({count1}) + c({count2})*sv_1 + c({count3})*sv_2 + e{!i}
next

where count1 etc come from previous calculations where I keep track of the total number of parameters. The problem seems to be the specification of the RHS terms. Here I have only 2+1+1 terms, but how do I deal with r+1+1 terms? That is, can I create a loop where I give r as input and it gives:

ss1.append @signal sig{!i} = c({count1}) + c({count2})*sv_1 + c({count3})*sv_2 +...+ c({count(r-1)})*sv_r + e{!i}

I had posted a related enquiry under ‘increasing number of regressors’ where I wanted to add terms on the RHS of the regression equation and the trick was to regress the LHS on a group of series, RHS, where RHS was constructed using RHS.add nameofseries in a loop.

Hence, I am looking for a similar way to create the right hand side of the @signal and @state equations.

I would appreciate any help.

Cheers

basil2013
Posts: 7
Joined: Wed Jul 03, 2013 3:04 am

Re: large panel dynamic factor model

Postby basil2013 » Wed Jul 10, 2013 7:14 am

Hi again

I just want to be more specific with the problem above, I want to know how to create the right hand of the following equation

ss1.append @signal sig{!i} = c({count1}) + c({count2})*sv_1 + c({count3})*sv_2 +...+ c({count(r+1)})*sv_r + e{!i}

hence I am looking for something that looks like this:

for !i = 1 to !n
for !j = 1 ro !r
ss1.append @signal sig{!i} = .............
next
next

If i cannot add terms directly on ss1.append @signal sig{!i} = ... , is it possible to somehow create the RHS as a string and then place next to '=' ? In this way I could potentially build any (meaningful) RHS terms.

Gareth can you help? I would appreciate your expertise.

Cheers


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest