https://github.com/cran/forecast
Raw File
Tip revision: 1bf95169ba0d94d3e78415b1dafcf7068e3d16c7 authored by Rob Hyndman on 29 April 2019, 04:40:06 UTC
version 8.7
Tip revision: 1bf9516
na.interp.Rd
% 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, linear = (frequency(x) <= 1 |
  sum(!is.na(x)) <= 2 * frequency(x)))
}
\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.}

\item{linear}{Should a linear interpolation be used.}
}
\value{
Time series
}
\description{
By default, uses linear interpolation for non-seasonal series. For seasonal series, a 
robust STL decomposition is first computed. Then a linear interpolation is applied to the 
seasonally adjusted data, and 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