% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/benchmark.R
\name{denton}
\alias{denton}
\title{Benchmarking by means of the Denton Method.}
\usage{
denton(
  s = NULL,
  t,
  d = 1L,
  mul = TRUE,
  nfreq = 4L,
  modified = TRUE,
  conversion = c("Sum", "Average", "Last", "First", "UserDefined"),
  obsposition = 1L,
  nbcsts = 0L,
  nfcsts = 0L
)
}
\arguments{
\item{s}{A preliminary series. If not \code{NULL}, it must be of the same class as \code{t}.}

\item{t}{The low-frequency aggregation constraint. It must be either a \code{"ts"} object or a numeric vector.}

\item{d}{An integer specifying the differencing order. The default is \code{1}.}

\item{mul}{Boolean. Indicates whether benchmarking is multiplicative (\code{TRUE}) or additive (\code{FALSE}). The default is multiplicative.}

\item{nfreq}{An integer giving the annual frequency of the benchmarked series.
This argument is used only when no preliminary series is provided.}

\item{modified}{Boolean. Specifies whether the modified Denton method (\code{TRUE}) or the unmodified Denton method (\code{FALSE}) is applied. The default is \code{TRUE}.}

\item{conversion}{A character string specifying the conversion mode, typically \code{"Sum"} (the default) or \code{"Average"}. Other options are: \code{"Last"}, \code{"First"} and \code{"UserDefined"}.}

\item{obsposition}{An integer specifying the position of the observations of the low-frequency constraint within the benchmarked series (e.g. the 7th month of the year).
This argument is used only when \code{conversion = "UserDefined"}.}

\item{nbcsts}{An integer specifying the number of backcast periods.
This argument is ignored when a preliminary series is provided.
(Not yet implemented.)}

\item{nfcsts}{An integer specifying the number of forecast periods.
This argument is ignored when a preliminary series is provided.
(Not yet implemented.)}
}
\value{
A \code{"ts"} object with the benchmarked series is returned.
}
\description{
Denton method relies on the principle of movement preservation. There exist a
few variants corresponding to different definitions of movement preservation:
additive first difference (AFD), proportional first difference (PFD),
additive second difference (ASD), proportional second difference (PSD), etc.
The default and most widely used is the Denton PFD method.
}
\examples{
\dontshow{if (rjd3toolkit::get_java_version() >= rjd3toolkit::minimal_java_version) withAutoprint(\{ # examplesIf}
Y <- rjd3toolkit::aggregate(rjd3toolkit::Retail$RetailSalesTotal, 1)

# Denton PFD without a preliminary series
y1 <- denton(t = Y, nfreq = 4)
print(y1)

# Denton PFD without a preliminary series and conversion = "Average"
denton(t = Y, nfreq = 4, conversion = "Average")

# Denton PFD with a preliminary series
x <- y1 + rnorm(n = length(y1), mean = 0, sd = 10000)
denton(s = x, t = Y)

# Denton AFD with a preliminary series
denton(s = x, t = Y, mul = FALSE)
\dontshow{\}) # examplesIf}
}
\seealso{
For more information, see the vignette:

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