DISAGGREGATE - a general procedure for interpolation

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.

DISAGGREGATE - a general procedure for interpolation

Postby TomDoan » Mon Apr 07, 2008 1:25 pm

This 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).

This was updated 1 March 2013 to add the MAINTAIN=WEIGHTEDSUM (and WEIGHTS options) to allow for weighted sums.

disaggregate.src
Procedure file (updated March 2013)
(12.22 KiB) Downloaded 35 times


@Disaggregate( options ) oldser start end newser
# list of related series in regression format

If you have no related series, just do # on the second line with the rest blank.

Parameters

oldser = series to distribute. This should be set up in the desired higher frequency.

start end = range over which to do the calculations. By default, the defined range of <<oldser>>

newser = output higher frequency series.

Options

MODEL=LINEAR/LOGLIN/MULTIPLICATIVE
Specifies how the time series model and the regression model combine to model the observed data.
MODEL=LINEAR --> y=regression + noise.
MODEL=LOGLIN --> y=exp(regression+noise)
MODEL=MULT --> y=regression x noise

MAINTAIN=[SUM]/AVERAGE/FINAL/WEIGHTEDSUM
Indicates what the disaggregated data are supposed to match in the lower frequency data. SUM is the sum across the subperiods, AVERAGE is the average, and FINAL is the last value.

TSMODEL=[RW1]/AR1/RWAR1/RW2
Specifies one of several statistical models for the noise process. RW1 is a random walk, AR1 is a first order autoregression, RWAR1 is an ARIMA(1,1,0) and RW2 is ARIMA(0,2,0).

WEIGHTS=series of weights for MAINTAIN=WEIGHTEDSUM

RHO =input value of the AR1 parameter for AR1 and RWAR1 models
ESTIMATE/[NOESTIMATE]
If ESTIMATE, the RHO is estimated (by maximum likelihood) for the AR1 and RWAR1 models.

FACTOR=Increase in the recording frequency (for instance, 3 for quarterly to monthly)

PRINT/[NOPRINT]
PRINT displays the estimation output if RHO needs to be estimated.

References

MODEL=LINEAR,TSMODEL=AR1 is Chow and Lin(1971), "Best Linear Unbiased Interpolation, Distribution and Extrapolation of Time Series by Related Series", Review of Economics and Statistics, vol 53, pp 372-375.

MODEL=LINEAR,TSMODEL=RW is Fernandez(1981), "A Methodological Note on the Estimation of Time Series", Review of Economics and Statistics, vol 63, pp 471-478.

MODEL=LINEAR,TSMODEL=RWAR1 is Litterman(1983), "A Random Walk, Markov Model for the Distribution of Time Series", JBES, vol 1, pp 169-173, with a different handling of the initial periods.

MODEL=MULTIPLICATIVE,TSMODEL=RW is the proportional Denton method

MODEL=LINEAR,TSMODEL=RW,MAINTAIN=SUM with no related series is a generalization of Boot, Feibes, Lisman(1967) "Further methods of
derivation of quarterly figures from annual data", Applied Statistics, vol. 16, no 1, 65-75.

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, all simply derived special cases of Kalman smoothing. Chapter 7 in the State Space/DSGE course (http://www.estima.com/forum/viewtopic.php?f=24&t=528) provides detailed information on how this is done.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby ivory4 » Sun Dec 04, 2011 7:32 pm

What is the parameter setting to correspond to DISTRIBUTE procedure where no related series are used?
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby ivory4 » Sun Dec 04, 2011 7:55 pm

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?
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby TomDoan » Mon Dec 05, 2011 12:07 pm

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.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby TomDoan » Mon Dec 05, 2011 12:17 pm

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.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby ivory4 » Mon Dec 05, 2011 2:01 pm

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?
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby TomDoan » Mon Dec 05, 2011 4:11 pm

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.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby ivory4 » Mon Dec 05, 2011 7:57 pm

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
set distrib =distrib*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
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby ivory4 » Mon Dec 05, 2011 9:02 pm

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?
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby TomDoan » Tue Dec 06, 2011 10:44 am

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?

Code: Select all
set distrib =distrib*4



For a series quoted like GDP, yes.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby TomDoan » Tue Dec 06, 2011 11:01 am

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.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby ivory4 » Wed Jun 06, 2012 2:20 pm

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
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

Re: DISAGGREGATE - a general procedure for interpolation

Postby ivory4 » Wed Jun 06, 2012 5:31 pm

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
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

disaggregate procedure

Postby fadimohamed » Tue Feb 26, 2013 5:10 pm

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
fadimohamed
 
Posts: 15
Joined: Mon May 23, 2011 11:13 am

Re: disaggregate procedure

Postby TomDoan » Wed Feb 27, 2013 11:24 am

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.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Next

Return to RATS Procedures

Who is online

Users browsing this forum: No registered users and 1 guest