> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.4 (El Capitan)
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rstan_2.10.1 StanHeaders_2.10.0-2 ggplot2_2.1.0
loaded via a namespace (and not attached):
[1] colorspace_1.2-6 scales_0.4.0 plyr_1.8.4 parallel_3.3.1 inline_0.3.14 gtable_0.2.0 gridExtra_2.2.1 Rcpp_0.12.5 grid_3.3.1
[10] stats4_3.3.1 munsell_0.4.3
> print(stanFit, pars=c('b1', 'b2', 'sdModel'), probs=c(0.025, 0.5, 0.975)) # works fine
Inference for Stan model: test.
3 chains, each with iter=10000; warmup=5000; thin=5;
post-warmup draws per chain=1000, total post-warmup draws=3000.
mean se_mean sd 2.5% 50% 97.5% n_eff Rhat
b1 2.15 0 0.11 1.93 2.15 2.37 2798 1
b2 -3.01 0 0.02 -3.04 -3.01 -2.97 2777 1
sdModel 1.06 0 0.08 0.92 1.06 1.23 2997 1
Samples were drawn using NUTS(diag_e) at Thu Jun 30 08:58:42 2016.
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).
The estimated Bayesian Fraction of Missing Information is a measure of
the efficiency of the sampler with values close to 1 being ideal.
For each chain, these estimates are
0.8 0.9 1
> traceplot(stanFit, pars=c('b1', 'b2', 'sdModel')) # works fine
> stan_diag(stanFit, pars=c('b1', 'b2', 'sdModel')) # fails
Error in gList(lp_hist = list(grobs = list(list(x = 0.5, y = 0.5, width = 1, :
only 'grobs' allowed in "gList"
In addition: Warning messages:
1: In grob$wrapvp <- vp : Coercing LHS to a list
2: In grob$wrapvp <- vp : Coercing LHS to a list
3: In grob$wrapvp <- vp : Coercing LHS to a list
>
While we sort this out, you can get similar plots to stan_diag with our shinystan package/GUI.
Jonah