Partially missing vector

King regards.

I have dataset in which every observations is a vector, but some of them have partially missing values, example:

Y_1 =\begin{bmatrix} 1 & 2 & \text{NA} & 4 \end{bmatrix}^{\top}

How i can model it with stan?.

Right now my model looks like this:

data {
int N; // number of observations.
vector[K] y[N];

model {

 for (t in 1:N) {
  // mu and sigma are the regression mean and variance respectively, they  were defined before.
  y_vector[t] ~ multi_normal(mu[t], sigma)


Have a look at the Missing Data chapter in the Stan User’s Guide: 3 Missing Data and Partially Known Parameters | Stan User’s Guide

I saw the chapter in the the user’s guide but it assumes the observation is completely missing.

The first section of the chapter (3.1 Missing data) assumes partial missingness, but that the outcomes are independent of each other.

For multivariate outcomes with partial missingness, see the last section (3.5 Missing multivariate data)