Leaving unconstrained parameters innovSizeInit, regCoef and regOffset no prior in model block, it is implicitly assuming uniform (improper) prior. Theoretically it would not affect HMC. However, Stan does produce tons of divergent transitions. Set dummy priors to avoid it.
Example:
library(rstan)
without_prior_code =
'data {
int<lower=0> N;
vector[N] y;
}
parameters {
real mu;
real<lower=0> dummy;
}
model {
y ~ normal(mu, 1);
}
'
model_without_prior = stan_model(model_code = without_prior_code)
set.seed(123)
y = rnorm(100, 2.3, 1)
data = list(N = length(y), y = y)
samples_without_prior = sampling(object = model_without_prior,
data = data, chains = 1, seed = 123)
check_hmc_diagnostics(samples_without_prior)
It would produce
Divergences:
758 of 1000 iterations ended with a divergence (75.8%).
Try increasing 'adapt_delta' to remove the divergences.
Tree depth:
0 of 1000 iterations saturated the maximum tree depth of 10.
Energy:
E-BFMI indicated no pathological behavior.
Btw, the original stan files has mixing tabs and spaces. That's why the diff is displayed in github with very ugly spacing.
Leaving unconstrained parameters
innovSizeInit
,regCoef
andregOffset
no prior in model block, it is implicitly assuming uniform (improper) prior. Theoretically it would not affect HMC. However, Stan does produce tons of divergent transitions. Set dummy priors to avoid it.Example:
It would produce
Btw, the original stan files has mixing tabs and spaces. That's why the diff is displayed in github with very ugly spacing.