% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tempdisagg.R
\name{temporal_disaggregation_raw}
\alias{temporal_disaggregation_raw}
\title{Temporal Disaggregation of an Atypical Frequency Series by Regression Models.}
\usage{
temporal_disaggregation_raw(
  series,
  constant = TRUE,
  trend = FALSE,
  indicators = NULL,
  startoffset = 0L,
  model = c("Ar1", "Rw", "RwAr1"),
  freqratio,
  average = FALSE,
  rho = 0,
  rho.fixed = FALSE,
  rho.truncated = 0,
  zeroinitialization = FALSE,
  diffuse.algorithm = c("SqrtDiffuse", "Diffuse", "Augmented"),
  diffuse.regressors = FALSE,
  nbcsts = 0L,
  nfcsts = 0L
)
}
\arguments{
\item{series}{A low-frequency time series to be disaggregated. It must be a numeric vector.}

\item{constant}{Boolean. Indicates whether a constant term is included in the model. The default is \code{TRUE}.
Note that this argument is used only with \code{model = "Ar1"} when \code{zeroinitialization = FALSE}. For additional information on this, see the package vignette.}

\item{trend}{Boolean. Indicates whether a linear trend is included in the model. The default is \code{FALSE}.}

\item{indicators}{One or more high-frequency indicator series used in the temporal disaggregation.
If \code{NULL} (the default), no indicator is used. When provided, the argument must be a numeric vector or a matrix.}

\item{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.}

\item{model}{A character string specifying the model of the error term at the disaggregated level.
The options are: \code{"Ar1"} (Chow Lin, the default), \code{"Rw"} (Fernandez), and \code{"RwAr1"} (Litterman).}

\item{freqratio}{An integer specifying the frequency ratio between the disaggregated series and the low-frequency series.
This argument is mandatory and must be a positive integer.}

\item{average}{Boolean. Indicates whether an average conversion should be considered. The default is \code{FALSE}, corresponding to additive conversion.}

\item{rho}{A numeric value giving the (initial) value of the autoregressive parameter.
This argument is used only for \code{"Ar1"} and \code{"RwAr1"} models.}

\item{rho.fixed}{Boolean. Specifies whether the supplied value of \code{rho} is fixed. The default is \code{FALSE}, which indicates that \code{rho} is estimated.}

\item{rho.truncated}{A numeric value defining the lower bound of the admissible range for \code{rho}.
The evaluation range is \verb{[rho.truncated, 1[}.}

\item{zeroinitialization}{Boolean. If \code{TRUE}, the initial values of the autoregressive model are set to zero. The default is \code{FALSE}.}

\item{diffuse.algorithm}{A character string specifying the algorithm used for diffuse initialization. The default is \code{"SqrtDiffuse"}. Other options are: \code{"Diffuse"} and \code{"Augmented"}.}

\item{diffuse.regressors}{Boolean. Indicates whether the coefficients of the regression model are treated as diffuse (\code{TRUE}) or as fixed unknown (\code{FALSE}, the default).}

\item{nbcsts}{An integer specifying the number of backcast periods.
This argument is ignored when one or more indicator series is provided.}

\item{nfcsts}{An integer specifying the number of forecast periods.
This argument is ignored when one or more indicator series is provided.}
}
\value{
An object of class "JD3_TEMPDISAGGRAW_RSLTS" is returned. The following are returned
invisibly as a list:
\itemize{
\item \code{regression} \verb{[[1]]} regression coefficients;
\item \code{estimation} \verb{[[2]]} disaggregated values and standard deviation, regression effects, smoothing part, parameter and residuals;
\item \code{likelihood} \verb{[[3]]} likelihood statistics.
}
}
\description{
Perform temporal disaggregation of low-frequency to high-frequency time
series by regression models. The implemented models include Chow-Lin,
Fernandez, Litterman and some variants of those algorithms. The
\code{temporal_disaggregation_raw()} function extends \code{temporal_disaggregation()}
by allowing temporal disaggregation for any frequency ratio.
}
\examples{
\dontshow{if (rjd3toolkit::get_java_version() >= rjd3toolkit::minimal_java_version) withAutoprint(\{ # examplesIf}
# Use of Chow-lin method to disaggregate a biennial series with an annual indicator
Y <- stats::aggregate(rjd3toolkit::Retail$RetailSalesTotal, 0.5)
x <- stats::aggregate(rjd3toolkit::Retail$FoodAndBeverageStores, 1)
td <- temporal_disaggregation_raw(as.numeric(Y), indicators = as.numeric(x), freqratio = 2)
td$estimation$disagg

# Use of Fernandez method to disaggregate a series without indicator
# considering a frequency ratio of 5 (for example, it could be a quinquennial
# series to disaggregate on an annual basis)
Y2 <- c(500,510,525,520)
td2 <- temporal_disaggregation_raw(Y2, model = "Rw", freqratio = 5, nfcsts = 2)
td2$estimation$disagg

# Same with an indicator, considering an offset in the latter
Y2 <- c(500,510,525,520)
x2 <- c(97,
        98, 98.5, 99.5, 104, 99,
        100, 100.5, 101, 105.5, 103,
        104.5, 103.5, 104.5, 109, 104,
        107, 103, 108, 113, 110)
td3 <- temporal_disaggregation_raw(Y2, indicators = x2, startoffset = 1,
                                   model = "Rw", freqratio = 5)
td3$estimation$disagg
\dontshow{\}) # examplesIf}
}
\seealso{
\code{temporal_interpolation_raw()}

For more information, see the vignette:

\code{utils::browseVignettes()}, e.g. \code{browseVignettes(package = "rjd3bench")}
}
