Page 1 of 3
DISAGGREGATE—general procedure for interpolation
Posted: Mon Apr 07, 2008 1:25 pm
by TomDoan
@DISAGGREGATE is an "all-purpose" temporal disaggregation procedure, which can handle linear and log-linear versions of "Chow-Lin" type distributions, as well as proportional Denton. If you provide an empty list of regressors, it will do the same calculations as was done by the
@INTERPOL and
@DISTRIB procedures (though with a slightly different set of parameters and options).
Detailed description
Algorithm
The calculations are done using Kalman smoothing (for log-linear, with iterated linearizations). All of the above references use other constructive calculations, but they, in fact, are simply derived special cases of Kalman smoothing. This is the chapter from the
State Space/DSGE course which provides detailed information on how this is done.
Example
Code: Select all
*
* Example of the use of @disaggregate
*
* Data are from FRED. INDPRO is (monthly) industrial production, though
* we will use quarterly averages. GDPCA are annual GDP numbers (which
* start in 1929:1), GDPC1 are quarterly (starting in 1947:1). We'll use
* @DISAGGREGATE to create an estimate of quarterly GDP from 1929 on
* using industrial production as a related series.
*
open data demodisaggregate.rat
calendar(q) 1929:1
data(format=rats,compact=average) 1929:01 2012:04 indpro gdpc1 gdpca
*
* The model is log-linear using log IP as the explanatory variable, with
* an RWAR1 time series model, that is the assumed model at the quarterly
* level is
*
* log y(t) = beta x log ip(t) + z(t)
*
* where z(t) is an ARIMA(1,1,0) process
*
* with the constraint that the average of y across each year matches the
* observed value of GDPCA.
*
set logip = log(indpro)
@disaggregate(tsmodel=rwar1,model=loglin,factor=4,maintain=average,print) gdpca / gdpcq
# logip
*
* Over the full sample, the two lines run almost on top of each other,
* so this graphs the estimated quarterly value and the official
* quarterly value for a 10 year range.
*
graph(overlay=line,key=upleft,klabels=||"Official","Estimated","IP"||) 3
# gdpc1 2003:1 2012:4
# gdpcq 2003:1 2012:4
# indpro 2003:1 2012:4
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Sun Dec 04, 2011 6:32 pm
by ivory4
What is the parameter setting to correspond to DISTRIBUTE procedure where no related series are used?
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Sun Dec 04, 2011 6:55 pm
by ivory4
Also in UG, there is an example using DISTRIB
Code: Select all
cal(m) 1947
open data haverexample.rat
data(for=rats, verbose) 1947:1 2006:4 gdp
@distrib(factor=3) gdp gdpm
set gdpm = 3*gdpm
It says we need to multiply the result by 3 to maintain the original level.
In this case, M1+M2++M3 is not equal to the original Q1 GDP. I think if for unemployment rate, we should do this?
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Mon Dec 05, 2011 11:07 am
by TomDoan
ivory4 wrote:What is the parameter setting to correspond to DISTRIBUTE procedure where no related series are used?
MODEL=LINEAR,MAINTAIN=SUM plus the choice for the time series model.
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Mon Dec 05, 2011 11:17 am
by TomDoan
ivory4 wrote:Also in UG, there is an example using DISTRIB
Code: Select all
cal(m) 1947
open data haverexample.rat
data(for=rats, verbose) 1947:1 2006:4 gdp
@distrib(factor=3) gdp gdpm
set gdpm = 3*gdpm
It says we need to multiply the result by 3 to maintain the original level.
In this case, M1+M2++M3 is not equal to the original Q1 GDP. I think if for unemployment rate, we should do this?
GDP is generally quoted in annual rates. Multiplying by 3 maintains that so M1+M2+M3 has the same average as Q1. Yes. You would want to do the same for unemployment rate.
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Mon Dec 05, 2011 1:01 pm
by ivory4
TomDoan wrote:ivory4 wrote:Also in UG, there is an example using DISTRIB
Code: Select all
cal(m) 1947
open data haverexample.rat
data(for=rats, verbose) 1947:1 2006:4 gdp
@distrib(factor=3) gdp gdpm
set gdpm = 3*gdpm
It says we need to multiply the result by 3 to maintain the original level.
In this case, M1+M2++M3 is not equal to the original Q1 GDP. I think if for unemployment rate, we should do this?
GDP is generally quoted in annual rates. Multiplying by 3 maintains that so M1+M2+M3 has the same average as Q1. Yes. You would want to do the same for unemployment rate.
But the data is for quarterly GDP level not for the growth rate?
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Mon Dec 05, 2011 3:11 pm
by TomDoan
ivory4 wrote:But the data is for quarterly GDP level not for the growth rate?
That's correct. But quarterly GDP is quoted on the basis of what the annual GDP number would be at the current rate of production.
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Mon Dec 05, 2011 6:57 pm
by ivory4
There is another example using denton method to distribute data with a related series.
Do we need to multiply the distrib by 4?
Code: Select all
cal(q) 1998
all 2000:4
data(unit=input) / quarter annual
98.2 100.8 102.2 100.8 99.0 101.6 102.7 101.5 100.5 103.0 103.5 101.5
. . . 4000 . . . 4161.4 . . . .
dec rect a(4,4)
input a
1 0 0 0
1 0 0 0
0 1 0 0
0 0 1 0
compute f=%unitv(4,1)
dec frml[vec] cf
frml cf = ||quarter{0},quarter{1},quarter{2},quarter{3}||
dlm(type=smoothed,a=a,c=cf,y=annual,f=f,sw=1.0,presample=ergodic) $
1998:1 2000:4 xstates
set distrib = %scalar(xstates)*quarter
print / distrib quarter annual
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Mon Dec 05, 2011 8:02 pm
by ivory4
TomDoan wrote:ivory4 wrote:What is the parameter setting to correspond to DISTRIBUTE procedure where no related series are used?
MODEL=LINEAR,MAINTAIN=SUM plus the choice for the time series model.
What to put under "#"
Another question is about option LOGLINEAR.
My understanding is that this "loglinear" is for equation connecting interpolated series with observed series (L_t = exp(logI_t) + .....exp(logI_t-q) ) ; NOT the relation between interpolated series with high frequency information is still linear? (I_t = H_t+u_t ?); But when I check July2008 RATSLETTER it says (3) logI_t = H + Z (LOGLIN) (referring to the relation between interpolated series with high frequency information).
Could you clarify this?
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Tue Dec 06, 2011 9:44 am
by TomDoan
ivory4 wrote:There is another example using denton method to distribute data with a related series.
Do we need to multiply the distrib by 4?
For a series quoted like GDP, yes.
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Tue Dec 06, 2011 10:01 am
by TomDoan
ivory4 wrote:TomDoan wrote:ivory4 wrote:What is the parameter setting to correspond to DISTRIBUTE procedure where no related series are used?
MODEL=LINEAR,MAINTAIN=SUM plus the choice for the time series model.
What to put under "#"
Leave it blank.
ivory4 wrote:
Another question is about option LOGLINEAR.
My understanding is that this "loglinear" is for equation connecting interpolated series with observed series (L_t = exp(logI_t) + .....exp(logI_t-q) ) ; NOT the relation between interpolated series with high frequency information is still linear? (I_t = H_t+u_t ?); But when I check July2008 RATSLETTER it says (3) logI_t = H + Z (LOGLIN) (referring to the relation between interpolated series with high frequency information).
Could you clarify this?
Aren't they the same thing? One's just an expansion of the other.
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Wed Jun 06, 2012 2:20 pm
by ivory4
I see. I thought (L_t = exp(logI_t) + .....exp(logI_t-q) or L=I_t+...I_t-q; can be combined with any one of (7.1, 7.2, 7.2), which are I=H+Z; I=Hz; LogI=H+z
As you pointed out, DISAGGREGATE 's option LOGLIN actually indicates a combination of L_t = exp(logI_t) + .....exp(logI_t-q) and LogI=H+z;
while option LIN indicates L=I_t+...I_t-q (sum or average) and I=H+Z;
while option PROPORTION indicates L=I_t+...I_t-q (sum or average) and I=Hz
Re: DISAGGREGATE - a general procedure for interpolation
Posted: Wed Jun 06, 2012 5:31 pm
by ivory4
As for Stock and Watson's research memorandum "Distribution of quarterly values of GDP/GDI across months within the quarter
Background", is there a replication here?
http://www.princeton.edu/~mwatson/mgdp_gdi.html
disaggregate procedure
Posted: Tue Feb 26, 2013 4:10 pm
by fadimohamed
Dear Tom,
i have a monthly time series and i want to make it weekly to match the database i am analyzing but i have two problems,
First is, the observed weekly data with is not uniformly distributed, so my question here is how to fill in exactly the empty weeks? is it correct that factor=3 increase the frequency from months to weeks?
Second is, when i use the code below, i constructed the variable [rapst] (monthly data of inventories that i want to disaggregate to weekly) and made and fixed the observed value of each month for its corresponding weeks to be a related series, is it correct to use it as related series? can i use a constant here?
Code: Select all
@DISAGGREGATE(model=multiplicative,maintain=average, $
tsmodel=rwar1,factor=3) RAPST * * rapstn
# rapst
when i remove the related series i get this error
Code: Select all
## MAT17. Can't Use Row Range of 4 to 2 in %XSUBVEC operation
The Error Occurred At Location 4054, Line 218 of DISAGGREGATE
thank you so much for your help
Fadi
Re: disaggregate procedure
Posted: Wed Feb 27, 2013 10:24 am
by TomDoan
You can't use @DISAGGREGATE to do monthly to weekly. That procedure is designed to handle only frequencies which are a fixed number of subperiods. The same underlying idea can be used from monthly to weekly, but you have to figure out how you want to handle the weeks that split across months. There are many ways that one could do that, since for some data sets, there are day-of-the-week effects, so Saturday and Sunday might need different weights than the weekdays. If there are day-of-the-week effects, the input monthly data may or may not have already been adjusted for those, which makes the weight handling in the disaggregation more complicated.