Skip to content

Commit

Permalink
Automated choice of Box-Cox now has lower bound of -0.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Dec 22, 2020
1 parent 40c47f4 commit 6f99e12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/forecast2.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ meanf <- function(y, h=10, level=c(80, 95), fan=FALSE, lambda=NULL, biasadj=FALS
#'
#' @param x a numeric vector or time series of class \code{ts}.
#' @param lambda transformation parameter. If \code{lambda = "auto"}, then
#' the transformation parameter lambda is chosen using BoxCox.lambda.
#' the transformation parameter lambda is chosen using BoxCox.lambda (with a lower bound of -0.9)
#' @param 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,
Expand All @@ -157,7 +157,7 @@ meanf <- function(y, h=10, level=c(80, 95), fan=FALSE, lambda=NULL, biasadj=FALS
#' @export
BoxCox <- function(x, lambda) {
if (lambda == "auto") {
lambda <- BoxCox.lambda(x)
lambda <- BoxCox.lambda(x, lower = -0.9)
}
if (lambda < 0) {
x[x < 0] <- NA
Expand Down
2 changes: 1 addition & 1 deletion man/BoxCox.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f99e12

Please sign in to comment.