# Regularizing the posterior of a parameter with the KL divergence from a different posterior

**URL:** <https://discourse.pymc.io/t/regularizing-the-posterior-of-a-parameter-with-the-kl-divergence-from-a-different-posterior/16746>\
**Category:** v5\
**Created:** [March 23, 2025, 1:08am UTC](https://discourse.pymc.io/t/regularizing-the-posterior-of-a-parameter-with-the-kl-divergence-from-a-different-posterior/16746 "2025-03-23T01:08:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![iavicenna](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/iavicenna/32/7923_2.png) [@iavicenna](https://discourse.pymc.io/u/iavicenna)\
**Post date:** [March 23, 2025, 2:03pm UTC](https://discourse.pymc.io/t/regularizing-the-posterior-of-a-parameter-with-the-kl-divergence-from-a-different-posterior/16746/2 "2025-03-23T14:03:16Z")

</div>

Maybe one method could be to actually use pm.sample on the first step and then use the posterior samples obtained from the sampling as the prior in the next fit or sample or whatever you want to do? As far as I know, using multidimensional posteriors as priors is not completely straightforward but there is a nice discussion here:

> [@How to use the posterior distribution of one model as a prior distribution for another model](https://discourse.pymc.io/t/how-to-use-the-posterior-distribution-of-one-model-as-a-prior-distribution-for-another-model/13956):
>
> Hi all, If I want to use the posterior distribution of one model as a prior distribution for another model, how should I implement this in PyMC5? I would be thankful if you could help me with this question.

---

_[View the full topic](https://discourse.pymc.io/t/regularizing-the-posterior-of-a-parameter-with-the-kl-divergence-from-a-different-posterior/16746)._
