Skip to content

Fix ETS missing value handling - #449

Merged
mitchelloharawild merged 4 commits into
mainfrom
ets-missing-values
Sep 8, 2026
Merged

mitchelloharawild merged 4 commits into
mainfrom
ets-missing-values

Conversation

@robjhyndman

Copy link
Copy Markdown
Member

Summary

  • Fixed a bug in seasonal ETS initial state calculation when missing values are present
  • Removed an out-dated statement about missing value handling for ETS documentation

Test plan

  • Existing tests/testthat/test-ets.R updated and passing

🤖 Generated with Claude Code

@mitchelloharawild mitchelloharawild left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, minor issue with the unit tests.

Comment thread tests/testthat/test-ets.R Outdated
Comment on lines +174 to +175
expect_no_error(UK_missing |> model(ETS(mdeaths)))
fit_missing <- UK_missing |> model(ETS(mdeaths))
expect_no_error(fit_missing)

@mitchelloharawild mitchelloharawild Sep 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The later will not correctly catch errors. testthat emits the result value invisibly from expect_*() functions which can assign fit_missing.

Suggested change
expect_no_error(UK_missing |> model(ETS(mdeaths)))
fit_missing <- UK_missing |> model(ETS(mdeaths))
expect_no_error(fit_missing)
fit_missing <- expect_no_error(UK_missing |> model(ETS(mdeaths)))

@mitchelloharawild mitchelloharawild left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! 🎉

@mitchelloharawild
mitchelloharawild merged commit 74a6058 into main Sep 8, 2026
1 check passed
@robjhyndman
robjhyndman deleted the ets-missing-values branch September 8, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants