Raw File
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clean.R
\name{na.interp}
\alias{na.interp}
\title{Interpolate missing values in a time series}
\usage{
na.interp(x, lambda = NULL)
}
\arguments{
\item{x}{time series}

\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{
Time series
}
\description{
Uses linear interpolation for non-seasonal series. For seasonal series, a 
robust STL decomposition is used. A linear interpolation is applied to the 
seasonally adjusted data, and then the seasonal component is added back.
}
\details{
A more general and flexible approach is available using \code{na.approx} in
the \code{zoo} package.
}
\examples{

data(gold)
plot(na.interp(gold))

}
\seealso{
\code{\link[forecast]{tsoutliers}}
}
\author{
Rob J Hyndman
}
\keyword{ts}
back to top