-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
gqs() does not work with transformed parameters #714
Comments
Thanks for filing a careful issue. To work properly, the parameters have to be the same, but everything else could vary in a model used for standalone generated quantities. So I think you're right that we could allow arbitrary transformed parameters. We should at least allow the transformed parameters from the original Stan program. To work around for now, you can move that transformed parameter definition into the generated quantities block and it should be OK. |
This is fine for simple models, but a bit annoying for more complex ones. (Maybe I should just do that with different |
Right---that was the original intent---just swap in a new generated quantities block.
It should be possible to run standalone generated quantities with only the original parameters declaration and a generated quantities block.
If the data block is included in the standalone gq program, the data should be read and available for generated quantities. It doesn't need to match the original data. That's how we should be able to do predictive inference---read in new x_tilde and generate new y_tilde and don't read in original data (which might be large).
The transformed parameters declarations and definitions could conceivably change from the original program. It'd probably be better to make that kind of change directly in the generated quantities block. So the question is whether we should flag it as an error, warning, or just allow it without comment as things run.
I don't think the model needs to be executed in standalone generated quantities (even if we did execute it, the constants change and target() wouldn't be the same). So it should be optional in the standalone generated quantities programs and perhaps raise a warning.
I think we should probably allow lp__ to be read in so that target() is well defined in the gq block.
If any of this isn't happening, I'd consider it a bug (other than lp__, which I don't think we ever discussed as a feature).
… On Nov 7, 2019, at 11:47 AM, Max Mantei ***@***.***> wrote:
To work around for now, you can move that transformed parameter definition into the generated quantities block and it should be OK.
This is fine for simple models, but a bit annoying for more complex ones. (Maybe I should just do that with different #includes for now...) I think having a workflow where you just have to "swap out" the model block with a generated quantities block would be really great. :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi,
Moving transformed data to the generated quantities block is problematic, because the output saves more variables. I was using this feature because the output was already huge and I wanted to limit the iterations. |
No progress on this? |
Summary:
Standalone generated quantities via
qgs()
don't work with transformed parameters.Description:
See this discourse topic: Using transformed parameters leads to error
Wrong number of parameter values in draws from fitted model. Expecting 2 columns, found 3 columns.
which, I guess, comes fromstan/src/stan/services/sample/standalone_gqs.hpp
.Reproducible Steps:
Current Output:
Expected Output:
RStan Version:
R Version:
Operating System:
Win7 Pro SP1
The text was updated successfully, but these errors were encountered: