Description Usage Arguments Value References See Also Examples

Similar to the `print`

method for `stanfit`

objects, but `monitor`

takes an array of simulations as its argument rather than a `stanfit`

object. For a 3-D array (iterations * chains * parameters) of MCMC draws,
`monitor`

computes means, standard deviations, quantiles, Monte Carlo
standard errors, split Rhats, and effective sample sizes. By default, half of
the iterations are considered warmup and are excluded.

1 2 3 |

`sims` |
A 3-D array (iterations * chains * parameters) of MCMC simulations from any MCMC algorithm. |

`warmup` |
The number of warmup iterations to be excluded
when computing the summaries. The default is half of the total number
of iterations. If |

`probs` |
A numeric vector specifying quantiles of interest. The
defaults is |

`digits_summary` |
The number of significant digits to use when printing the summary, defaulting to 1. Applies to the quantities other than the effective sample size, which is always rounded to the nearest integer. |

`print` |
Logical, indicating whether to print the summary after the computations are performed. |

`...` |
Additional arguments passed to the underlying |

A 2-D array with rows corresponding to parameters and columns to the summary statistics.

The Stan Development Team
*Stan Modeling Language User's Guide and Reference Manual*.
http://mc-stan.org.

S4 class `stanfit`

and particularly its
`print`

method.

1 2 3 4 5 6 | ```
csvfiles <- dir(system.file('misc', package = 'rstan'),
pattern = 'rstan_doc_ex_[0-9].csv', full.names = TRUE)
fit <- read_stan_csv(csvfiles)
# The following is just for the purpose of giving an example
# since print can be used for a stanfit object.
monitor(extract(fit, permuted = FALSE, inc_warmup = TRUE))
``` |

```
Loading required package: ggplot2
Loading required package: StanHeaders
rstan (Version 2.15.1, packaged: 2017-04-19 05:03:57 UTC, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
Inference for the input samples (4 chains: each with iter=200; warmup=100):
mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhat
mu 0.1 0.0 0.2 -0.4 -0.1 0.1 0.2 0.6 335 1
sigma 1.2 0.0 0.2 0.9 1.0 1.1 1.3 1.7 185 1
z[1,1] 0.0 0.1 0.9 -1.8 -0.6 0.0 0.7 1.6 286 1
z[2,1] 0.1 0.1 1.0 -1.7 -0.5 0.1 0.8 2.0 287 1
z[3,1] -0.1 0.1 1.1 -2.1 -0.8 -0.1 0.7 1.9 400 1
z[1,2] 0.0 0.1 1.0 -2.0 -0.7 0.0 0.7 2.0 270 1
z[2,2] 0.0 0.0 0.9 -1.9 -0.7 0.1 0.7 1.7 400 1
z[3,2] 0.1 0.1 1.0 -1.7 -0.5 0.1 0.8 2.2 311 1
alpha 0.5 0.0 0.5 0.0 0.2 0.4 0.7 2.1 400 1
lp__ -17.5 0.2 2.3 -23.3 -18.7 -17.2 -15.8 -14.3 132 1
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at
convergence, Rhat=1).
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.