1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/forecast2.R
\name{BoxCox}
\alias{BoxCox}
\alias{InvBoxCox}
\title{Box Cox Transformation}
\usage{
BoxCox(x, lambda)
InvBoxCox(x, lambda, biasadj = FALSE, fvar = NULL)
}
\arguments{
\item{x}{a numeric vector or time series of class \code{ts}.}
\item{lambda}{transformation parameter. If \code{lambda = "auto"}, then
the transformation parameter lambda is chosen using BoxCox.lambda.}
\item{biasadj}{Use adjusted back-transformed mean for Box-Cox
transformations. If transformed data is used to produce forecasts and fitted values,
a regular back transformation will result in median forecasts. If biasadj is TRUE,
an adjustment will be made to produce mean forecasts and fitted values.}
\item{fvar}{Optional parameter required if biasadj=TRUE. Can either be the
forecast variance, or a list containing the interval \code{level}, and the
corresponding \code{upper} and \code{lower} intervals.}
}
\value{
a numeric vector of the same length as x.
}
\description{
BoxCox() returns a transformation of the input variable using a Box-Cox
transformation. InvBoxCox() reverses the transformation.
}
\details{
The Box-Cox transformation is given by \deqn{f_\lambda(x) =\frac{x^\lambda -
1}{\lambda}}{f(x;lambda)=(x^lambda - 1)/lambda} if \eqn{\lambda\ne0}{lambda
is not equal to 0}. For \eqn{\lambda=0}{lambda=0},
\deqn{f_0(x)=\log(x)}{f(x;0)=log(x)}.
}
\examples{
lambda <- BoxCox.lambda(lynx)
lynx.fit <- ar(BoxCox(lynx,lambda))
plot(forecast(lynx.fit,h=20,lambda=lambda))
}
\references{
Box, G. E. P. and Cox, D. R. (1964) An analysis of
transformations. \emph{JRSS B} \bold{26} 211--246.
}
\seealso{
\code{\link{BoxCox.lambda}}
}
\author{
Rob J Hyndman & Mitchell O'Hara-Wild
}
\keyword{ts}
|