-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
virtual declarations missing for get_constrained_sizedtypes()
and get_constrained_sizedtypes()
in model_base
#3175
Comments
I’m not sure why these methods exist in the generated model to be honest, since nothing currently seems to use them. Do you have a use in mind for them? |
I was after a way of getting the dimensions of the unconstrained parameters, and |
Another option could be to parse the output of |
What's the eventual goal? I missed when those functions got added and would not have approved. I don't see the point of |
They were added back in 2019 but never exposed or used anywhere: stan-dev/stanc3#226 Using The JSON these return is much richer anyway since it lets you distinguish |
I'm updating the handling of unconstrained pars in For that I need to know their dimensions - given that they can differ from the constrained parameter dimensions returned by |
I wrote back on the original issue asking why. I don't understand the motivation and have the same concerns as @mitzimorris expressed about the proposed solution. I've always found the R devs to have almost diametrically opposed preferences to mine, which is for minimal but composable (i.e., unix-like) APIs. For example, I prefer the simple direct manipulations of NumPy to the do-it-all functions of the Tidyverse. |
Note that the proposed solution from the linked post (a named list) has since been eschewed in favour of the At a higher level, the motivation is that there are multiple use-cases which need to operate on the unconstrained parameters (e.g., moment-matching, power-scaling, plotting). Users/packages currently need to manually track the indexes of particular parameters in the single unlabeled numeric vector of values when they're performing operations or constructing their own unconstrained parameter inputs - not very user-friendly or robust to error. Additionally, the current single numeric vector structure isn't terribly amenable to a workflow operating on multiple iterations across multiple chains. Given that we have an existing API in the |
And also to clarify that the proposed solution in the linked post was using the existing structure for specifying initial values that is used by both |
Summary:
stanc
outputs methods for returning a json-formatted string of the parameter metadata, like the following for the bernoulli model:But these methods don't have corresponding virtual methods in
src/model/model_base.hpp
Current Version:
v2.31.0
The text was updated successfully, but these errors were encountered: