# 3 Multi Switchpoints Approach with PyMC3

**URL:** <https://discourse.pymc.io/t/3-multi-switchpoints-approach-with-pymc3/5875>\
**Category:** Questions\
**Created:** [September 30, 2020, 12:35pm UTC](https://discourse.pymc.io/t/3-multi-switchpoints-approach-with-pymc3/5875 "2020-09-30T12:35:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Adejola](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/victor_adejola/32/3073_2.png) [@Victor\_Adejola](https://discourse.pymc.io/u/Victor_Adejola)\
**Post date:** [September 30, 2020, 12:35pm UTC](https://discourse.pymc.io/t/3-multi-switchpoints-approach-with-pymc3/5875/1 "2020-09-30T12:35:20Z")

</div>

Hi there,

I am new to Bayesian programming and trying to develop a multiple switchpoint with PyMC3 using the datasets provided in one of the examples in the book ([Probabilistic-Programming-and-Bayesian-Methods-for-Hackers](https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers)). The SMS messaging example in the book provided a single switchpoint.

I was able to implement two switchpoints in PYMC3 for tau\_1 and tau\_2, but I am not sure whether the switchpoints are correct.

My code is shared in the link [Here](https://colab.research.google.com/drive/1mG3mAKRcO-lGGo_JFWMCofEG4jaVI0Fy?usp=sharing)

(1) Is there an easy way to plot the multiple switchpoints and test whether they are correct?  
(2) How can I improve this model to achieve any number of switchpoints?

---

<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:** [October 1, 2020, 7:32am UTC](https://discourse.pymc.io/t/3-multi-switchpoints-approach-with-pymc3/5875/2 "2020-10-01T07:32:36Z")

</div>

You might find this post helpful: [Switch point Metropolis tuning](https://discourse.pymc.io/t/switch-point-metropolis-tuning/1082)
