I'm coming back with a question about indexes !
I understand that using matrices in which you pick a variable in the
appropriate row or column can be a substitute for a function which would
enable to shift indexes (like in Eviews, where you can write for example !j
= !i+1, whereas with Gretl I guess you always have to define first a matrix
to contain all the variables to which you refer in a script).
However, I don't think the same trick is applicable when you want to use
indexes for matrices (unless, maybe,you define first a "matrix of
matrices"). But isn't there a simpler way ? I may miss something, and it's
quite late, but I can't see how to do something simple with the following:
after having defined matrices X1, Y1, P1,Q1, T1, I want to create X2,
X3...X6; Y2...Y6 etc.
with recursive formulas:
loop for i = 2..7
(then define matrix Y$i = Y(i-1)' *Q(i-1)*T(i-1)
matrix X$i = X(i-1) - T(i-1)j*P(i-1)') and compute:
matrix A$i = X$i'*Y$i
matrix W$i = A$i * (inv(sqrt(sqrt(A$i'*A$i))))
matrix T$i = X$i*W$i
matrix P$i = X$i'*T$i * (inv(sqrt(T$i'*T$i)))
matrix Q$i = Y$i'*T$i*(inv(sqrt(T$i'*T$i)))
endloop
Don't you think it would be worth adding the possibility of re-indexing
variables ?
Thanks for your help
Show replies by date