Inference with SEIR model and NPE #1375
Replies: 5 comments
-
thanks for sharing your application and filing the issue. What is the dimensionality of the data here? It's the diff of If you are not familiar with embedding networks, please have a look at our tutorial: https://sbi-dev.github.io/sbi/dev/tutorials/04_embedding_networks/ Does this help? Cheers, |
Beta Was this translation helpful? Give feedback.
-
Thanks for your rapid answer! Yes, my data is a noisy time series obtained by applying Poisson noise to the output of the ODE model (which is deterministic). I will try your suggestions and add the results here. |
Beta Was this translation helpful? Give feedback.
-
Hello, I obtained major improvements on a simpler instance (SIR model instead of SEIR) using mixed density networks. These are the steps that I believed helped me:
My code:
The approximate posteriors are much closer to the true ones over a large range of R0 values (I'm still struggling close to Thanks for the guidance! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update, that's great! In general, I would suggest the following checks:
We have tutorials for all these steps on the website / in GitHub under I hope this helps! Feel free to report your results here. I am moving this issue to GH discussion as it is more about a specific use case than about an issue with the toolbox. Cheers, |
Beta Was this translation helpful? Give feedback.
-
Hello, I think I managed to solve my problem! The key step was transforming simulated data via Cheers, |
Beta Was this translation helpful? Give feedback.
-
Description
I'm testing the ability of neural SBI methods to fit epidemic data in a simple setting where an epidemic is growing exponentially starting from a single infected case. I am using a SEIR model with transmission rate$\beta$ , recovery rate $\mu$ and rate of infectiousness onset $\sigma$ . "True" incidence in week $t$ is calculated from simulations as: $J_t = \sigma \int_{7t}^{7t+7}E(u)du$ . Observed cases in the same week are assumed to be Poisson-distributed with mean $\rho \cdot J_t$ , where $\rho$ is an under-reporting factor. The last parameter, $T_0$ , denotes the time elapsed between the introduction of the first case into the population and the beginning of the observation window; this means I do not observe any data between times $-T_0$ and $0$ .
In my experiments, case data cover 23 weeks. Also, I assume that$\mu$ , $\sigma$ , $\rho$ and population size $N$ are known, which leaves only two parameters to be inferred, $\beta$ and $T_0$ . The transmission rate is actually calculated as $\beta = R_0 \mu$ , where $R_0$ is my parameter of interest (instead of $\beta$ ). I chose uniform priors for both $R_0$ and $T_0$ . More precisely, $R_0 \sim \text{Uniform}(1,5)$ and $T_0 \sim \text{Uniform}(0,50)$ .
In an even simpler scenario, I further assume that$T_0$ is known so that $R_0$ is the only unknown parameter.
I've been playing around with sbi for a few weeks now but unfortunately I can't seem to get good posteriors in this example. More precisely, posteriors obtained with, say, NPE, are typically wider than the exact posteriors (which I obtained via standard MCMC methods and have the correct coverage). The results are actually satisfactory for relatively large$R_0$ values, e.g. 3, but they degrade considerably at lower values.
I believe that this is quite a simple problem that could be tackled by NPE, hence I wonder if I'm missing any fundamental concept. Any advice would be really welcome. Thanks for making this impressive toolkit available!
Code
When setting$R_0=1.6$ I get plots like the following:
The true posterior, not shown here, is much tighter around the ground-truth value. I also tried using NSF instead of MAF but results do not improve, unfortunately.
Beta Was this translation helpful? Give feedback.
All reactions