% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clean.R
\name{tsoutliers}
\alias{tsoutliers}
\title{Identify and replace outliers in a time series}
\usage{
tsoutliers(x, iterate = 2, lambda = NULL)
}
\arguments{
\item{x}{time series}

\item{iterate}{the number of iterations required}

\item{lambda}{Box-Cox transformation parameter. If \code{lambda="auto"},
then a transformation is automatically selected using \code{BoxCox.lambda}.
The transformation is ignored if NULL. Otherwise,
data transformed before model is estimated.}
}
\value{
\item{index}{Indicating the index of outlier(s)}
\item{replacement}{Suggested numeric values to replace identified outliers}
}
\description{
Uses supsmu for non-seasonal series and a periodic stl decomposition with
seasonal series to identify outliers and estimate their replacements.
}
\examples{

data(gold)
tsoutliers(gold)

}
\references{
Hyndman (2021) "Detecting time series outliers" \url{https://robjhyndman.com/hyndsight/tsoutliers/}.
}
\seealso{
\code{\link[forecast]{na.interp}}, \code{\link[forecast]{tsclean}}
}
\author{
Rob J Hyndman
}
\keyword{ts}
