# regression with Dirichlet process mixtures

**URL:** https://discourse.pymc.io/t/regression-with-dirichlet-process-mixtures/3423
**Category:** Questions
**Created:** [June 14, 2019, 3:46am UTC](https://discourse.pymc.io/t/regression-with-dirichlet-process-mixtures/3423 "2019-06-14T03:46:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Fangwq](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@Fangwq](https://discourse.pymc.io/u/Fangwq)
#### Post date: [June 14, 2019, 3:46am UTC](https://discourse.pymc.io/t/regression-with-dirichlet-process-mixtures/3423/1 "2019-06-14T03:46:33Z")

</div>

I want to do regression with Dirichlet process mixtures model. And I refer to the example provided by this package. However, I do not figure it out. And I also tried Dirichlet process density regression. But it can’t be used for data prediction.(I think this demo is wrong: [demo for density regression](https://docs.pymc.io/notebooks/dependent_density_regression.html)).

The prediction error that the output dimension doesn’t match:  
‘’’  
ax.plot(lidar\_pp\_x, pp\_trace[‘obs’].mean(axis=0),  
c=‘k’, zorder=6,  
label=‘Posterior expected value’);  
‘’’  
Does anyone know how to do regression with Dirichlet process mixtures? thank you very much!  
I use pymc3-3.6 and theano-1.04.
