# How to handle missing data in PPCA

I am implementing a paper "Probabilistic Principal Component Analysis" (PPCA) which deals with a dataset where each vector suffers from at least one missing value missing values. Generally, PPCA offers a natural approach to the estimation of the principal axes in cases where some, or indeed all, of the data vectors exhibit one or more missing values (at random).

The actual question is in Matlab the missing values are marked as NaN. So how do we handle these NaN values. In PPCA we need to calculate the covariance matrix of the data, but since it contains missing values as NaN it's not straight forward. Note: However, we do not replace missing data by the sample mean in PPCA.

Can someone provide some insight into this issue of handling missing data. The data set is a $$N\times D$$ matrix where $$N$$ is the number of observations and $$D$$ is the dimension.