Skip to content

Commit

Permalink
Revert "Fixed estimate of residual variance in mean model"
Browse files Browse the repository at this point in the history
This reverts commit a331f90.
  • Loading branch information
robjhyndman committed Oct 11, 2023
1 parent a331f90 commit 38900b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/mean.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ train_mean <- function(.data, specials, ...) {
fits <- dplyr::lag(fits)
}
res <- y - fits
sigma <- sqrt(mean(res^2, na.rm = TRUE))
sigma <- sd(res, na.rm = TRUE)

structure(
list(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-mean.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_that("MEAN", {
)

expect_equivalent(
glance(fit)$sigma2, mean(scale(USAccDeaths_tbl$value, scale = FALSE)^2)
glance(fit)$sigma2, var(scale(USAccDeaths_tbl$value, scale = FALSE))
)

expect_identical(
Expand Down

1 comment on commit 38900b5

@robjhyndman
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. See discussion at robjhyndman/fpp3#12

Please sign in to comment.