| temporal_interpolation_raw | R Documentation |
Perform temporal interpolation of low-frequency to high-frequency time series
by regression models. The implemented methods include Chow-Lin, Fernandez,
Litterman and some variants of those algorithms. The
temporal_interpolation_raw() function extends temporal_interpolation() by
allowing temporal interpolation for any frequency ratio.
temporal_interpolation_raw(
series,
constant = TRUE,
trend = FALSE,
indicators = NULL,
startoffset = 0L,
model = c("Ar1", "Rw", "RwAr1"),
freqratio,
obsposition = -1L,
rho = 0,
rho.fixed = FALSE,
rho.truncated = 0,
zeroinitialization = FALSE,
diffuse.algorithm = c("SqrtDiffuse", "Diffuse", "Augmented"),
diffuse.regressors = FALSE,
nbcsts = 0L,
nfcsts = 0L
)
series |
A low-frequency time series to be interpolated. It must be a numeric vector. |
constant |
Boolean. Indicates whether a constant term is included in
the model. The default is |
trend |
Boolean. Indicates whether a linear trend is included in the
model. The default is |
indicators |
One or more high frequency indicator series used in the
interpolation.
If |
startoffset |
The number of initial observations in the indicator series that precede the start of the low-frequency series. The value must be either 0 or a positive integer (default is 0). This argument is ignored when no indicator is provided. |
model |
A character string specifying the model of the error term at
the disaggregated level.
The options are: |
freqratio |
An integer specifying the frequency ratio between the interpolated series and the low-frequency series. This argument is mandatory and must be a positive integer. |
obsposition |
An integer specifying the position of the low-frequency
observations within the interpolated series (e.g. the 1st month of the
year, the 2d month, etc.). The value must be a positive integer or |
rho |
A numeric value giving the (initial) value of the autoregressive
parameter.
This argument is used only for |
rho.fixed |
Boolean. Specifies whether the supplied value of |
rho.truncated |
A numeric value defining the lower bound of the
admissible range for |
zeroinitialization |
Boolean. If |
diffuse.algorithm |
A character string specifying the algorithm used
for diffuse initialization. The default is |
diffuse.regressors |
Boolean. Indicates whether the coefficients of the
regression model are treated as diffuse ( |
nbcsts |
An integer specifying the number of backcast periods. This argument is ignored when one or more indicator series is provided. |
nfcsts |
An integer specifying the number of forecast periods. This argument is ignored when one or more indicator series is provided. |
The Chow-Lin, Fernandez and Litterman methods are estimated using an equivalent state-space representation of the underlying model. While this approach is mathematically equivalent to the classical matrix formulation, the parametrization differs slightly.
For the Fernandez and Litterman methods, a diffuse initialization of the states is used by default. As a result, a constant is implicitly included and absorbed into the initial state vector. The high-frequency estimates are therefore identical to those obtained from the classical formulation with a constant term, even though the latter does not appear explicitly in the output.
To recover the usual parametrization and obtain an explicit estimate of the
constant, set zeroinitialization = TRUE together with constant = TRUE.
An object of class "JD3_INTERPRAW_RSLTS" is returned. The following are returned as a list:
regression [[1]] regression coefficients;
estimation [[2]] interpolated values and standard errors,
regression effects, smoothing part, parameter and residuals;
likelihood [[3]] likelihood statistics.
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
temporal_disaggregation_raw()
# Use of Chow-lin method to interpolate a biennial series with an annual
# indicator (the low-frequency series is consistent with the last value of the
# interpolated series)
Y <- stats::aggregate(rjd3toolkit::Retail$RetailSalesTotal, 0.5)
x <- stats::aggregate(rjd3toolkit::Retail$FoodAndBeverageStores, 1)
ti <- temporal_interpolation_raw(as.numeric(Y), indicators = as.numeric(x), freqratio = 2)
ti$estimation$interp
# Use of Fernandez method to interpolate a series without indicator
# considering a frequency ratio of 5 (the low-frequency series is consistent
# with the last value of the interpolated series). For example, Y2 could be a
# quinquennial series to interpolate annually.
Y2 <- c(500,510,525,520)
ti2 <- temporal_interpolation_raw(Y2, model = "Rw", freqratio = 5, nbcsts = 1, nfcsts = 2)
ti2$estimation$interp
# Same with an indicator, considering an offset in the latter
Y2 <- c(500,510,525,520)
x2 <- c(485,
490, 492.5, 497.5, 520, 495,
500, 502.5, 505, 527.5, 515,
522.5, 517.5, 522.5, 545, 520,
535, 515, 540, 565, 550)
ti3 <- temporal_interpolation_raw(Y2, indicators = x2, startoffset = 1, model = "Rw", freqratio = 5)
ti3$estimation$interp
# Same considering that the first value of the interpolated series is the one
# consistent with the low-frequency series
ti4 <- temporal_interpolation_raw(Y2, indicators = x2, startoffset = 1,
model = "Rw", freqratio = 5, obsposition = 1)
ti4$estimation$interp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.