从stan
网页启动标准示例时,如下所示:
schools_code <- '
data {
int<lower=0> J; // number of schools
real y[J]; // estimated treatment effects
real<lower=0> sigma[J]; // s.e. of effect estimates
}
parameters {
real theta[J];
real mu;
real<lower=0> tau;
}
model {
theta ~ normal(mu, tau);
y ~ normal(theta, sigma);
}
'
schools_dat <- list(J = 8,
y = c(28, 8, -3, 7, -1, 1, 18, 12),
sigma = c(15, 10, 16, 11, 9, 11, 10, 18))
fit <- stan(model_code = schools_code, data = schools_dat,
iter = 1000, n_chains = 4)
(这是从这里获得的)
然而,这只为我提供了参数后验的分位数。所以我的问题是:如何获得其他百分位数?我想它应该类似于错误(?)
备注:我试图介绍标签stan
,但是我的名声太小了;)抱歉