# Bayesian change detection (sampling the posterior of a Poisson distribution)

I'm trying to work out how the posterior of a Poisson distribution is derived to enable me to detect changepoints. I'm trying to follow the example here.

$$Y_i$$ (events per year) is modelled using two Poisson distributions (one before, one after the changepoint), with lambda given for these distributions by gamma distributions. For one changepoint the posterior of $$T$$ (year of changepoint) is given as:

$$\propto{((T\ -\ 1)\ +\ 1)}^{-2-\sum_{i\ =\ 1}^{T\ -\ 1}y_i}\ \Gamma(2\ +\ \sum_{i\ =\ 1}^{T\ -\ 1}y_i)\ \\ +\ {((112\ -\ (T\ -\ 1))\ +\ 1)}^{-2-\sum_{i\ =\ T}^{112}y_i}\ \Gamma(2\ +\ \sum_{i\ =\ T}^{112}y_i)$$

How is this formula derived?

• Welcome to CV! This site supports LaTeX. Please edit the question to include a LaTeX form of the equation, as the snapshot is completely unreadable and makes it difficult for answerers to help. Nov 25, 2023 at 23:45
• updated to include formulae Nov 26, 2023 at 9:45