Suppress MC output during sampling in stan_glm & Co

When calling function stan_glm, stan_lm, etc. by default there is provided a sampling status update every 200 iterations. I’d like to completely suppress this output generally. This can be achieved by adding refresh=0 to the function call as additional parameter e.g.

library(rstanarm)
stan_glm(Sepal.Length~Species, data=iris, refresh=0)

However I’d like to have this set as default for all respective functions (stang_glm, stan_lm, …) instead of having to provide it with every single call.

How can I do this without having to create separate wrapper functions for every single one of the above to include the parameter in the call?

Seemingly the refresh=0 gets passed on in the dotlist (“...”) and is not a part of the functions named above themselves.

There is also not contained anything in stan_options with this regard. Is there some central place, where I – after loading the rstanarm package – could set this like e.g.

formals(xxx)$refresh <- 0

with “xxx” denoting the name of this universally called function?

1 Like

Unfortunately, I think this is not possible as refresh is only ever accessed via from the ... argument everywhere.

1 Like

What @martinmodrak said is right, but I would be open to adding this to rstanarm. I think a way to set a global option for refresh would be useful and it should be pretty easy to implement. Do you use GitHub? If so, do you mind opening a GitHub issue to request the feature? Issues · stan-dev/rstanarm · GitHub