# How would you use the MAP Parameter Distributions from linear regression to create new datapoints?

**URL:** <https://discourse.pymc.io/t/how-would-you-use-the-map-parameter-distributions-from-linear-regression-to-create-new-datapoints/7117>\
**Category:** Questions\
**Created:** [March 30, 2021, 2:27pm UTC](https://discourse.pymc.io/t/how-would-you-use-the-map-parameter-distributions-from-linear-regression-to-create-new-datapoints/7117 "2021-03-30T14:27:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/oliver/32/3849_2.png) [@Oliver](https://discourse.pymc.io/u/Oliver)\
**Post date:** [March 30, 2021, 2:27pm UTC](https://discourse.pymc.io/t/how-would-you-use-the-map-parameter-distributions-from-linear-regression-to-create-new-datapoints/7117/1 "2021-03-30T14:27:53Z")

</div>

Hi,

I was wondering how I could use the parameters of the distribution I found with linear regression to create new datapoints within an interval?

Would I just sample over the scipy’s normal distributions with the mu and standard deviation I came up with in MAP or is there a pymc3 built in I could use for that?

Thanks!

---

<div class="post-metadata">

**Author:** ![OriolAbril](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/oriolabril/32/2497_2.png) [@OriolAbril](https://discourse.pymc.io/u/OriolAbril)\
**Post date:** [March 30, 2021, 2:51pm UTC](https://discourse.pymc.io/t/how-would-you-use-the-map-parameter-distributions-from-linear-regression-to-create-new-datapoints/7117/2 "2021-03-30T14:51:37Z")

</div>

You could technically use the MAP to draw samples from scipy distributions, but I think what you want is to sample from the posterior predictive distribution. Take a look at this talk:

> [@Posterior Predictive Sampling in PyMC3 by Luciano Paz](https://discourse.pymc.io/t/posterior-predictive-sampling-in-pymc3-by-luciano-paz/6028):
>
> Talk Abstract PyMC3 is great for inferring parameter values in a model given some observations, but sometimes we also want to generate random samples from the model as predictions given what we already inferred from the observed data. This kind of sampling is called posterior predictive sampling, and it can be very hard. The typical problems that show up are related to shape mismatches in hierarchical models, latent categorical values that aren’t correctly re-sampled or changing the shape of th…

and/or this notebook: [https://docs.pymc.io/pymc-examples/examples/diagnostics\_and\_criticism/posterior\_predictive.html](https://docs.pymc.io/pymc-examples/examples/diagnostics_and_criticism/posterior_predictive.html)

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/oliver/32/3849_2.png) [@Oliver](https://discourse.pymc.io/u/Oliver)\
**Post date:** [March 30, 2021, 3:10pm UTC](https://discourse.pymc.io/t/how-would-you-use-the-map-parameter-distributions-from-linear-regression-to-create-new-datapoints/7117/3 "2021-03-30T15:10:47Z")

</div>

Thank you very much Oriol, I’ll try this out!!
