Speeding up and reducing divergences for multivariate hiearchical stochastic factor model

After some experimenting, I have a few things to report.
1.

It seems that having different variants of the same mathematical statements yields different results i.e.

for (t in 1:TS){
    log_f_sd[t] = log_f_sd_loc + chol_log_f_sd_sd * z_log_f_sd[t];
    if (t > 1){
        log_f_sd[t] += log_f_sd_scale .* (log_f_sd[t-1] - log_f_sd_loc);
    }
  }

performs differently than

  log_f_sd[1] = log_f_sd_loc + chol_log_f_sd_sd * z_log_f_sd[1];
  for (t in 2:TS){
    log_f_sd[t] = log_f_sd_loc + (log_f_sd_scale .* (log_f_sd[t-1] - log_f_sd_loc)) + (chol_log_f_sd_sd * z_log_f_sd[t]);
    }
  1. If I reparameterise log_f_sd = abs(raw_log_f_sd) where raw_log_f_sd is an unconstrained vector, the mean of log_f_sd != abs(raw_log_f_sd).

  2. Choice of priors values make a big difference when using normals, truncated normals and lognormals but not with gammas.

Setting values to be the same in every dimension for log_f_sd_loc, log_f_sd_scale and a diagonal covariance innovation matrix does not lead to identifiability.

I’m worried I’m overlooking something big. The model I’m trying to replicate is Factor Stochastic Volatility with Time Varying Loadings and Markov Switching Regimes.pdf (408.4 KB) which is based on Aguilar and West.pdf (1004.3 KB). Currently, I can’t get the latter to work even if I removed time-varying innovations. Employing time-varying innovations just leads to poorly estimated scales for both log_f_sd and the innovations but well-estimated for everything else.

1 Like