-
Notifications
You must be signed in to change notification settings - Fork 33
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
Reconsider distribution interface. #382
Comments
I can see two options here, both involving breaking changes but one slightly more than the other
Any other suggestions? |
The other alternative in 1. is to make everything including the gamma be parameterised with the names of the parameters used in stan and then link out to those. That would help with documentation etc. It does mean that the easy of parameterization would go away for the If we went with two we could support different parameters for different distributions and potentially multiple for the same distribution (this would mean doing a transformation internally (in both R and stan)). |
we could make this a bit fancy and specify the dist using some sugar so that you write |
Unless we also do this in stan but it adds quite a lot of overhead (as above) |
Yes I suspect that would be the more user friendly option as could also e.g. parameterise using a median etc. but it's potentially less transparent for the user what's happening under the hood with |
Yes potentially though I don't think I'd know how to do it. |
I think it would be just some regex stuff? I did a similar thing for the |
or literally have |
Wouldn't this add a whole layer of required input checking, and also preclude us from passing e.g. variables or function calls etc.? Perhaps fine but seems a heavy price for a small (even nonzero?) gain. |
I could see how that could work. But again seems to add some overhead and I'm not even sure that dist_spec(lognormal(meanlog = 3, sdlog = 1)) is that much better than dist_spec(distribution = "lognormal", params = c(meanlog = 3, sdlog = 1)) but perhaps it is. Definitely less typing. |
I think it looks more flashy but I'm not sure it is clearly better. It might help a bit with documentation though (as the parameters that the lognormal need can be in the lognormal docs rather than all in the dist_spec docs. |
I think it's complicated and brittle to use regexes to manipulate code, or more generally treat code as text ( |
So could we not try get rid of lognormal(meanlog = 3, sdlog = 1) directly and under the hood that would use dist_spec stuff? |
Originally posted by @seabbs in #363 (comment)
At the moment the
mean
andsd
variables indist_spec
mean different things depending on whether a gamma or lognormal is used. This is not really ideal and it would be good to think about a way to make this more intuitive, where parameters aquire their "natural" meaning.The text was updated successfully, but these errors were encountered: