Hi all, I want to fit a VAR(1) model with missing values. The Stan document suggests that I can use a structure like below for AR(1):
data {
int<lower = 0> N_obs;
int<lower = 0> N_mis;
int<lower = 1, upper = N_obs + N_mis> ii_obs[N_obs];
int<lower = 1, upper = N_obs + N_mis> ii_mis[N_mis];
real y_obs[N_obs];
}
transformed data {
int<lower = 0> N = N_obs + N_mis;
}
parameters {
real y_mis[N_mis];
real<lower=0> sigma;
}
transformed parameters {
real y[N];
y[ii_obs] = y_obs;
y[ii_mis] = y_mis;
}
model {
sigma ~ gamma(1, 1);
y[1] ~ normal(0, 100);
y[2:N] ~ normal(y[1:(N - 1)], sigma);
}
however I also know that the value of the missing parts could not be above a certain level (say 100) and thus I want to have a truncating prior. I simply changed the parameter block to real<lower = 0, upper = 100> y_mis[N_mis];
but when I generate posterior predictive values using the generated quantities block I am getting values above that threshold for the missing parts. Does anyone know what’s the proper way of informing the missing values (truncating in my case)?