multivariatechowlin: Multivariate Temporal Disaggregation of a System of Time...

View source: R/tempdisagg.R

multivariatechowlinR Documentation

Multivariate Temporal Disaggregation of a System of Time Series by Regression Models.

Description

Performs simultaneous temporal disaggregation of a system of low-frequency time series into higher-frequency series using the multivariate extension of the Chow-Lin model. When rho = 1 (the default), the method coincides with the multivariate extension of the Fernandez model, also known as the multivariate Random Walk model. Additive conversion is assumed, although average conversion can be accommodated too; see the package vignette for details.

Usage

multivariatechowlin(
  series,
  constant = FALSE,
  trend = FALSE,
  indicators = NULL,
  ccseries = NULL,
  ccdefinition = NULL,
  freq = 4L,
  rho = 1,
  var = c("fromUnivariate", "allEquals", "userDefined"),
  var.includeCov = FALSE,
  var.shrinkCov = FALSE,
  var.matrix = NULL,
  rescale.variance = FALSE
)

Arguments

series

A named list of ts objects containing the low frequency time series to be disaggregated.

constant

Either a Boolean or a vector of Booleans. If a vector is provided, each element specifies whether a constant term is included in the model for each series, following the order in which they appear in the series object. The length of the vector must match the number of series. If a single Boolean is provided (default is FALSE), it is applied to all series. Note that this argument is only used for series with rho < 1 (Chow-Lin). For series with rho = 1 (Fernandez), a constant term is automatically and implicitly included. See the package vignette or the Details section of the univariate temporal_disaggregation() function for further information on this.

trend

Either a Boolean or a vector of Booleans. If a vector is provided, each element specifies whether a linear trend is included in the model for each series, following the order in which they appear in the series object. The length of the vector must match the number of series. If a single Boolean is provided (default is FALSE), it is applied to all series.

indicators

A named list of ts objects or a named list of a list of ts objects. Each element specifies one or more high-frequency indicator(s) associated with one series. If an element is NULL, no indicator is used for the corresponding series. The default value is NULL, meaning that no indicators are used for any series.

ccseries

A named list of ts objects containing the contemporaneous constraints. If NULL (the default), no contemporaneous constraints are considered.

ccdefinition

A character vector defining each contemporaneous constraints. The elements of the vector must be written in the form z=w_1 y_1+\ldots+w_n y_n or c=w_1 y_1+\ldots+w_n y_n where:

  • z is the name of a contemporaneous constraint,

  • (w_1,\ldots,w_n) are optional numeric weights,

  • (y_1,\ldots,y_n) are the names of the time series and

  • c is a constant. The default is NULL, meaning that no contemporaneous constraints are considered.

freq

An integer giving the annual frequency of the disaggregated series. This argument is ignored when at least one indicator series is provided for any series.

rho

Either a numeric value or a vector of numeric values. If a vector is provided, each element specifies the value of the rho parameter associated to each series, following the order in which they appear in the series object. The length of the vector must match the number of series. If a single numeric value is provided (default is 1, corresponding to the Fernandez model), it is applied to all series.

var

A character string specifying the method used to estimate the variance-covariance matrix of the innovations. The default is "fromUnivariate", meaning that it is estimated empirically from the residuals of the univariate models. Other options include "allEquals", which assumes a diagonal matrix with identical variances, and "userDefined", where the matrix is supplied by the user via the var.matrix argument. For additional details, see the package vignette.

var.includeCov

Boolean. Indicates whether off-diagonal elements of the innovation variance-covariance matrix should also be estimated from the residuals of the univariate models. The default is FALSE, meaning that only a diagonal matrix is estimated. This argument is used only when var = "fromUnivariate".

var.shrinkCov

Boolean. Indicates whether a shrinkage estimator should be used for covariance estimation. See the package vignette for more details. This argument is used only when var = "fromUnivariate" and var.includeCov = TRUE.

var.matrix

The variance-covariance matrix of the innovations. This argument is used only when var = "userDefined" and must be provided in that case.

rescale.variance

Boolean. Indicates whether the innovation variance-covariance matrix is assumed to be known exactly (the default, which is a natural choice when var = "fromUnivariate") or only up to a scaling factor. When set to TRUE, the variances of the estimates are rescaled based on the model residuals. This option has no impact on the disaggregated series, but affects the standard errors of both the disaggregated series and the estimated coefficients. See the package vignette for more details.

Value

An object of class "JD3_MULTITEMPDISAGG_RSLTS" is returned. The following are returned as a list:

  • regression ⁠[[1]]⁠ regression coefficients for each series;

  • estimation ⁠[[2]]⁠ disaggregated time series and standard errors, regression effects, smoothing parts, estimated parameters, and variance-covariance matrix of the innovations;

Vignette

For more information on the method, its arguments, and the other methods available in the package, see the package vignette:

See Also

multivariatecholette() for time series reconciliation.

Examples


# Low-frequency data
Y1 <- ts(
  c(30.0, 30.6, 31.2, 31.6),
  frequency = 1,
  start = c(2010, 1)
)

Y2 <- ts(
  c(80.0, 81.2, 82.5, 82.6),
  frequency = 1,
  start = c(2010, 1)
)

Y3 <- ts(
  c(8.0, 8.1, 8.2, 8.2),
  frequency = 1,
  start = c(2010, 1)
)

lf_series <- list(
  y1 = Y1,
  y2 = Y2,
  y3 = Y3
)

# Contemporaneous constraint
z <- ts(
  c(
    27.1, 29.8, 29.9, 31.2,
    29.4, 27.9, 30.9, 31.7,
    29.2, 30.2, 30.6, 31.9,
    29.3, 30.4, 30.7, 32.0
  ),
  frequency = 4,
  start = c(2010, 1)
)

# High-frequency indicators
x11 <- ts(
  c(
    7.0, 7.2, 8.1, 7.5,
    8.5, 7.8, 8.1, 8.4,
    8.6, 7.8, 8.0, 8.3,
    8.7, 7.9, 8.0, 8.6
  ),
  frequency = 4,
  start = c(2010, 1)
)
x12 <- ts(
  c(
    18.0, 19.5, 19.0, 19.7,
    18.5, 19.0, 20.3, 20.0,
    18.6, 19.5, 20.4, 20.1,
    18.7, 19.1, 20.4, 20.8
  ),
  frequency = 4,
  start = c(2010, 1)
)

x3 <- ts(
  c(
    1.5, 1.8, 2.0, 2.5,
    2.0, 1.5, 1.7, 2.1,
    2.1, 1.6, 1.6, 2.2,
    2.3, 1.7, 1.9, 2.3
  ),
  frequency = 4,
  start = c(2010, 1)
)

indic_series <- list(
  y1 = list(x11, x12),
  y2 = NULL,
  y3 = x3
)

# Check consistency between temporal and contemporaneous constraints
rowSums(cbind(Y1,Y2,Y3)) - stats::aggregate.ts(z) # should all be 0

# Estimate models and get results

## Mix Chow-Lin and Fernandez definitions

### with var-cov matrix estimated from the univariate models, assuming zero covariances
mtd1 <- multivariatechowlin(
    series = lf_series,
    constant = c(FALSE, FALSE, TRUE),
    trend = c(FALSE, FALSE, FALSE),
    indicators = indic_series,
    ccseries = list(z = z),
    ccdefinition = "z=y1+y2+y3",
    freq = 4L,
    rho = c(0.85, 1.0, 0.9),
    var = "fromUnivariate",
    var.includeCov = FALSE,
    var.shrinkCov = FALSE
)

mtd1$estimation$var$vcov # variance-covariance matrix of the innovations
do.call(cbind, mtd1$estimation$disagg) # disaggregated series
do.call(cbind, mtd1$estimation$edisagg) # standard errors of the disaggregated series

### using a shrinkage estimator for covariance
mtd2 <- multivariatechowlin(
    series = lf_series,
    constant = c(FALSE, FALSE, TRUE),
    trend = c(FALSE, FALSE, FALSE),
    indicators = indic_series,
    ccseries = list(z = z),
    ccdefinition = "z=y1+y2+y3",
    freq = 4L,
    rho = c(0.85, 1.0, 0.9),
    var = "fromUnivariate",
    var.includeCov = TRUE,
    var.shrinkCov = TRUE
)

mtd2$estimation$var$vcov
do.call(cbind, mtd2$estimation$disagg)
do.call(cbind, mtd2$estimation$edisagg)

## Multivariate random walk model (multivariate Fernandez)

### with var-cov matrix provided by the user
mtd3 <- multivariatechowlin(
    series = lf_series,
    constant = FALSE,
    trend = FALSE,
    indicators = indic_series,
    ccseries = list(z = z),
    ccdefinition = "z=y1+y2+y3",
    freq = 4L,
    rho = 1.0,
    var = "userDefined",
    var.matrix = matrix(
        c(5, 2, 1,
          2, 10, 2,
          1, 2, 3),
        nrow = 3,
        byrow = TRUE
    ),
    rescale.variance = TRUE
)

mtd3$estimation$var$vcov
do.call(cbind, mtd3$estimation$disagg)
do.call(cbind, mtd3$estimation$edisagg)


rjd3bench documentation built on Nov. 26, 2026, 5:08 p.m.