When probability statement only includes parameters - use non-centered parameterisation

Hello,

I have a big hierarchical regression model. As it makes sense to see how it works without data, I did that. I could not manage to get a good mixing, so I simplified the model to detect the minimum pathology.

Why is a simple model like this not mix well? Play understand the two parameters will be correlated but I don’t see why they should not mix very well.

The weird mixing you see below gets worse as the model gets more complicated however the same mixing patterns remain. I suspect this is the underlying cause of the poor mixing of my model without the data.

Should all models work well without data to be declared as good models to start with?


parameters {
  real alpha; 
	real  beta; 
}

model {
  beta ~  normal( alpha, 0.5);
	alpha ~ normal(0,  0.5);
}

Worst still if one of the standard deviations is a parameter

parameters {
  real alpha; 
	real  beta; 
	real<lower=0> phi;
}

model {
  beta ~ normal( alpha, phi);
  beta ~ student_t(3,0,1);
	alpha ~ normal(0,  0.5);
	
	phi ~ gamma(3,3);
}
Warning: 76 of 4000 (2.0%) transitions ended with a divergence.
See https://mc-stan.org/misc/warnings for details.

Fit with cmdstanr

The non-centered parameterization is crucial, should have studies the manual better.

parameters {
  real alpha; // Root
  real<lower=0> phi;
  real<offset = alpha, multiplier = phi>  beta; // Root
}

model {
	
  beta ~ normal( alpha, phi);
	alpha ~ normal(0,  0.5);
	phi ~ gamma(3,3);
}
1 Like