-
Notifications
You must be signed in to change notification settings - Fork 3
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
Changed extract_estimates argument order so the output from run() can… #53
base: master
Are you sure you want to change the base?
Conversation
… be piped into the first arg as a fit.
Maybe worth thinking about whether we want to make so easy for users to extract estimates without looking at the fit first... carefully...we don't want to encourage sub-par user behaviour right?! You can still pipe See the solution here for explainer of the |
The direct pipe of fit-to-extract is something I've wanted for when I'm doing a lot of simulation stuff.
|
Gahhh, it doesn't seem like the '.' passing method working for some reason If you use the version of hdme on
Returns an error...
@dfalster do you have any ideas. Is it probably pedantic of me to be hung up on this... in theory the dot would be the same as the changes implemented in this PR... |
A small comment, https://www.tidyverse.org/blog/2023/04/base-vs-magrittr-pipe/ |
Aha! 💡 works splendidly.
With the interest of consistency and ordering of arguments for users and promoting good diagnostic practices. My feeling is leave the code base as it and amend your simulation code as above using If the package was for personal use and strictly for Tess's thesis, I would have approved the PR in a heartbeat, but also would be interested to hear @dfalster opinion :) This reminds me a little of |
Dan and I just had a chat about this. His suggestion was to change the parameter order so it's an easy pipe when I want it but not talk about it in the paper and instead have the break in workflow to save the fit. We also discussed using an attribute imposed on the Stan fit object in hmde_run in order to avoid having to write the parameter name in as an arg for extract_estimates at all. I've never tried to do this, but it does seem like a neater way to go? |
Love the idea of a class attribute! Safer too if your user knows how to fiddle with code! Let me know if you want a primer on this :)
I don't see the paramater name as an arg for extract_estimates maybe I am missing something! |
Oh I'm a dingus, model name not parameter name. And yeah, can you talk me through the attributes stuff? Because the run function returns a stan fit object it works directly with the various things that have been built to handle those. Dan said that an attribute is probably the best way to retain all of the stan fit structure and uses while also storing the meta-data about the model. |
… be piped into the first arg as a fit.
Also updated testing for the function to reflect this structure.
While it's not strictly optimal to do because this workflow doesn't save the fit for diagnostics it is useful.