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

\item{t}{The low-frequency aggregation constraint. It must be a numeric vector.}

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

\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{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{startoffset}{The number of initial observations in the preliminary series that precede the start of the low-frequency constraint.
The value must be either 0 or a positive integer (default is 0).
This argument is ignored when no preliminary series is provided.}

\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 numeric vector 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. The \code{denton_raw()}
function extends \code{denton()} by allowing benchmarking for any frequency ratio.
}
\examples{
\dontshow{if (rjd3toolkit::get_java_version() >= rjd3toolkit::minimal_java_version) withAutoprint(\{ # examplesIf}
Y <- c(500,510,525,520)
x <- 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)

# Denton PFD
# for example, x and Y could be annual and quinquennal series respectively
denton_raw(x, Y, freqratio = 5)

# Denton AFD
denton_raw(x, Y, freqratio = 5, mul = FALSE)

# Denton PFD without indicator
denton_raw(t = Y, freqratio = 2, conversion = "Average")

# Denton PFD with/without an offset and conversion = "Last"
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)
denton_raw(x2, Y, freqratio = 5, conversion = "Last")
denton_raw(x2, Y, freqratio = 5, conversion = "Last", startoffset = 1)

\dontshow{\}) # examplesIf}
}
\seealso{
For more information, see the vignette:

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