xfim / ggmcmc

Graphical tools for analyzing Markov Chain Monte Carlo simulations from Bayesian inference
111 stars 31 forks source link

Simple Stan test case #18

Closed dmenne closed 11 years ago

dmenne commented 11 years ago
library(ggmcmc)
stanmodelcode <- "
data {
int<lower=0> N;
real y[N];
} 
parameters {
real mu;
} 
model {
mu ~ normal(0, 10);
y ~ normal(mu, 1); 
} 
"

y <- rnorm(20) 
dat <- list(N = 20, y = y); 
fit <- stan(model_code = stanmodelcode, data = dat, chains = 3)
#### Another bug in ggmcmc: this dependency is missing. 
# Things should work without the next line
library(coda) # Bit this one gives an warning which should be avoided by using namespaces
s = ggs(fit)
#Error in 1:n.samples : argument of length 0
dmenne commented 11 years ago

Add-on to the above: once this works (my error?), try chains = 1 to reproduce #13

jucor commented 11 years ago

Regarding the coda dependency and the warning, this is fixed in Pull-Request #19.

jucor commented 11 years ago

Found the problem with gs(), fixed it in #20 : it happens when your model only has one variable. Until @xfim can merge in the official repo, feel free to use my master branch.

xfim commented 11 years ago

As for the first comment by @dmenne "#### Another bug in ggmcmc: this dependency is missing.". If you refer to the "rstan" package, it is not possible to add it as a dependency, because rstan is not in CRAN (see https://groups.google.com/forum/#!msg/stan-users/LMMxkuMinag/3fAgH3yjm0wJ).

dmenne commented 11 years ago

Correct, I had forgotten that. Maybe put that into the docs.

jucor commented 11 years ago

Good point! Do you know why isn't rstan in CRAN and why "you can't count on RStan being on CRAN any time soon" (to quote STAN's developer in your link above)?

dmenne commented 11 years ago

One reason is that CRAN is too limited when it comes to running larger test suites. CRAN is a horrible dinosaur; time for mammalian revolution.

xfim commented 11 years ago

No, @jucor, I don't know the reason.

xfim commented 11 years ago

rstan not being into CRAN added into the documentation of ggs by commit #e5194ec28. This should solve the issue.