Inference with SEIR model and NPE #1375
|
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 In my experiments, case data cover 23 weeks. Also, I assume that In an even simpler scenario, I further assume that 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 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 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. |
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, |
|
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. |
|
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! |
|
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, |
|
Hello, I think I managed to solve my problem! The key step was transforming simulated data via Cheers, |

Hello,
I think I managed to solve my problem! The key step was transforming simulated data via
x1 = torch.log( 1 + x ). The raw simulationsxwere too skewed and z-scoring did not solve the issue.Cheers,
Francesco