td function - RDocumentation (2024)

Description

Perform temporal disaggregation or interpolation of low frequency to highfrequency time series. td can be used with objects of class"ts", with numeric vectors or with anyts-boxable time series object.

Usage

td( formula, conversion = "sum", to = "quarterly", method = "chow-lin-maxlog", truncated.rho = 0, fixed.rho = 0.5, criterion = "proportional", h = 1, start = NULL, end = NULL, ...)

Value

td returns an object of class "td".

The function predict() computes the interpolatedhigh frequency series. If the high-frequency indicator series are longerthan the low-frequency series, the resulting series will be extrapolated.The function coefficients extracts the coefficients. The functionresiduals extracts the low frequency residuals. The functionsummary() prints a summary of the estimation.

An object of class "td" is a list containing the followingcomponents:

values

disaggregated or interpolated (and extrapolated)high frequency series

fitted.values

low frequency fitted values ofthe regression; low frequency indicator for the Denton methods.

p

preliminary high frequency series

residuals

low-frequencyresiduals

rho

autoregressive parameter, \(\rho\)

truncated

logical, whether \(\rho\) has been truncated

coefficients

a named vector of coefficients

se

standarderrors of the coefficients

s_2

ML-estimator of the variance of thehigh-frequency residuals

s_2_gls

GLS-estimator of the variance ofthe high-frequency residuals

tss

weighted (low frequency) total sumof squares

rss

weighted (low frequency) residual sum of squares

r.squared

R squared

adj.r.squared

adjusted R squared

logl

log-likelihood

aic

Akaike information criterion

bic

Schwarz information criterion

rank

number of right handvariables (including intercept)

df

degrees of freedom

method

method of temporal disaggregation

call

function call

name

name of the low frequency variable

fr

the ratio of highto low-frequency series

conversion

type of temporal conversion

actual

actual values of the low frequeny series

model

amatrix containing the indicators (and a constant if present)

criterion

minimization criterion in Denton methods

h

orderof differencing in Denton methods

Arguments

formula

an object of class "formula": a symbolicdescription of the the temporal disaggregation model. The details of modelspecification are given under 'Details'.

conversion

type of conversion: "sum", "mean" (or: "average"),"first" or "last".

to

high-frequency destination frequency as a character string("quarter" (or "quarterly"), "month" (or "monthly"), "day","hour", "minute", "second", or "year")or as a scalar (e.g. 2, 4, 7, 12). Required if no right hand sideindicator series is provided. The tsbox package mustbe installed to deal with frequencies other than monthly or quarterly. Ifthe input series are numeric, to is a scalar indicating thefrequency ratio.

method

method of temporal disaggregation:"chow-lin-maxlog", "chow-lin-minrss-ecotrim","chow-lin-minrss-quilis", "chow-lin-fixed","dynamic-maxlog" (experimental), "dynamic-minrss" (experimental), "dynamic-fixed" (experimental),"fernandez", "litterman-maxlog", "litterman-minrss","litterman-fixed", "denton-cholette", "denton", "fast","uniform" or "ols". See 'Details'.

truncated.rho

lower bound for the autoregressive parameter\(\rho\). If set to 0 (default), no negative values are allowed.If set to -1, truncation is disabled.

fixed.rho

set a predefined autoregressive parameter \(\rho\). Onlyworks with the methods "chow-lin-fixed" and"litterman-fixed".

criterion

minimzation criterion for Denton methods:"proportional" or "additive". See 'Details'.

h

degree of differencing for Denton methods. See 'Details'.

start

(optional) start date. Similar to pre-processing the inputseries with window().

end

(optional) end date. Similar to pre-processing the inputseries with window().

...

additional arguments to be passed to the low levelsubfunctions.

Details

td is used to disaggregate or interpolate a low frequency to a higherfrequency time series, while either the sum, the average, the first or thelast value of the resulting high-frequency series is consistent with the lowfrequency series. Disaggregation can be performed with or without the help ofone or more right hand side indicator series. It can deal with both witha regular disaggregation setting (e.g. quarters to months) but also withan irregular disaggregation setting (e.g. months to days), where it respectsthe the different lengths of the months.

If the high-frequency indicator(s) cover(s) a longer time span than thelow-frequency series, an extrapolation or retropolation (Wei, 1994, p. 138)is performed, using the same model as for interpolation.

The selection of a temporal disaggregation model is similar to the selectionof a linear regression model. Thus, td closely mirrors the working ofthe lm() function. The left hand side of theformula() denotes the low-frequency series, the right hand sidethe indicators. If no indicator is specified, the right hand side must be setequal to 1 (see examples). Unlike lm, td handlests() and mts time-series objects, as a typical applicationinvolves the use of these objects. Alternatively, If used with basic vectors,the to argument specifies the ratio between the high and the lowfrequency series.

For the generalized least squares (GLS) methods "chow-lin-maxlog","chow-lin-minrss-ecotrim", "chow-lin-minrss-quilis","litterman-maxlog" and "litterman-minrss", an autoregressiveparameter \(\rho\) is estimated. Default (and recommended) method ischow-lin-maxlog. With truncated.rho = 0 (default), it producesgood results for a wide range of applications.

