Thank for the quick response!
Honestly, it’s a bit hard to explain - “why?” Above question was quite simplified. I’ll try to explain in more details.
I’m still struggling with a problem which I described here Dealing with imputation of left censored multivariate normal distribution.
So I’m trying to replicate well known “Imputation-Prediction” algorithm for missing values reconstruction for multivariate normal with unknown covariance and unknown mean (the last condition could be relaxed and we can assume zero means). Based on the literature, usually, people solve this problem with Gibbs sampler. And the idea is to implement the algorithm using PyMC.
Assuming that we have a very simple pattern of “missingness” - only one covariate is partly observed (my real problem has many patterns with a different combination of “missingness”).
So, I see a formulation of a problem in such way:
- Define RV for covariance matrix Sigma
- Define RV for mean vector Mu
- Calculate conditional means and covariances for each missing values based on the observed part using the property of MVNormal
- Draw random samples from that conditional distributions. That’s why I asked about random() inside a model.
- Substitute samples to the original dataset. (I’m not sure at all if it’s possible to do inside model)
- Define Likelihood with Mu, Sigma and updated observed…and define Potential to take into account censoring factor.
I’m not sure if it’s possible to implement these steps using only out-of-box PyMC features. And moreover, I’m not sure about these steps at all.
I would really appreciate any suggestions!
Thanks a lot,
Alex