temporaldisaggregation | R Documentation |
Perform temporal disaggregation of low frequency to high frequency time series by regression models. Models included are Chow-Lin, Fernandez, Litterman and some variants of those algorithms.
temporaldisaggregation(
series,
constant = TRUE,
trend = FALSE,
indicators = NULL,
model = c("Ar1", "Rw", "RwAr1"),
freq = 4,
conversion = c("Sum", "Average", "Last", "First", "UserDefined"),
conversion.obsposition = 1,
rho = 0,
rho.fixed = FALSE,
rho.truncated = 0,
zeroinitialization = FALSE,
diffuse.algorithm = c("SqrtDiffuse", "Diffuse", "Augmented"),
diffuse.regressors = FALSE
)
series |
The time series that will be disaggregated. It must be a ts object. |
constant |
Constant term (T/F). Only used with Ar1 model when zeroinitialization=F |
trend |
Linear trend (T/F) |
indicators |
High-frequency indicator(s) used in the temporal disaggregation. It must be a (list of) ts object(s). |
model |
Model of the error term (at the disaggregated level). "Ar1" = Chow-Lin, "Rw" = Fernandez, "RwAr1" = Litterman |
freq |
Annual frequency of the disaggregated variable. Used if no indicator is provided |
conversion |
Conversion mode (Usually "Sum" or "Average") |
conversion.obsposition |
Only used with "UserDefined" mode. Position of the observed indicator in the aggregated periods (for instance 7th month of the year) |
rho |
Only used with Ar1/RwAr1 models. (Initial) value of the parameter |
rho.fixed |
Fixed rho (T/F, F by default) |
rho.truncated |
Range for Rho evaluation (in [rho.truncated, 1[) |
zeroinitialization |
The initial values of an auto-regressive model are fixed to 0 (T/F, F by default) |
diffuse.algorithm |
Algorithm used for diffuse initialization. "SqrtDiffuse" by default |
diffuse.regressors |
Indicates if the coefficients of the regression model are diffuse (T) or fixed unknown (F, default) |
An object of class "JD3TempDisagg"
# retail data, chow-lin with monthly indicator
Y<-rjd3toolkit::aggregate(rjd3toolkit::retail$RetailSalesTotal, 1)
x<-rjd3toolkit::retail$FoodAndBeverageStores
td<-rjd3bench::temporaldisaggregation(Y, indicators=x)
y<-td$estimation$disagg
# qna data, fernandez with/without quarterly indicator
data("qna_data")
Y<-ts(qna_data$B1G_Y_data[,"B1G_FF"], frequency=1, start=c(2009,1))
x<-ts(qna_data$TURN_Q_data[,"TURN_INDEX_FF"], frequency=4, start=c(2009,1))
td1<-rjd3bench::temporaldisaggregation(Y, indicators=x, model = "Rw")
td2<-rjd3bench::temporaldisaggregation(Y, model = "Rw")
mod1<- td1$regression$model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.