stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.04k stars 269 forks source link

Provide callback for chain progress #682

Open vankesteren opened 5 years ago

vankesteren commented 5 years ago

Summary:

In order to interact programmatically with rstan, e.g., to provide progress bars, it would be nice if rstan() accepts a callback function which runs every time a chain updates.

Description:

In order to create progress indicators in programs building on rstan, currently it is neccessary to capture and parse the stdout. See, for example this repo. This is quite hacky, and in my opinion a callback would be a much nicer solution.

jgabry commented 5 years ago

Someone just pointed me to your tweet. Sorry nobody responded sooner! That does seem like a nice feature. I'm not sure when someone will have time to do this but if anyone wants to try to contribute this that would be cool.

I'm not sure but this also could be easier to implement in CmdStanR, so that's also a possibility

riddell-stan commented 5 years ago

httpstan does this, in essence. Sampling occurs in one thread and another thread monitors the progress, as it occurs.

jgabry commented 5 years ago

@ariddell Cool!

LeeDongGeon1996 commented 2 years ago

Hi, I have same issue now, Is there any progress on this?