Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pfilter(..., save.states) + documentation edits #223

Closed
wants to merge 2 commits into from

Conversation

jeswheel
Copy link
Contributor

There are two commits, the first deals with the save.states argument of the pfilter function. The second is unrelated, but addresses some unexpected errors that arise in a few of the \donttest{} examples.

Details

There are no changes to the tests/*.Rout.save files that change with the edits to the testing files and function outputs. I thought you might want to see these differences and change them yourself.

Commit 598b470: save.states

This commit is related to discussion comments #181 (comment) and #181 (comment). This modifies the save.states argument in the pfilter function to the following scheme:

  • no: default, don't save states.
  • filter: saves the "unweighted particles" after resampling. The name is intended to reference the fact that these particles are draws from the filter distribution.
  • prediction: saves the "weighted particles". The name is intended to reference the fact that the particles come from the prediction distribution.

The function retains backwards compatibility by checking for old input options, matching them to the new options, and throwing a warning. weighted -> "prediction", c(unweighted, TRUE, "TRUE") -> "filter", and c(FALSE, "FALSE") -> "no". I'm happy to change the names filter and prediction if you have other preferences.

Commit bd616a7: Documentation edits

This is an unrelated change of documentation. There was an extra comma in the examples/traj_match file, which doesn't get tested. Similarly, the untested functions in examples/userdata.R did not actually use the userdata function, and would throw an error if they were ran.

@kingaa kingaa self-assigned this Dec 12, 2024
@kingaa
Copy link
Owner

kingaa commented Dec 12, 2024

Thanks @jeswheel ! I see that it has been too long since I tested the "donttest" examples. Good catch!

@kingaa
Copy link
Owner

kingaa commented Dec 12, 2024

@jeswheel : I've edited your first commit to make it a bit more straightforward and lightweight. Thanks so much!

@kingaa kingaa closed this Dec 12, 2024
@jeswheel jeswheel deleted the weights branch December 13, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants