Is the time taken to run Stan stored in the brmsfit object?

When you run stan in the user feedback you get the time taken to run each chain - i.e.:

In the screen-shot this chain took 11988.5 seconds. Is this information stored in the brmsfit object and if yes how can I extract it ?

print(get_elapsed_time(fit)) perhaps? :)

Ehh I don’t seem to have a function get_elapsed_time() - what package is this in?

Sorry I should have also my function was fit via brms and is of class brmsfit (I will update the question)

I thought it was part of rstan, please see here:

1 Like

Ahhh ok got it. Sorry I had brms loaded but not rstan. Anyhow it doens’t seem to work on brmsfit obecjt but I’ll search for equivalent

Edit: it should work for brmsfit objects but is not for me:



$fit returns the underlying stanfit object from brms


That did it!
But is something broken with get_elapsed_timer() ? If it has a method for a brmsfit object shouldn’t it just work with having to access $fit ?

@paul.buerkner will know.

1 Like

brms does not have a corresponding method, unfortunately.