# Get intermediate results in pystan

**URL:** <https://discourse.mc-stan.org/t/get-intermediate-results-in-pystan/6497>\
**Category:** General\
**Created:** [November 13, 2018, 2:27am UTC](https://discourse.mc-stan.org/t/get-intermediate-results-in-pystan/6497 "2018-11-13T02:27:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharp](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Sharp](https://discourse.mc-stan.org/u/Sharp)\
**Post date:** [November 13, 2018, 2:27am UTC](https://discourse.mc-stan.org/t/get-intermediate-results-in-pystan/6497/1 "2018-11-13T02:27:45Z")

</div>

Hi,  
I am relatively new to Stan. Say, I am running Stan with 10000 iterations, is it possible to print results in intermediate stages(like iterations: 500, 1000, …etc.). Or is it possible to know how many iterations are enough for the sampling algorithm to converge?

---

<div class="post-metadata">

**Author:** ![ahartikainen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ahartikainen/32/321_2.png) [@ahartikainen](https://discourse.mc-stan.org/u/ahartikainen)\
**Post date:** [November 13, 2018, 5:13am UTC](https://discourse.mc-stan.org/t/get-intermediate-results-in-pystan/6497/2 "2018-11-13T05:13:32Z")

</div>

Currently, without touching C++ code answer is no. (At least I can’t think a way to do it)

In future, maybe. When it is possible to continue sampling from the previous state. (Or I have misunderstood the concept behind mass matrix initialization [https://github.com/stan-dev/pystan/issues/505](https://github.com/stan-dev/pystan/issues/505))

There has been some discussion the discourse should one do that, but can’t find it right now.

---

<div class="post-metadata">

**Author:** ![Sharp](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Sharp](https://discourse.mc-stan.org/u/Sharp)\
**Post date:** [November 13, 2018, 5:40pm UTC](https://discourse.mc-stan.org/t/get-intermediate-results-in-pystan/6497/3 "2018-11-13T17:40:08Z")

</div>

So, the only way to do it would be to run it multiple times with different iterations?

---

<div class="post-metadata">

**Author:** ![ahartikainen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ahartikainen/32/321_2.png) [@ahartikainen](https://discourse.mc-stan.org/u/ahartikainen)\
**Post date:** [November 13, 2018, 5:42pm UTC](https://discourse.mc-stan.org/t/get-intermediate-results-in-pystan/6497/4 "2018-11-13T17:42:25Z")

</div>

Basically yes.

PyStan 3 / httpstan might change this (intermediate results)

cc @ariddell
