Are there any illustrative notebooks around on how to do proper model fitting of dynamic models with parameter statistics in Turing tools? Can it be done?

To be more concrete… take the SIR epidemiology model below with boarding school data for measles in North England in 1978 – data and model parameters are taken from Maia Martcheva’s Springer book *An Introduction to Mathematical Epidemiology* from 2015.

```
# Packages used
using Plots; pyplot()
using LaTeXStrings
using DifferentialEquations
#
N = 763 # Number of pupils in boarding school
tm = 3:14 # days of infection data
# Infection data
Id = [25, 75, 227, 296, 258, 236, 192, 126, 71, 28, 11, 7]
```

SIR model function – S, I, R, N are *number of persons* (i.e., not per capita) – “my” parameters are \tau_\mathrm{i} for infection time (equal to \tau_\mathrm{i} = 1/(N\cdot \beta) in Martcheva’s book) and \tau_\mathrm{r} for recovery time (equal to \tau_\mathrm{r} = 1/\alpha in Martcheva’s book, or 1/\mu in some other books). See p. 126-129 in Martcheva’s book for data and parameters. The function is:

```
# Function for SIR model
function sir!(dx,x,p,t)
S,I,R = x
tau_i,tau_r,N = p
#
dS = -I*S/tau_i/N
dI = I*S/tau_i/N - I/tau_r
dR = I/tau_r
dx .= [dS,dI,dR]
end
;
```

Problem set-up:

```
I3 = Float64(Id[1])
S3 = N-I3
R3 = 0.
x3 = [S3,I3,R3]
#
tau_i = 0.553
tau_r = 2.15
RR0 = round(tau_r/tau_i,digits=1) # The "R0" parameter
p = [tau_i, tau_r,N]
#
tspan=(3.,14.)
#
prob = ODEProblem(sir!,x3,tspan,p)
sol = solve(prob)
;
```

Parameters for model are suggested after some model fitting in Martcheva’s book. The results are as follows:

*Question*: Suppose I want to *redo* the model-fit, and also find some description of model uncertainty for the model parameters… Can this be done using Turing? Any notebook examples?

In this particular case, the initial states are probably well known. But in general, one would also want to estimate those.

Any suggestions and help are appreciated.