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

reviewing calibration vignette #111

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

papsti
Copy link
Collaborator

@papsti papsti commented Aug 9, 2023

this PR currently contains no real changes; just setting this up as a PR to enable code review + directly committing changes to the vignette without modifying the article as it appears on the pkg website

IP: This is a bit of a larger point that Steve may want to weigh in on, but the object-oriented approach here makes it a little more difficult to understand how to get help with various functions. For instance, I can't just do `?report` to get info on the arguments for the function above. Perhaps including a short section on the home page of `macpan2` quickly explaining that `macpan2` is object-oriented and how one can get help on object methods would be helpful. I know I had [something about this in the first Quickstart guide](https://canmod.github.io/macpan2/articles/quickstart.html#side-note-macpan2-is-object-oriented), but it didn't go as far as to explain how to get help, which I think is as simple as

```
> class(sir_simulator)

Choose a reason for hiding this comment

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

Yes I completely agree @papsti . Something like this in the vignette makes it even more important to make sure that the method documentation is up-to-date. It also makes me want to write a macpan_help function that does basically what you just did.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

can you write your own object-specific help() methods (similar to how one can write custom print methods that get called with print()) as opposed to prefixing with macpan_?

Copy link
Member

@stevencarlislewalker stevencarlislewalker Aug 9, 2023

Choose a reason for hiding this comment

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

Yes that's a better idea. But not as S3 methods. It would be more object$help().

Copy link
Collaborator Author

@papsti papsti left a comment

Choose a reason for hiding this comment

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

@bbolker @stevencarlislewalker

more comments added inline (prefixed with "IP:") because my great code review experiment didn't work (you can't comment on unchanged lines 😢).

i know you mostly wanted comments about the mk_calibrate() UI but i literally cannot resist commenting on the presentation of the vignette 😄 overall this is a great work in progress, though i am concerned it's getting a little too long. consider splitting into two documents:

  1. a getting started with calibration vignette that does a simple example (with simulated data) to explain how to work with mk_calibrate(), followed by the "Hello, World the hard way" section that explains how mk_calibrate() works so that users can customize their own versions
  2. a cookbook/set of case studies for more involved calibrations (all the other sections currently in this vignette

@@ -61,7 +61,7 @@ mk_sim <- function(init_state = c(S = 99, I = 1, R = 0)) {
sir_simulator <- mk_sim()
## `.phases = "during"` is important so that the number of observations matches the number of time steps
sir_results = sir_simulator$report(.phases = "during")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it would be good to point to the documentation that explains what .phases = "during" means here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as an aside: why is .phases = "during" not the default?

@papsti
Copy link
Collaborator Author

papsti commented Aug 9, 2023

@bbolker @stevencarlislewalker just to be clear, i don't think my changes should be pulled in as is since they're mostly comments/suggestions (despite the fact that this is a PR). once these comments are resolved, the changes could be pulled in.

@bbolker
Copy link
Collaborator

bbolker commented Aug 10, 2023

A few responses

  • we did discuss making .phases = "during" the default (see Thoughts on calibration quickstart #102); it's a breaking change but (as Steve said before) now is probably the best time to do it
  • I agree that the document is getting long (and I'm in danger of making it longer, as I add stuff to mk_calibrate. I agree that "'hello, world', easy and hard" and "intermediate/advanced topics in calibration" is a good split. I'm not quite sure which of the stuff about CIs to put where (I guess making the delta-method stuff the default and leaving it in the beginners' document, and moving the rest to a section in the intermediate document?)

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.

3 participants