If we do this (which I'll go on record as objecting to because of
its lack of transparency and its dependence on globals), then we
shouldn't leave it the way it is now where it will pull everything
out of the blog environment into a var_context --- it's going to
make all the behavior depend not only on the relevant global vars,
but also irrelevant ones.
Let's try to at least remain as modular as possible.
So what I'd propose (if we do this) is to add a new code-generated
method to the generated model class
std::vector<std::string> data_variable_names();
that returns a vector of data variable names. This should only take
me a day or so, including testing.
Then, we would create a var_context from the model and an environment
(defaulting to the global environment) that would pull out all the
variables named in the model from the global environment to create
a var_context.
My main objection to all of this is that it's not clear from the call
stan(...) which dependencies there are on the global environment. You
need to look inside the file/string defining the Stan model for that.
I can also anticipate Andrew's next request, which will be to pull out of the
list just the variables given by the list, and pull the rest out of the
global environment, but maybe we should punt on that (though the
stacking/chainging/whatevering var_context should allow it pretty easily).
- Bob
>> >> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-users+...@googlegroups.com.
>> >> For more options, visit
https://groups.google.com/d/optout.
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an email to
stan-users+...@googlegroups.com.
>> > For more options, visit
https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-users+...@googlegroups.com.