| multivariatechowlin | R Documentation |
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.
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
)
series |
A named list of |
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
|
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
|
indicators |
A named list of |
ccseries |
A named list of |
ccdefinition |
A character vector defining each contemporaneous
constraints. The elements of the vector must be written in the form
|
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 |
var |
A character string specifying the method used to estimate the
variance-covariance matrix of the innovations. The default is
|
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 |
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.matrix |
The variance-covariance matrix of the innovations.
This argument is used only when |
rescale.variance |
Boolean. Indicates whether the innovation
variance-covariance matrix is assumed to be known exactly (the default,
which is a natural choice when |
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;
For more information on the method, its arguments, and the other methods available in the package, see the package vignette:
In R:
browseVignettes(package = "rjd3bench")
Online: https://rjdverse.github.io/rjd3bench/articles/rjd3bench.html
multivariatecholette() for time series reconciliation.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.