Skip to content

Initial Fix for iteration error#5

Merged
petersonR merged 5 commits intomainfrom
iter-issue
Nov 29, 2025
Merged

Initial Fix for iteration error#5
petersonR merged 5 commits intomainfrom
iter-issue

Conversation

@petersonR
Copy link
Owner

closes #4

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an iteration error (issue #4) by replacing the apply(sapply()) pattern with sapply(lapply()) in two functions. The change corrects how minimum BIC and AICc values are extracted from a list of model fits. The PR also updates the test coverage workflow to use codecov-action v5, updates some package metadata, and regenerates README documentation with updated model output.

  • Fixed iteration error in get_oos_results() and fastTS() by changing from apply(sapply(fits, BIC), 2, min) to sapply(lapply(fits, BIC), min)
  • Updated GitHub Actions workflow to use codecov-action v5 with explicit file upload
  • Updated package maintainer email address and other metadata

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
R/helpers.R Fixed iteration error in get_oos_results() function for BIC and AICc computation
R/fastTS.R Fixed iteration error in main fastTS() function for BIC and AICc computation
README.md Regenerated with updated model output and added duplicate Codecov badge
README.Rmd Added duplicate Codecov test coverage badge
NEWS.md Added entry documenting fix for issue #4
DESCRIPTION Updated maintainer email, RoxygenNote version, and package date
.github/workflows/test-coverage.yaml Modernized workflow with codecov-action v5 and updated action versions
Comments suppressed due to low confidence (3)

R/fastTS.R:218

  • Incomplete fix: The same apply(sapply()) pattern that was fixed in lines 179 and 181 still exists here in the plot.fastTS() function. This should be changed to sapply(lapply(x$fits, AICc), min) for consistency and to prevent the same iteration error.
    x$fits[[which.min(apply(sapply(x$fits, AICc), 2, min))]]

R/fastTS.R:249

  • Incomplete fix: The same apply(sapply()) pattern that was fixed in lines 179 and 181 still exists here in the coef.fastTS() function. This should be changed to sapply(lapply(object$fits, pen_fn), min) for consistency and to prevent the same iteration error.
    object$fits[[which.min(apply(sapply(object$fits, pen_fn), 2, min))]]

R/fastTS.R:263

  • Incomplete fix: The same apply(sapply()) pattern that was fixed in lines 179 and 181 still exists here in the print.fastTS() function. These lines should be changed to sapply(lapply(x$fits, AICc), min) and sapply(lapply(x$fits, BIC), min) respectively for consistency and to prevent the same iteration error.
  best_AICc = apply(sapply(x$fits, AICc), 2, min)
  best_BIC = apply(sapply(x$fits, BIC), 2, min)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

petersonR and others added 3 commits November 29, 2025 15:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@petersonR petersonR merged commit aa85385 into main Nov 29, 2025
7 checks passed
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.

Warning: Maximum Number of Iterations Reached

1 participant

Comments