# I can't get summary of my model

**URL:** <https://discourse.mc-stan.org/t/i-cant-get-summary-of-my-model/28358>\
**Category:** CmdStan\
**Created:** [July 28, 2022, 1:40am UTC](https://discourse.mc-stan.org/t/i-cant-get-summary-of-my-model/28358 "2022-07-28T01:40:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corgi-welsh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/corgi-welsh/32/14668_2.png) [@Corgi-welsh](https://discourse.mc-stan.org/u/Corgi-welsh)\
**Post date:** [July 28, 2022, 1:40am UTC](https://discourse.mc-stan.org/t/i-cant-get-summary-of-my-model/28358/1 "2022-07-28T01:40:39Z")

</div>

Hi, I recently changed my model from rstan to cmdstanr, and I’ve run my model and it was successful seemingly.  
Before I run my model, I did run small size of my test model, and I could get the result of mcmc sampling

```nohighlight
> well
   variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
 lp__ -22.79 -22.47 2.20 1.99 -26.78 -19.88 1.02 344 407
 r1f 5.69 5.09 3.47 3.52 1.06 12.02 1.01 917 525
 r1r 4.46 3.81 3.31 3.24 0.30 10.89 1.01 627 451
 r2f 4.26 3.66 3.14 3.16 0.25 9.77 1.01 385 201
 r3f 4.97 4.41 3.02 3.12 0.93 10.55 1.01 810 423
 r4f 5.74 5.26 3.25 3.14 1.26 11.69 1.00 689 451
 r5f 6.94 6.61 3.24 3.18 2.20 12.78 1.01 697 396
 r6f 4.91 4.40 2.97 3.01 0.98 10.58 1.01 743 440

```

However, with my large size of test model, I can’t get summary of my result. I get error message below.

```nohighlight
fit_cl
Error in read_cmdstan_csv(files = self$output_files(include_failed = FALSE), : 
  Assertion on 'files' failed: File does not exist: '/tmp/RtmphBvYXd/test-202207270907-1-7904b7.csv'.

```

I doubt with my result that it didn’t save the csv file so I ran below code, and it seems it have right csv file but it can’t read this.

```nohighlight
fit_cl$output_files()
[1] "/tmp/RtmphBvYXd/test-202207270907-1-7904b7.csv"
[2] "/tmp/RtmphBvYXd/test-202207270907-2-7904b7.csv"
[3] "/tmp/RtmphBvYXd/test-202207270907-3-7904b7.csv"
[4] "/tmp/RtmphBvYXd/test-202207270907-4-7904b7.csv"

```

What make this problem and how can I fix this??

---

<div class="post-metadata">

**Author:** ![Stuart\_Russell](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/stuart_russell/32/11960_2.png) [@Stuart\_Russell](https://discourse.mc-stan.org/u/Stuart_Russell)\
**Post date:** [July 28, 2022, 5:58am UTC](https://discourse.mc-stan.org/t/i-cant-get-summary-of-my-model/28358/2 "2022-07-28T05:58:47Z")

</div>

The `fit$output_files()` gives the _path_ of the CSV files, but doesn’t check that they exist. I’d bet you’ve started a new R session & the relevant `/tmp` directory has been cleaned up, or the model was fit on a different computer.

You can choose a different location by fitting the model using the `output_dir` & `output_basename` arguments for `$sample(...)` Saving them outside the `/tmp` directory would allow them to persist across sessions.

If you have already saved a `.draws <- fit$draws()` object anywhere, you could get the summary using `posterior::summarise_draws(.draws)` instead. This is what `fit$summary()` does under the hood.

---

<div class="post-metadata">

**Author:** ![Corgi-welsh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/corgi-welsh/32/14668_2.png) [@Corgi-welsh](https://discourse.mc-stan.org/u/Corgi-welsh)\
**Post date:** [July 29, 2022, 2:07am UTC](https://discourse.mc-stan.org/t/i-cant-get-summary-of-my-model/28358/3 "2022-07-29T02:07:10Z")

</div>

> [@Stuart\_Russell](#):
>
> The `fit$output_files()` gives the _path_ of the CSV files, but doesn’t check that they exist. I’d bet you’ve started a new R session & the relevant `/tmp` directory has been cleaned up, or the model was fit on a different computer.

Thanks Stuart! I guess my R session was once closed after sampling was done.  
Now I re-run the model and save the object after the sampling.(And It works!)  
Thanks a lot!
