comac wrote:Tom, I guess I am pretty close but I would need a final hint from you.
In the codes below I've run the program making all the computations. I would expect however that when I ask RATS to compute 'betauip', it would do it for each draw (so that I could have a distribution). Unfortunately the program does not expect 'comp betauip(draw)' but simply 'comp betauip'. So in the end I finish up with just one value and not a series.
Could you please have a look at that? Many thanks
First, a couple of minor points:
compute V_inn = (VCV~%zeros(5,5))~~%zeros(5,10)
could be more conveniently written
compute V_inn = (VCV~\%zeros(5,5))
since that would automatically give you the zeros in the non-diagonal part.
dec vector eds(10)
comp eds = ||1|0|0|0|0|0|0|0|0|0||
dec vector ei(10)
comp ei = ||0|1|0|0|0|0|0|0|0|0||
dec vector eistar(10)
comp eistar = ||0|0|1|0|0|0|0|0|0|0||
dec vector edp(10)
comp edp = ||0|0|0|1|0|0|0|0|0|0||
dec vector edpstar(10)
comp edpstar = ||0|0|0|0|1|0|0|0|0|0||
Use the %UNITV function:
comp eds = %unitv(10,1)
comp ei = %unitv(10,2)
...
The following are specific to the impulse responses. You don't need them:
declare vect[rect] %%responses
dim %%responses(bootdraws)
declare rect[series] impulses(nvar,nvar)
declare vect ix
What you
do need is
dec vect[vect] betauip(bootdraws)
(or just vect if betauip is a scalar)
and then
compute betauip
(draw) = tr(eds)*C*PHI*(ei-eistar)/120*inv(tr(ei-eistar)*PHI*(ei-eistar))
inside the loop.