% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hcp_waypoint.R
\name{hcp_waypoint}
\alias{hcp_waypoint}
\title{Waypoint: adaptive change-point detection with autoencoder and CUSUM}
\usage{
hcp_waypoint(
  input_size,
  encode_size,
  warmup = 500,
  retrain_size = 300,
  buffer_size = 100,
  k_factor = 0.35,
  h_low = 3.5,
  h_high = 6,
  prob_tau = 0.997,
  epochs_init = 40,
  epochs_retrain = 20,
  encoderclass = autoenc_base_ed,
  ...
)
}
\arguments{
\item{input_size}{Integer. Window size used to build autoencoder samples.}

\item{encode_size}{Integer. Latent size for the autoencoder.}

\item{warmup}{Integer. Number of leading observations used to initialize the model.}

\item{retrain_size}{Integer. Number of recent observations used when retraining after a confirmed change.}

\item{buffer_size}{Integer. Number of previous residuals used to standardize the current reconstruction error.}

\item{k_factor}{Numeric. CUSUM reference value (\code{k}).}

\item{h_low}{Numeric. Warning threshold for the bilateral CUSUM supervisor.}

\item{h_high}{Numeric. Confirmation threshold for the bilateral CUSUM supervisor.}

\item{prob_tau}{Numeric. Quantile used to estimate the residual threshold from the warm-up regime.}

\item{epochs_init}{Integer. Epochs for the initial autoencoder training.}

\item{epochs_retrain}{Integer. Epochs for retraining after a confirmed change.}

\item{encoderclass}{DALToolbox autoencoder constructor. Defaults to \code{autoenc_base_ed}.}

\item{...}{Additional arguments forwarded to \code{encoderclass}; these are
the autoencoder-specific parameters, not \code{hcp_waypoint} parameters.}
}
\value{
\code{hcp_waypoint} object.
}
\description{
Implements the adaptive change-point detector described in the associated
SBBD article: a non-supervised autoencoder learns a reference regime from
temporal windows, the reconstruction error is standardized on a recent
buffer, and a bilateral CUSUM supervisor validates persistent deviations.
When a change is confirmed, the model is retrained on recent data and the
supervisor is reset.
}
\details{
The method separates representation and decision:
\itemize{
\item the autoencoder reconstructs windows and produces a scalar reconstruction error;
\item the error is standardized with a rolling buffer;
\item a bilateral CUSUM with lower and upper thresholds (\code{h_low}, \code{h_high}) acts
as the statistical supervisor;
\item after confirmation, the autoencoder is retrained on the most recent regime.
}

This detector is intended for regime-change monitoring rather than isolated
anomaly marking.
}
\examples{
library(daltoolbox)

data(examples_changepoints)
dataset <- examples_changepoints$simple

model <- hcp_waypoint(input_size = 12, encode_size = 4)
model <- fit(model, dataset$serie)
detection <- detect(model, dataset$serie)
print(detection[detection$event, ])

}
\references{
\itemize{
\item Ogasawara, E., Salles, R., Porto, F., Pacitti, E. (2025). \emph{Event Detection in Time Series}.
\item Salles, R. et al. (2020). Harbinger: Um framework para integração e análise de métodos de detecção de eventos em séries temporais. SBBD.
\item Ygorra, B. et al. (2021). Monitoring loss of tropical forest cover from Sentinel-1 time-series: A CuSum-based approach.
\item Ygorra, B. et al. (2024). A near-real-time tropical deforestation monitoring algorithm based on the CuSum change detection method.
\item De Ryck, T. et al. (2021). Change Point Detection in Time Series Data Using Autoencoders with a Time-Invariant Representation.
\item Cao, Z. et al. (2024). Change Point Detection in Multi-Channel Time Series via a Time-Invariant Representation.
\item Corizzo, R. et al. (2022). CPDGA: Change point driven growing auto-encoder for lifelong anomaly detection.
}
}
