I am fitting something closely analogous to a hierarchical logistic regression model with a spline function of one x variable. My question concerns warmup iterations. Typically I have more informative constraints on the spline parameters (obtained from a preliminary ML fit). See typical chain plot below.

When I allow a very uninformative prior on the spline, these parameters converge somewhat more slowly.

My general question concerns speeding up the convergence of similar runs of this model. Are there parameters of the warmup phase that I could do a better job tuning after fitting this model once that would make future runs quicker?

Thanks!

Clark

See stan code below:

```
data {
int<lower=1> N; // total number of observations
int<lower=1> NC; // total number of observations for controls
int<lower=0> Y[N];
int Y_control[NC];
int trials[N]; // response variable
int trials_control[NC]; // Trials for controls
matrix[N, 9] X; // X matrix
//matrix[9, 9] x_cov;
//vector[9] beta_mu;
int<lower=1> N_seasonXfield;
int<lower=1> seasonXfield_ID[N];
int<lower=1> N_fieldXdate;
int fieldXdate_ID[N];
int fieldXdate_control_ID[NC];
int<lower=1> N_can; // number of grouping levels
int<lower=1> can_ID[N]; // grouping indicator per observation
int<lower=1> N_shoot; // number of grouping levels
int<lower=1> N_shoot_control; // number of grouping levels
int<lower=1> shoot_ID[N]; // grouping indicator per observation
int<lower=1> shoot_control_ID[NC]; // grouping indicator per observation
int<lower=1> N_bud; // number of grouping levels
int<lower=1> N_bud_control; // number of grouping levels
int<lower=1> bud_ID[N]; // grouping indicator per observation
int<lower=1> bud_control_ID[NC]; // grouping indicator per observation
int prior_only;
}
parameters {
vector[9] beta;
real <lower=0> S_seasonXfield;
vector[N_seasonXfield] z_seasonXfield;
vector[N_fieldXdate] z_fieldXdate;
vector[N_fieldXdate] z_fieldXdate_fi; // direct prior on these
real <lower=0> S_fieldXdate;
real <lower=0> S_fieldXdate_fi;
real <lower=0> S_can;
vector[N_can] z_can;
real <lower=0> S_Shoot;
vector[N_shoot] z_Shoot;
//real <lower=0> S_Shoot_fi;
//vector[N_shoot] z_Shoot_fi;
vector[N_shoot_control] z_Shoot_control;
real <lower=0> S_bud;
vector[N_bud] z_bud;
//real <lower=0> S_bud_fi;
//vector[N_bud] z_bud_fi;
vector[N_bud_control] z_bud_control;
}
transformed parameters {
vector[N_seasonXfield] r_seasonXfield;
vector[N_fieldXdate] r_fieldXdate;
vector[N_fieldXdate] r_fieldXdate_fi;
vector[N_can] r_can;
vector[N_shoot] r_Shoot;
//vector[N_shoot] r_Shoot_fi;
vector[N_shoot_control] r_Shoot_control;
vector[N_bud] r_bud;
//vector[N_bud] r_bud_fi;
vector[N_bud_control] r_bud_control;
r_seasonXfield = S_seasonXfield * z_seasonXfield;
r_fieldXdate = z_fieldXdate*S_fieldXdate;
r_fieldXdate_fi = z_fieldXdate_fi*S_fieldXdate_fi;
r_can = S_can * z_can;
r_Shoot = S_Shoot * z_Shoot;
//r_Shoot_fi = S_Shoot_fi * z_Shoot_fi;
r_Shoot_control = S_Shoot * z_Shoot_control;
r_bud = S_bud * z_bud;
//r_bud_fi = S_bud_fi * z_bud_fi;
r_bud_control = S_bud * z_bud_control;
}
model {
if(!prior_only) {
vector[N] lo;
vector[NC] loc;
lo = X * beta + r_seasonXfield[seasonXfield_ID] + r_fieldXdate[fieldXdate_ID] + r_can[can_ID] + r_Shoot[shoot_ID] + r_bud[bud_ID];
loc = r_fieldXdate_fi[fieldXdate_control_ID] + r_Shoot_control[shoot_control_ID] + r_bud[bud_control_ID];
target += binomial_lpmf(Y | trials, inv_logit(lo) .* inv_logit(r_fieldXdate_fi[fieldXdate_ID]+r_Shoot[shoot_ID])); // r_Shoot_fi[shoot_ID] doubles the time required, having to compute this
//target += binomial_logit_lpmf(Y | trials, lo);
Y_control ~ binomial_logit(trials_control, loc);
}
//to_vector(beta) ~ multi_normal(beta_mu, x_cov);
beta ~ normal(0, 6);
z_seasonXfield ~ normal(0, 1);
S_seasonXfield ~ inv_gamma(3, 0.5);
z_fieldXdate ~ normal(0, 1);
z_fieldXdate_fi ~ normal(0, 1);
S_fieldXdate ~ inv_gamma(3,3);//normal(3, 6); // Change to a invgamma
S_fieldXdate_fi ~ inv_gamma(3,3);//normal(3, 6); // Change to a invgamma
z_can ~ normal(0, 1);
S_can ~ inv_gamma(3, 3);
z_Shoot ~ normal(0, 1);
//z_Shoot_fi ~ normal(0, 1);
z_Shoot_control ~ normal(0, 1);
S_Shoot ~ inv_gamma(3, 3); //3,3
//S_Shoot_fi ~ inv_gamma(3,3);//inv_gamma(4,1);//normal(1,0.15);//inv_gamma(3,3);//normal(1,0.15);//inv_gamma(5, 3);//normal(1,0.15);//;//;//;
z_bud ~ normal(0, 1);
z_bud_control ~ normal(0, 1);
S_bud ~ inv_gamma(3, 3);
//S_bud_fi ~ normal(1,0.15);
}
```