Likelihood function for switchpoint analysis--in this case example from PyMC3 I was watching a video on PyMC3 for fitting Bayesian models, and an example they gave was of "switchpoint" analysis for coal mining disasters. A picture of the data is below, and the goal is to identify the year in which the distribution changes from a high number of disasters to low number of disasters regime.

My question is, what is the likelihood function for a switchpoint model? That was not mentioned in the talk or documentation. I understand the priors, but the likelihood almost seems like a mixture of poissons or something. I was just wondering what the precise mathematical specification of the likelihood function was--or at least the probability distribution used to setup the likelihood.
Now, the model is specified as:
$$
\begin{aligned}
D_{t} & \sim \operatorname{Pois}\left(r_{t}\right), r_{t}=\left\{\begin{array}{ll}
e, & \text { if } t \leq s \\
l, & \text { if } t>s
\end{array}\right.\\
s & \sim \operatorname{Unif}\left(t_{l}, t_{h}\right) \\
e & \sim \exp (1) \\
l & \sim \exp (1)
\end{aligned}
$$
And the PyMC3 code is
with pm.Model() as disaster_model:

switchpoint = pm.DiscreteUniform('switchpoint', lower=years.min(), upper=years.max(), testval=1900)

# Priors for pre- and post-switch rates number of disasters
early_rate = pm.Exponential('early_rate', 1)
late_rate = pm.Exponential('late_rate', 1)

# Allocate appropriate Poisson rates to years before and after current
rate = pm.math.switch(switchpoint >= years, early_rate, late_rate)

disasters = pm.Poisson('disasters', rate, observed=disaster_data)

Thanks for taking the time to look at my question.
Note, a similar question was asked before about this type of switchpoint analysis, but that question did not ask for the mathematical form of the likelihood function.
Switchpoint detection with probabilistic programming (pymc)
 A: Since
disasters = pm.Poisson('disasters', rate, observed=disaster_data)

for this model the likelihood is the Poisson:
$P(n_i|\lambda) = \frac{\lambda^{n_i} e^{-\lambda}}{n_i!}$
where $n_i$ represents the observed number of disasters of the year $i$ and each year is considered independent of the other i.e. the log-likelihood is just the sum over all the years of the log-likelihoods, while $\lambda$ represents the average rate of disasters per year.
In general, in a switch-point model, you may choose whatever likelihood you consider more appropriate, and in this case the Poisson seems quite logical, as the events we are counting are independent (it seems reasonable to assume that each disaster is independent on the previous ones).
As you pointed out, in this switch-point model, the average rates is
$$\lambda = 
\begin{cases}
\lambda_e \text{ if } t < \tau_s \\ 
\lambda_l \text{ if } t >= \tau_s \\
\end{cases} $$
or, if you prefer,
$$\lambda = \lambda_l \theta(t-\tau_s) +  \lambda_e \theta(\tau_s-t) $$
I would not include $\lambda$ as a part of the likelihood, as it does not involve the data at all, but I'd rather consider it an intermediate random variable, since it's a function of the remaining priors only:
$$
\lambda_e, \lambda_e \sim \exp(1)
\\
\tau_s \sim \mathcal{U}(t_l, t_h)
$$
