Hi Gareth. Thanks for your response, sorry for the late answer, and I'll give it a second try.
The calculations I'm doing treat old, past data. I use series that contain values which change over time - one important case is GDP, which gets revised quite often and quite substantially. Thus, I need different 'versions' for one series, where the version is usually called "vintage" and defines, when this series was 'captured' or 'measured'.
Now imagine that starting from these GDP series, I want to calculate a filtered series for each vintage of GDP:
1. I start with different "vintages" for one series, i.e. GDP
- gdp_v1999q3
- gdp_v1999q4
where the series cover GDP values from around 1960s to 1999q3 in the first case, and to 1999q4 in the second case.
2. Now I want to calculate the output gap for each vintage by taking - in a simple case - the difference of the logs of the non-filtered and the filtered series. Hence, I create a loop for each vintage (in this example, we only have two vintages, in my case up to 80):
Code: Select all
%vintagefirst = "1999q3"
%vintagelast = "1999q4"
for !vint = @dtoo(%vintagefirst) to @dtoo(%vintagelast)
%v = @otod(!vi)
gdp_v{%v}.hpf(lambda=1600) gdp_filtered_v{%v}
gdp_gap_v{%v} = log(gdp_v{%v}) - log(gdp_filtered_v{%v})
next
Hence, I get the series
- gdp_v1999q3
- gdp_v1999q4
- gdp_filtered_v1999q3
- gdp_filtered_v1999q4
- gdp_gap_v1999q3
- gdp_gap_v1999q4
When I have an annual workfile, instead of a quarterly one, the loop over the vintages also follows an annual pattern (due to the functions otod and dtoo I'm using). Hence, what I get are these series
- gdp_v1999
- gdp_filtered_v1999
- gdp_gap_v1999
Thus, these loops work well, as long as the vintages and the workfile have the same frequency. If these frequencies diverge, the loop does not work properly anymore. Thus, my (two) questions:
1. Do you see a different approach than loops, improving calculation time?
2. Do you see an easy procedure to treat annual values, but still keeping the quarterly vintage frequency?
Best