stan-dev / rstanarm

rstanarm R package for Bayesian applied regression modeling
https://mc-stan.org/rstanarm
GNU General Public License v3.0
383 stars 131 forks source link

Allow chains argument when algorithm is not sampling #318

Open DominiqueMakowski opened 5 years ago

DominiqueMakowski commented 5 years ago

I usually start scripting my analyses with other algorithms, such as meanfield, make sure the script is running smoothly and without errors, and only then replace meanfield with "sampling" and run the analysis (which could take then days to compute).

Currently, setting the chains parameter if algorithm="meanfield" returns an error (Error: passing unknown arguments: chains.), leading to adding and removing of all the chains parameters within a script everytime we switch between two algorithms, which can become tedious in the case of many models.

I would be nice if the chains argument would just be ignored if not relevant (there could be a message: "chains parameter ignored"). What are your opinions on this?

jgabry commented 5 years ago

Sorry for the slow reply. I just noticed nobody responded. I’m not opposed to this if there’s a warning about it. Maybe a message is sufficient.