# Variational Inference output.csv from CmdStan

**URL:** <https://discourse.mc-stan.org/t/variational-inference-output-csv-from-cmdstan/9460>\
**Category:** CmdStan\
**Created:** [June 30, 2019, 2:50pm UTC](https://discourse.mc-stan.org/t/variational-inference-output-csv-from-cmdstan/9460 "2019-06-30T14:50:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shira](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/shira/32/14161_2.png) [@shira](https://discourse.mc-stan.org/u/shira)\
**Post date:** [June 30, 2019, 2:50pm UTC](https://discourse.mc-stan.org/t/variational-inference-output-csv-from-cmdstan/9460/1 "2019-06-30T14:50:36Z")

</div>

- Operating System: macOS Mojave 10.14.5
- CmdStan Version: cmdstan-2.19.1.tar.gz
- Compiler/Toolkit: g++ version 4.2.1

From the terminal, I ran:  
`> ./model variational data file=model.data.R`  
Output:

```
Begin eta adaptation.
Iteration: 1 / 250 [0%] (Adaptation)
Iteration: 50 / 250 [20%] (Adaptation)
Iteration: 100 / 250 [40%] (Adaptation)
Iteration: 150 / 250 [60%] (Adaptation)
Iteration: 200 / 250 [80%] (Adaptation)
Iteration: 250 / 250 [100%] (Adaptation)
Success! Found best value [eta = 0.1].

Begin stochastic gradient ascent.
  iter ELBO delta_ELBO_mean delta_ELBO_med notes 
   100 -3346380.401 1.000 1.000
   200 -834374.132 2.005 3.011
   300 -281093.666 1.993 1.968
   400 -127945.176 1.794 1.968
   500 -10989.192 3.564 1.968
   600 24816.866 3.210 1.968
   700 40843.712 2.808 1.443
   800 49501.247 2.479 1.443
   900 53522.280 2.212 1.197
  1000 56087.830 1.995 1.197
  1100 57740.509 1.898 1.197 MAY BE DIVERGING... INSPECT ELBO
  1200 58568.968 1.598 0.392 MAY BE DIVERGING... INSPECT ELBO
  1300 58767.108 1.402 0.175 MAY BE DIVERGING... INSPECT ELBO
  1400 59519.065 1.283 0.075 MAY BE DIVERGING... INSPECT ELBO
  1500 59821.387 0.219 0.046
  1600 59824.313 0.075 0.029
  1700 60547.624 0.037 0.014
  1800 60377.420 0.020 0.013
  1900 60825.661 0.013 0.012
  2000 60901.183 0.009 0.007 MEAN ELBO CONVERGED MEDIAN ELBO CONVERGED

Drawing a sample of size 1000 from the approximate posterior... 
COMPLETED.

```

In RStudio, I ran:

```
> fit_VI <- read_stan_csv('output.csv')

```

Output:

```
Error in numeric(iter.count) : vector size cannot be NA

```

I cannot get Excel to open `output.csv` (size 9.22 GHB) either.
