if(sv){
for (mm in seq_len(M)){
svdraw_mm <- svsample_general_cpp(shock_norm[,mm]/sigma.mat[mm], startpara = sv_draw[[mm]], startlatent = sv_latent[[mm]], priorspec = sv_priors[[mm]])
sv_draw[[mm]][c("mu", "phi", "sigma")] <- as.list(svdraw_mm$para[, c("mu", "phi", "sigma")])
sv_latent[[mm]] <- svdraw_mm$latent
normalizer <- as.numeric(exp(-.5*svdraw_mm$latent))
weights.new <- as.numeric(exp(-svdraw_mm$latent))
dat <- dbartsData(formula = Y[,mm]~X,weights=weights.new)
sampler.list[[mm]]$setData(dat)
H[,mm] <- log(sigma.mat[mm]^2) + svdraw_mm$latent
}
}else{
for (mm in seq_len(M)) {
H[,mm] <- log(sigma.mat^2)
}
}
According to the example.R provided i found that the log(sigma.mat) is not corresponding to the loop given. I have tried applying this algorithm with Schorfheide and Song 2015 data and found an error for smoothed-latent variable i.e. beta2 in the "mfbavart" function.
Sorry i thought i had the most updated one. It seems to me that you fixed it already..