There are two variants of the chow-lin-minrss approach that lead todifferent results: Ecotrim by Barcellan (2003) uses a correlation matrixinstead of the variance covariance matrix (implemented in"chow-lin-minrss-ecotrim"), the Matlab library by Quilis (2009)multiplies the correlation matrix with \(1/(1-\rho^2)\) (implemented in"chow-lin-minrss-quilis").

The methods "dynamic-maxlog", "dynamic-minrss" and"dynamic-fixed" are dynamic extensions of Chow-Lin (Santos Silva andCardoso, 2001). If the autoregressive parameter \(\rho\) is equal to 0, notruncation remainder is added.

The Denton methods "denton" and "denton-cholette" can bespecified with one or without an indicator. The parameter h can be setequal to 0, 1, or 2. Depending on the value, thedenton procedure minimizes the sum of squares of the deviationsbetween the levels (0), the first differences (1) or the seconddifferences (2) of the indicator and the resulting series.Additionally, criterion can be set equal to "proportional" or"additive", depending on whether the proportional or the absolutedeviations should be considered for minimzation. "denton-cholette"removes the transient movement of the original "denton" method at thebeginning of the resulting series. "fast" is a shortcut for"chow-lin-fixed" with fixed.rho = 0.99999. It returns approximately thesame results as "denton-cholette" with h = 1, but is much faster.

"uniform" is a special case of the "denton" approach, withh equals 0 and criterion equals "additive".It distributes the residuals uniformly. If no indicator is used, this leadsto a step-shaped series.

"ols" performs an ordinary least squares regression (OLS) anddistributes the residuals uniformly. It is especially useful for comparingthe estimators of GLS and OLS regressions.

References

Chow, G. C., & Lin, A. L. (1971). Best linear unbiasedinterpolation, distribution, and extrapolation of time series by relatedseries. The review of Economics and Statistics, 372-375.

Denton, F. T. (1971). Adjustment of monthly or quarterly series to annualtotals: an approach based on quadratic minimization. Journal of theAmerican Statistical Association, 66(333), 99-102.

Santos Silva, J. M. C. & Cardoso, F. N. (2001). The Chow-Lin method usingdynamic models. Economomic Modelling, 18, 269-280.

Wei, W. W. S. (1994). Time series analysis. Addison-Wesley publ.

Sax, C. und Steiner, P. (2013). Temporal Disaggregation of Time Series.The R Journal, 5(2), 80-88. tools:::Rd_expr_doi("10.32614/RJ-2013-028")

See Also

ta() for temporal aggregation, the inverse function oftd.

summary() is used to obtain and print a summary ofthe results.

predict() is used to extract the disaggregated orinterpolated high frequency series.

plot() is used to plot the fitted and actual lowfrequency series, as well as the residuals.

Examples

Run this code

data(tempdisagg)# one indicator, no interceptmod1 <- td(sales.a ~ 0 + exports.q)summary(mod1) # summary statisticsplot(mod1) # residual plot of regressionplot(predict(mod1))# interpolated quarterly series# temporally aggregated series is equal to the annual valueall.equal(window( ta(predict(mod1), conversion = "sum", to = "annual"), start = 1975), sales.a)# several indicators, including an interceptmod2 <- td(sales.a ~ imports.q + exports.q)# no indicator (Denton-Cholette)mod3 <- td(sales.a ~ 1, to = "quarterly", method = "denton-cholette")# no indicator (uniform)mod4 <- td(sales.a ~ 1, to = "quarterly", method = "uniform")# Dynamic Chow-Lin (Santos Silva and Cardoso, 2001)# (no truncation parameter added, because rho = 0)mod5 <- td(sales.a ~ exports.q, method = "dynamic-maxlog")# Example from Denton (1971), see references.d.q <- ts(rep(c(50, 100, 150, 100), 5), frequency = 4)d.a <- ts(c(500, 400, 300, 400, 500))a1 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "additive", h = 0))a2 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "additive", h = 1))a3 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "additive", h = 2))a4 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "additive", h = 3))p1 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "proportional", h = 0))p2 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "proportional", h = 1))p3 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "proportional", h = 2))p4 <- predict(td(d.a ~ 0 + d.q, method = "denton", criterion = "proportional", h = 3))# Table in Denton (1971), page 101:round(cbind(d.q, a1, a2, a3, a4, p1, p2, p3, p4))if (FALSE) {# Using altvernative time series classes (see https://docs.ropensci.org/tsbox/)library(tsbox)sales.a.xts <- ts_xts(window(sales.a, start = 2000))exports.q.xts <- ts_xts(window(exports.q, start = 2000))mod1b <- td(sales.a.xts ~ 0 + exports.q.xts)predict(mod1b) # class 'xts'# non-standard frequencies: decades to yearspredict(td(ts_xts(uspop) ~ 1, "mean", to = "year", method = "fast"))# quarter to daily (no indicator)m.d.noind <- td(gdp.q ~ 1, to = "daily", method = "fast")predict(m.d.noind)# quarter to daily (one indicator)m.d.stocks <- td(gdp.q ~ spi.d, method = "chow-lin-fixed", fixed.rho = 0.9)predict(m.d.stocks)}

Run the code above in your browser using DataLab

td function - RDocumentation (2024)
Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 5517

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.