# Dealing With Missing Data

**URL:** https://discourse.pymc.io/t/dealing-with-missing-data/252
**Category:** Questions
**Created:** [August 16, 2017, 2:07pm UTC](https://discourse.pymc.io/t/dealing-with-missing-data/252 "2017-08-16T14:07:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alphamaximus](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/alphamaximus/32/26_2.png) [@alphamaximus](https://discourse.pymc.io/u/alphamaximus)
#### Post date: [August 16, 2017, 2:07pm UTC](https://discourse.pymc.io/t/dealing-with-missing-data/252/1 "2017-08-16T14:07:03Z")

</div>

I’m working on a dataset that has a lot of missing data. Rather than dropping those rows with missing data, I’d like to estimate the missing data using a Bayesian approach.

I found two examples on how to do this:

1. @fonnesbeck’s Intro Stat Modeling 2017 - [Dealing with Missing Data](https://github.com/fonnesbeck/intro_stat_modeling_2017/blob/master/notebooks/4.%20Dealing%20with%20Missing%20Data.ipynb)
2. Ruslan Salakhutdinov and Andriy Mnih’s [Probabilistic Matrix Factorization for Making Personalized Recommendations](https://pymc-devs.github.io/pymc3/notebooks/pmf-pymc.html)

In the first approach, a predictive regression model is used for each column. In the second approach, a single factor model is used for everything.

It seems that the second approach is more efficient and straightforward, but perhaps the second approach is also more computationally intensive.

I was wondering what other people thought about the pros and cons of each approach and when would one would use one vs the other.

Thanks!

---

<div class="post-metadata">

### Author: ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)
#### Post date: [August 18, 2017, 9:20am UTC](https://discourse.pymc.io/t/dealing-with-missing-data/252/2 "2017-08-18T09:20:35Z")

</div>

related discussion:

> [@Large Scale Factor Analysis with minibatch ADVI](https://discourse.pymc.io/t/large-scale-factor-analysis-with-minibatch-advi/246):
>
> Hi, I’m new to PyMC3 and am using it in my master dissertation. I have a dataset of roughly 1.3 million datapoints, each of 20 dimensions, and 40% of the data matrix are missing. My goal is to reduce its dimensionality for further analysis. The way I deal with missing values is simple - assign a 20 dimensional Bernoulli mask, that either returns the “true” value (when entry is observed) or a placeholder (when the entry is missing). To make it run on ADVI, I have integrated away the Bernoulli la…
