Page 1 of 1
a question on disaggregate
Posted: Sat Nov 30, 2019 10:26 am
by hardmann
Dear Tom:
I use @disaggregate function to distribute quarterly real gdp into monthly one. According to demo, I use option( model=loglin,maintain=average) to distribute log GDP, I also use the option ( model=linear,maintain=sum) to distribute unlogged GDP to verify. However, the two resulting monthly log GDP serires have same fluctuating pattern but different intercept. I consider the method two is correct, how about one? I guess the intercept can not be droped off?
Please Tom give me a help.
Code: Select all
open data us_rqGDP.rat
calendar(m) 1947:01
data(format=rats,compact=average) 1947:01 2019:10 gdp
set ly = log(gdp)
@disaggregate(tsmodel=rwar1,model=loglin,factor=3,$
maintain=average,print) ly / lmy_1
#
graph(head="US monthly distributed log real GDP",overlay=dot,key=upleft,klabels=||"Official","Estimated" ||) 2
# lmy_1
# ly
print / lmy_1 ly
@disaggregate(tsmodel=rwar1,model=linear,factor=3,$
maintain=average,print) gdp / rmgdp2
#
set lmy_2 = log(rmgdp2)
graph(head="US monthly distributed log real GDP",$
key=upleft,overlay=line,klabels=||"Loglin avg","Linear avg"||) 2
# lmy_1 / 1
# lmy_2 / 2
print / ly lmy_1 lmy_2
*** This Model is OK
@disaggregate(tsmodel=rwar1,model=linear,factor=3,$
maintain=sum,print) gdp / rmgdp3
#
set lmy_3 = log(rmgdp3)
print / gdp rmgdp3
graph(head="US monthly distributed log real GDP",$
key=upleft,klabels=||"Loglin avg","Linear avg","Linear sum"||) 3
# lmy_1 / 1
# lmy_2 / 2
# lmy_3 / 3
Best Regard
Hardmann
Re: a question on disaggregate
Posted: Mon Dec 02, 2019 7:44 am
by TomDoan
MAINTAIN=SUM and MAINTAIN=AVERAGE will be different by a factor of 3. In logs that will be a difference of ln(3) which looks exactly like what you have. Because GDP is usually quoted at annual rates (12.0 for a quarter means at a rate that would produce 12.0 for a year), MAINTAIN=AVERAGE is the correct choice to give monthly numbers with the same behavior. MAINTAIN=SUM is used for values that aren't annualized (that is raw numbers for the reporting period).
Re: a question on disaggregate
Posted: Tue Dec 03, 2019 7:38 am
by hardmann
Dear Tom:
I am still confused. you maybe mean that monthly GDP is usually quoted at annual rates (12.0 for a month means at a rate that would produce 12.0 for a year). If I use raw data with option MAINTAIN=SUM,which is used for level values. How to settle with difference?
In other words, how to specify option to distribute the quarterly log GDP to get the monthly log GDP.
Hardmann
Re: a question on disaggregate
Posted: Tue Dec 03, 2019 10:46 am
by TomDoan
By "raw data", I mean something like actual counts of items sold or manufactured (cars sold, tons of steel produced). Even those (at least in U.S. data) are generally quoted at annual rates. As far as I know, GDP is always quoted as an annual rate, so it you want to take quarterly to monthly, you want the monthly numbers to reflect the quarterly annual rate, which means you do MAINTAIN=AVERAGE.
Re: a question on disaggregate
Posted: Wed Dec 11, 2019 9:53 am
by hardmann
Dear Tom:
I may be disguide to my question. I present my question. We have quarterly real seasonally adjusted GDP, eg, US quarterly real GDP from St. loius Fed or philadelphia Fed. How to use @disaggregate procudure to get US monthly real GDP, I want to know option configration.
Best Regard
Hardmann
Re: a question on disaggregate
Posted: Thu Dec 12, 2019 1:13 pm
by TomDoan
Looking at your original program, you were applying MODEL=LOGLIN to the series in logs. That's wrong---MODEL=LOGLIN is applied to the levels. What you want is MODEL=LOGLIN,MAINTAIN=AVERAGE applied to the levels.
Re: a question on disaggregate
Posted: Fri Dec 13, 2019 10:24 pm
by hardmann
Dear Tom:
I just want to get monthly real GDP.
Best regard
Hardmann
Re: a question on disaggregate
Posted: Sat Dec 14, 2019 11:41 am
by TomDoan
I understand. What you want is MODEL=LOGLIN,MAINTAIN=AVERAGE applied to the levels, not applied to the logs. (The "log" part is done internally).
Re: a question on disaggregate
Posted: Sun Dec 15, 2019 10:15 am
by hardmann
Dear Tom:
I rearrange my code. I suddenly recall the intercept is correct. The quarterly real GDP is aggregation of monthly GDP. In simpleset case, the quarterly GDP is three times of monthly GDP. so log qGDP = log mGDP + Log(3). Thus, monthly log GDP serires have same fluctuating pattern with quarterly GDP, but different intercept. I had tried the option ( model=loglin,maintain=avergae) to level or log, the resulting monthly log GDP serires have same intercept with quarterly log GDP. I doubt there is mistake.
Please Tom give me a help.
Code: Select all
open data us_rqGDP.rat
calendar(m) 1947:01
data(format=rats,compact=average) 1947:01 2019:10 rqGDP
set ly = log(rqGDP)
graph(head="US quarterly real GDP",$
key=upleft,overlay=line,klabels=||"Level", "Log"||) 2
# rqgdp
# ly
*** This Model is baseline
@disaggregate(tsmodel=rwar1,model=linear,factor=3,$
maintain=sum,print) rqgdp / rmgdp
#
set lmy = log(rmgdp)
print / rqgdp rmgdp
graph(head="US monthly distributed GDP",$
key=upleft,klabels=||"Estimated", "Official"||) 2
# rmgdp
# rqgdp
graph(head="US monthly distributed log GDP",$
key=upleft,klabels=||"Monthly Distributed Log", "Quarterly Official Log"||) 2
# lmy
# ly
******** loglin Model with level
@disaggregate(tsmodel=rwar1,model=loglin,factor=3,$
maintain=average,print) rqgdp / rmgdp
#
set lmy_1 = log(rmgdp)
print / rqgdp rmgdp
graph(head="US monthly distributed log GDP",$
key=upleft,klabels=||"Monthly Distributed", "Quarterly Official"||) 2
# rmgdp
# rqgdp
graph(head="US monthly distributed log GDP",$
key=upleft,klabels=||"Monthly Distributed Log", "Quarterly Official Log"||) 2
# lmy_1
# ly
******** loglin Model with log
@disaggregate(tsmodel=rwar1,model=loglin,factor=3,$
maintain=average,print) ly / lmy_2
#
graph(head="US monthly distributed log real GDP",$
key=upleft,klabels=||"Estimated", "Official"||) 2
# lmy_2
# ly
graph(head="US monthly distributed log real GDP",$
key=upleft,klabels=||"Officail","Linear sum","Loglin Level","Loglin log"||) 4
# ly
# lmy
# lmy_1
# lmy_2
Re: a question on disaggregate
Posted: Sun Dec 15, 2019 4:51 pm
by TomDoan
It seems that your problem is that you don't understand what "annual rate" means. As reported, quarterly GDP is not the amount of production in a quarter; it is the amount that would be produced in a year at the rate observed in that quarter (that is, 4 times the amount produced in the quarter itself). GDP is a flow, that is, a rate of production, so it always has to be measured in production/per time period, and that "time period" has been chosen to be a year. Distributing the average maintains that definition; distributing the sum does not. So your "baseline" is wrong and produces a number which is 1/3 of what it should be. Take the log, and it's -ln 3 less than it should be, which is what you are getting.
Re: a question on disaggregate
Posted: Sun Dec 22, 2019 6:52 am
by hardmann
Thanks for your guidance! Based on your opinion, I have read some paper to know better about the conceptions and modified part of choices in the code.
To make sure, I want to show my modified code. Would you please give me some advice about whether the code now can disaggregate the quarterly data into monthly properly.
Thanks!
Code: Select all
@disaggregate(tsmodel=rwar1,model=loglin,factor=3,$
maintain=average,print) rqgdp / rmgdp
Re: a question on disaggregate
Posted: Sun Dec 22, 2019 8:24 am
by TomDoan
Yes.