% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tempdisagg.R
\name{temporal_interpolation}
\alias{temporal_interpolation}
\title{Interpolation of a Time Series by Regression Models.}
\usage{
temporal_interpolation(
  series,
  constant = TRUE,
  trend = FALSE,
  indicators = NULL,
  model = c("Ar1", "Rw", "RwAr1"),
  freq = 4L,
  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
)
}
\arguments{
\item{series}{A low-frequency time series to be interpolated. It must be a \code{"ts"} object.}

\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, 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 interpolation.
If \code{NULL} (the default), no indicator is used. When provided, the argument must be a \code{"ts"} object or a list of \code{"ts"} objects.}

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

\item{freq}{An integer giving the annual frequency of the interpolated series.
This argument is ignored when one or more indicator series is provided.}

\item{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 \code{-1} (the
default). The default value is equivalent to setting the value of the
parameter equal to the frequency of the series, meaning that the last value
of the interpolated series is consistent with the low-frequency series.}

\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_INTERP_RSLTS" is returned. The following are returned
invisibly as a list:
\itemize{
\item \code{regression} \verb{[[1]]} regression coefficients;
\item \code{estimation} \verb{[[2]]} interpolated Time-Series and standard deviation, regression effects and smoothing part, parameter and residuals;
\item \code{likelihood} \verb{[[3]]} likelihood statistics.
}
}
\description{
Perform temporal interpolation 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.
}
\examples{
\dontshow{if (rjd3toolkit::get_java_version() >= rjd3toolkit::minimal_java_version) withAutoprint(\{ # examplesIf}
# Chow-lin / Fernandez when the last value of the interpolated series is
# consistent with the low-frequency series
Y <- rjd3toolkit::aggregate(rjd3toolkit::Retail$RetailSalesTotal, 1)
x <- rjd3toolkit::Retail$FoodAndBeverageStores
ti1 <- temporal_interpolation(Y, indicators = x)
ti1$estimation$interp

ti2 <- temporal_interpolation(Y, indicators = x, model = "Rw")
ti2$estimation$interp

# Same without indicator
ti3 <- temporal_interpolation(Y, model = "Rw", freq = 12, nfcsts = 6)
ti3$estimation$interp

ti4 <- temporal_interpolation(Y, indicators = x, obsposition = 1)
ti4$estimation$interp
\dontshow{\}) # examplesIf}
}
\seealso{
\code{temporal_disaggregation()},

\code{temporal_interpolation_raw()} for interpolation of atypical frequency series,

\code{temporal_disaggregation_raw()} for temporal disaggregation of atypical frequency series

For more information, see the vignette:

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