I need to implement a formula that take quarterly data (e.g. AA) and is multiplied with the mean of the previous YEAR (NOT the last 4 values!!), which seems difficult to implement, in particular if I would add the formula to a model.
In case that I take only the previous value (instead of the mean of the previous year) it is easy
Code: Select all
genr AGG=AA*AB(-1)/AC(-1)+BA*BB(-1)/AC(-1)
model.append AGG=AA*AB(-1)/AC(-1)+BA*BB(-1)/AC(-1)
Then I tried at least for ex-post data to calculate the formula
'if we calculate the mean over the previous YEAR
Code: Select all
for !i=0 to 100
smpl 1991.1+!i 1991.4+!i 'ex post
series mean_AB=@mean(AB)
series mean_BB=@mean(BB)
series mean_AC=@mean(AC)
!i=!i+3
next '--> this gives you the same (mean) value in each quarter
genr AGG=AA*mean_AB(-4)/mean_AC(-4)+BA*mean_BB(-4)/mean_AC(-4)
model.append '?????
But in which way I can add this to a model which will run over the next years?
Any suggestions for improvement and simplification?