# \#epidemiology

**URL:** https://discourse.mc-stan.org/tag/epidemiology/101.md

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

---

## [Excess Death Study, Preprint + Source Code](https://discourse.mc-stan.org/t/excess-death-study-preprint-source-code/41374)

<div class="topic-metadata">

**Author:** [@hjhornbeck](https://discourse.mc-stan.org/u/hjhornbeck)\
**Replies:** 4\
**Last updated:** [June 18, 2026, 1:25am UTC](https://discourse.mc-stan.org/t/excess-death-study-preprint-source-code/41374 "2026-06-18T01:25:22Z")

</div>

I’ve finally submitted my first paper that uses Stan, an attempt to model excess mortality in Canada over the span of fourteen years. It’s just been submitted, so who knows if/when it’ll get published, but in the meantim…

---

## [Cumulative probability within interval \[t, t+1\]](https://discourse.mc-stan.org/t/cumulative-probability-within-interval-t-t-1/36060)

<div class="topic-metadata">

**Author:** [@Tom\_C](https://discourse.mc-stan.org/u/Tom_C)\
**Replies:** 1\
**Last updated:** [July 30, 2024, 6:18pm UTC](https://discourse.mc-stan.org/t/cumulative-probability-within-interval-t-t-1/36060 "2024-07-30T18:18:16Z")

</div>

For a time-to-event (survival) analysis, I aim to calculate the probability of an event occurring within an interval, e.g. between time t and (t+1), where the time-to-event probability is drawn from a continuous distribu…

---

## [Using Pathfinder (and other algorithms) to infer epidemiological delay distributions and to initialise Rt estimates](https://discourse.mc-stan.org/t/using-pathfinder-and-other-algorithms-to-infer-epidemiological-delay-distributions-and-to-initialise-rt-estimates/35929)

<div class="topic-metadata">

**Author:** [@athowes](https://discourse.mc-stan.org/u/athowes)\
**Replies:** 3\
**Last updated:** [July 22, 2024, 11:05am UTC](https://discourse.mc-stan.org/t/using-pathfinder-and-other-algorithms-to-infer-epidemiological-delay-distributions-and-to-initialise-rt-estimates/35929 "2024-07-22T11:05:19Z")

</div>

Hi Stan forum, I wanted to share a vignette about using the Laplace, ADVI, Pathfinder, and NUTS inference methods to fit epidemiological delay distributions. The vignette is for the epidist package, which uses brms as a…

---

## [SIR models in brms](https://discourse.mc-stan.org/t/sir-models-in-brms/13952)

<div class="topic-metadata">

**Author:** [@Angelo\_D\_Ambrosio](https://discourse.mc-stan.org/u/Angelo_D_Ambrosio)\
**Replies:** 12\
**Last updated:** [October 20, 2023, 11:35pm UTC](https://discourse.mc-stan.org/t/sir-models-in-brms/13952 "2023-10-20T23:35:54Z")

</div>

Hello, I was wondering if it is possible to build SIR compartmental models like this one https://rstudio-pubs-static.s3.amazonaws.com/270496\_e28d8aaa285042f2be0c24fc915a68b2.html with brms, in order to use brms infrastr…

---

## [Online talk Aug 8, 2023 - Covid 19 and Non-random Missing Data](https://discourse.mc-stan.org/t/online-talk-aug-8-2023-covid-19-and-non-random-missing-data/32145)

<div class="topic-metadata">

**Author:** [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Replies:** 3\
**Last updated:** [August 9, 2023, 2:08pm UTC](https://discourse.mc-stan.org/t/online-talk-aug-8-2023-covid-19-and-non-random-missing-data/32145 "2023-08-09T14:08:50Z")

</div>

hi everyone, I’m going to be giving an online talk: Lessons from COVID-19: Non-random Missing Data and Its Consequences DESCRIPTION: A fundamental challenge for survey and observational datasets is that not all recor…

---

## [Issues fitting markov models for epidemics](https://discourse.mc-stan.org/t/issues-fitting-markov-models-for-epidemics/29474)

<div class="topic-metadata">

**Author:** [@JasonPekos](https://discourse.mc-stan.org/u/JasonPekos)\
**Replies:** 3\
**Last updated:** [November 18, 2022, 4:29pm UTC](https://discourse.mc-stan.org/t/issues-fitting-markov-models-for-epidemics/29474 "2022-11-18T16:29:23Z")

</div>

Problem Hi! I’m new-ish to Stan, and looking for a bit of advice re: some epidemic compartment models I’m working on. There was a recent publication on this topic, but it mainly focused on ODEs. I’m primarily interested …

---

## [Bayesian hierarchical model - how to spot convergence issues early](https://discourse.mc-stan.org/t/bayesian-hierarchical-model-how-to-spot-convergence-issues-early/29178)

<div class="topic-metadata">

**Author:** [@bernadette-eu](https://discourse.mc-stan.org/u/bernadette-eu)\
**Replies:** 1\
**Last updated:** [October 19, 2022, 6:10am UTC](https://discourse.mc-stan.org/t/bayesian-hierarchical-model-how-to-spot-convergence-issues-early/29178 "2022-10-19T06:10:23Z")

</div>

Data are available on new daily age-specific COVID-19 mortality counts for a given country. The hierarchical model at hand models the age-specific latent transmission dynamics with an age-structured SEIR compartmental mo…

---

## [Evaluation of my single arm treatemt](https://discourse.mc-stan.org/t/evaluation-of-my-single-arm-treatemt/28217)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 1\
**Last updated:** [July 18, 2022, 6:37pm UTC](https://discourse.mc-stan.org/t/evaluation-of-my-single-arm-treatemt/28217 "2022-07-18T18:37:55Z")

</div>

Hello all, I am going to Evaluation of combined surgical and antibiotic treatment for Diabetic foot ulcers, 30 patients with Diabetic foot ulcers were enrolled in this study, and the date of first and last visit was rec…

---

## [Fitting seir in r using stan](https://discourse.mc-stan.org/t/fitting-seir-in-r-using-stan/26089)

<div class="topic-metadata">

**Author:** [@Nhlanhla\_Nthoiwa](https://discourse.mc-stan.org/u/Nhlanhla_Nthoiwa)\
**Replies:** 5\
**Last updated:** [February 18, 2022, 12:13pm UTC](https://discourse.mc-stan.org/t/fitting-seir-in-r-using-stan/26089 "2022-02-18T12:13:12Z")

</div>

Hi, I am having trouble fitting the SEIR model via Stan. I get the following error: ror in mod$fit\_ptr() : Exception: variable does not exist; processing stage=data initialization; variable name=y0; base type=double (in …

---

## [Resources for modeling patient factors and covid clade/phylogenetic information?](https://discourse.mc-stan.org/t/resources-for-modeling-patient-factors-and-covid-clade-phylogenetic-information/23700)

<div class="topic-metadata">

**Author:** [@jd\_c](https://discourse.mc-stan.org/u/jd_c)\
**Replies:** 2\
**Last updated:** [August 2, 2021, 12:59pm UTC](https://discourse.mc-stan.org/t/resources-for-modeling-patient-factors-and-covid-clade-phylogenetic-information/23700 "2021-08-02T12:59:17Z")

</div>

Howdy, I may have work coming down the pipe that involves covid patient outcomes, patient information, and genetic information about the particular covid variant that they have. I have not worked with phylogenetic model…

---

## [Informative prior for highly correlated varying slopes](https://discourse.mc-stan.org/t/informative-prior-for-highly-correlated-varying-slopes/23366)

<div class="topic-metadata">

**Author:** [@nbanho](https://discourse.mc-stan.org/u/nbanho)\
**Replies:** 4\
**Last updated:** [July 22, 2021, 12:34pm UTC](https://discourse.mc-stan.org/t/informative-prior-for-highly-correlated-varying-slopes/23366 "2021-07-22T12:34:50Z")

</div>

Hi there, a bit of background: I am trying to model the effects of seven government interventions on the number of new COVID infections across multiple countries in a semi-mechanistic model. So far, I was able to get a …

---

## [Using Stan to estimate the frequency of severe and critical SARS-CoV-2 infection across age (and question about logit link alternatives)](https://discourse.mc-stan.org/t/using-stan-to-estimate-the-frequency-of-severe-and-critical-sars-cov-2-infection-across-age-and-question-about-logit-link-alternatives/23359)

<div class="topic-metadata">

**Author:** [@dherrera1911](https://discourse.mc-stan.org/u/dherrera1911)\
**Replies:** 4\
**Last updated:** [July 8, 2021, 11:50pm UTC](https://discourse.mc-stan.org/t/using-stan-to-estimate-the-frequency-of-severe-and-critical-sars-cov-2-infection-across-age-and-question-about-logit-link-alternatives/23359 "2021-07-08T23:50:36Z")

</div>

Hi, I am finishing a line of work that has taken a big chunk of my life last year, and will be preprinting it in the next few weeks. The work is estimating the proportion of SARS-CoV-2 infections that produce severe and…

---

## [CAR models and spatial measurement error models](https://discourse.mc-stan.org/t/car-models-and-spatial-measurement-error-models/23234)

<div class="topic-metadata">

**Author:** [@cmcd](https://discourse.mc-stan.org/u/cmcd)\
**Replies:** 0\
**Last updated:** [June 28, 2021, 11:26pm UTC](https://discourse.mc-stan.org/t/car-models-and-spatial-measurement-error-models/23234 "2021-06-28T23:26:30Z")

</div>

Hi all, This paper may be of interest to Stan users who are working with spatial data. It uses Stan to model observational error in small area survey data, such as American Community Survey estimates. The paper encourag…

---

## [Using Stan to Measure COVID-19 Restrictions](https://discourse.mc-stan.org/t/using-stan-to-measure-covid-19-restrictions/22302)

<div class="topic-metadata">

**Author:** [@saudiwin](https://discourse.mc-stan.org/u/saudiwin)\
**Replies:** 0\
**Last updated:** [May 4, 2021, 6:03pm UTC](https://discourse.mc-stan.org/t/using-stan-to-measure-covid-19-restrictions/22302 "2021-05-04T18:03:15Z")

</div>

Hi all - I just finished a big modeling project using a measurement model on two of the biggest COVID-19 restriction datasets out there. You can get a working draft here of the results: https://osf.io/preprints/socarxi…

---

## [Improving identifiability of two latent rates](https://discourse.mc-stan.org/t/improving-identifiability-of-two-latent-rates/19738)

<div class="topic-metadata">

**Author:** [@dholcomb](https://discourse.mc-stan.org/u/dholcomb)\
**Replies:** 2\
**Last updated:** [December 16, 2020, 9:00pm UTC](https://discourse.mc-stan.org/t/improving-identifiability-of-two-latent-rates/19738 "2020-12-16T21:00:48Z")

</div>

I am trying to implement the method of Campbell et al. 2020 to estimate Covid-19 infection rates (IR) and infection fatality rates (IFR) from observed positive tests and Covid-attributable deaths, accounting for preferen…

---

## [Code review of slow hierarchical (ode) model](https://discourse.mc-stan.org/t/code-review-of-slow-hierarchical-ode-model/19268)

<div class="topic-metadata">

**Author:** [@GustafRydevik](https://discourse.mc-stan.org/u/GustafRydevik)\
**Replies:** 3\
**Last updated:** [November 19, 2020, 7:48pm UTC](https://discourse.mc-stan.org/t/code-review-of-slow-hierarchical-ode-model/19268 "2020-11-19T19:48:41Z")

</div>

Hi all, I’m having trouble getting a reasonable speed for an ode model I’m working on, and it’s throwing a lot of divergent-transition warnings. I have a version that runs at a reasonably ok speed (~10m for 500 sample…

---

## [SEIR model fitting](https://discourse.mc-stan.org/t/seir-model-fitting/14789)

<div class="topic-metadata">

**Author:** [@Ilia](https://discourse.mc-stan.org/u/Ilia)\
**Replies:** 10\
**Last updated:** [November 5, 2020, 2:41pm UTC](https://discourse.mc-stan.org/t/seir-model-fitting/14789 "2020-11-05T14:41:11Z")

</div>

Hi, I am new to stan, I am trying to replicate this, yet for an SEIR model with two infected compartments, one for asymptomatic and one for symptomatic. I have including my file here, the issue is when I run it I get th…

---

## [Inferring daily Covid-19 infections from both emergency service calls and deaths](https://discourse.mc-stan.org/t/inferring-daily-covid-19-infections-from-both-emergency-service-calls-and-deaths/18201)

<div class="topic-metadata">

**Author:** [@remoore](https://discourse.mc-stan.org/u/remoore)\
**Replies:** 13\
**Last updated:** [October 7, 2020, 1:43pm UTC](https://discourse.mc-stan.org/t/inferring-daily-covid-19-infections-from-both-emergency-service-calls-and-deaths/18201 "2020-10-07T13:43:22Z")

</div>

Hi all, I’ve built a model for inferring the daily number of Covid-19 infections in a geographical region from both coronavirus symptoms being reported through emergency service calls and coronavirus-related deaths. I h…

---

## [Fitting a Simple SIR model with parameters that depend on time](https://discourse.mc-stan.org/t/fitting-a-simple-sir-model-with-parameters-that-depend-on-time/16380)

<div class="topic-metadata">

**Author:** [@deansjam](https://discourse.mc-stan.org/u/deansjam)\
**Replies:** 12\
**Last updated:** [July 10, 2020, 3:40pm UTC](https://discourse.mc-stan.org/t/fitting-a-simple-sir-model-with-parameters-that-depend-on-time/16380 "2020-07-10T15:40:12Z")

</div>

Hello! I am trying to fit parameters in ODE-based model using Stan. The model is from Mathematical modeling of interaction between innate and adaptive immune responses in COVID‐19 and implications for viral pathogenesi…

---

## [Moving to Incidence in Bayesian Workflow for Disease Transmission - Negative Values for Incidence Out of Solver](https://discourse.mc-stan.org/t/moving-to-incidence-in-bayesian-workflow-for-disease-transmission-negative-values-for-incidence-out-of-solver/16259)

<div class="topic-metadata">

**Author:** [@Mdewitt](https://discourse.mc-stan.org/u/Mdewitt)\
**Replies:** 5\
**Last updated:** [June 28, 2020, 5:55pm UTC](https://discourse.mc-stan.org/t/moving-to-incidence-in-bayesian-workflow-for-disease-transmission-negative-values-for-incidence-out-of-solver/16259 "2020-06-28T17:55:16Z")

</div>

I am trying to attempt the model described in the Bayesian Workflow for Disease Transmission described here, but I keep getting errors thrown for logs of negative numbers/ zeros. I tried to set a lower bound, but that al…

---

## [Error with Bayesian workflow for disease transmission tutorial](https://discourse.mc-stan.org/t/error-with-bayesian-workflow-for-disease-transmission-tutorial/16253)

<div class="topic-metadata">

**Author:** [@Ian.Frankenburg](https://discourse.mc-stan.org/u/Ian.Frankenburg)\
**Replies:** 4\
**Last updated:** [June 28, 2020, 5:40pm UTC](https://discourse.mc-stan.org/t/error-with-bayesian-workflow-for-disease-transmission-tutorial/16253 "2020-06-28T17:40:01Z")

</div>

I’m trying to follow along with Bayesian workflow for disease transmission modeling in Stan, but unfortunately I can’t get the example to run. I’ve used exactly the code provided in the tutorial with no alterations, but …

---

## [Initialization Error in Stochastic Epidemic SEIR Model](https://discourse.mc-stan.org/t/initialization-error-in-stochastic-epidemic-seir-model/16235)

<div class="topic-metadata">

**Author:** [@Gauri](https://discourse.mc-stan.org/u/Gauri)\
**Replies:** 18\
**Last updated:** [June 28, 2020, 5:34pm UTC](https://discourse.mc-stan.org/t/initialization-error-in-stochastic-epidemic-seir-model/16235 "2020-06-28T17:34:50Z")

</div>

Hello, My group members and I are trying to replicate a paper which uses MCMC for an assignment. The paper uses stochastic discrete‐time SEIR model to calculate the movement of population between compartment at each tim…

---

## [Attempt to generate prior predictive samples from SIR model](https://discourse.mc-stan.org/t/attempt-to-generate-prior-predictive-samples-from-sir-model/15468)

<div class="topic-metadata">

**Author:** [@ziqing-ang](https://discourse.mc-stan.org/u/ziqing-ang)\
**Replies:** 6\
**Last updated:** [May 30, 2020, 8:12am UTC](https://discourse.mc-stan.org/t/attempt-to-generate-prior-predictive-samples-from-sir-model/15468 "2020-05-30T08:12:25Z")

</div>

I am trying to pick up PyStan for my research project involving ODE. I have found this very instructive paper: https://mc-stan.org/users/documentation/case-studies/boarding\_school\_case\_study.html#2\_using\_simulated\_data…

---

## [Joint prior for sensitivity and specificity](https://discourse.mc-stan.org/t/joint-prior-for-sensitivity-and-specificity/15458)

<div class="topic-metadata">

**Author:** [@maxbiostat](https://discourse.mc-stan.org/u/maxbiostat)\
**Replies:** 1\
**Last updated:** [May 29, 2020, 1:39am UTC](https://discourse.mc-stan.org/t/joint-prior-for-sensitivity-and-specificity/15458 "2020-05-29T01:39:28Z")

</div>

This topic is to discuss the recently publicised draft by our very own @andrewgelman and @Bob\_Carpenter. In the paper, the authors choose to model sensitivity and specificity via half normal priors \\gamma \\sim \\operat…

---

## [Estimating parameters of a SEIR model](https://discourse.mc-stan.org/t/estimating-parameters-of-a-seir-model/15198)

<div class="topic-metadata">

**Author:** [@Ilia](https://discourse.mc-stan.org/u/Ilia)\
**Replies:** 28\
**Last updated:** [May 23, 2020, 1:26am UTC](https://discourse.mc-stan.org/t/estimating-parameters-of-a-seir-model/15198 "2020-05-23T01:26:10Z")

</div>

Recently I have opened a topic here seeking a solution to the error I was getting while running stan. So far, I have managed to polish my code using the advice I got from that topic. Here is my stan code: cat( ' funct…

---

## [Stan Epidemiology page](https://discourse.mc-stan.org/t/stan-epidemiology-page/15176)

<div class="topic-metadata">

**Author:** [@LeoGrin](https://discourse.mc-stan.org/u/LeoGrin)\
**Replies:** 4\
**Last updated:** [May 15, 2020, 3:20pm UTC](https://discourse.mc-stan.org/t/stan-epidemiology-page/15176 "2020-05-15T15:20:37Z")

</div>

Hi all, I noticed that the Stan documentation page only mentioned two specialised field guides, on education research and ecology. I feel it could be useful, both for the short and long term, to have one for epidemiolog…

---

## [Convergence / latest version of Stan issues with our covid-19 model?](https://discourse.mc-stan.org/t/convergence-latest-version-of-stan-issues-with-our-covid-19-model/14100)

<div class="topic-metadata">

**Author:** [@flaxter](https://discourse.mc-stan.org/u/flaxter)\
**Replies:** 84\
**Last updated:** [May 9, 2020, 4:38pm UTC](https://discourse.mc-stan.org/t/convergence-latest-version-of-stan-issues-with-our-covid-19-model/14100 "2020-05-09T16:38:02Z")

</div>

Our code is on GitHub here: https://github.com/ImperialCollegeLondon/covid19model/ I’m running base.r from Rscript (i.e. Rscript base.r; this runs 4 chains for 200 iterations, 100 warmup; takes \< 4 minutes). Everything…

---

## [Setting individual parameter priors in SIR Model](https://discourse.mc-stan.org/t/setting-individual-parameter-priors-in-sir-model/14652)

<div class="topic-metadata">

**Author:** [@bacross](https://discourse.mc-stan.org/u/bacross)\
**Replies:** 1\
**Last updated:** [April 28, 2020, 2:28am UTC](https://discourse.mc-stan.org/t/setting-individual-parameter-priors-in-sir-model/14652 "2020-04-28T02:28:39Z")

</div>

Hi there. I’m working with using a SIR Model and having trouble coding the priors for the parameters of the states in the model. I’m working off of the Stan code found here: https://jrmihalj.github.io/estimating-transm…

---

## [Partially Identified Model of COVID-19 Spread for Measuring Virus Suppression Policies](https://discourse.mc-stan.org/t/partially-identified-model-of-covid-19-spread-for-measuring-virus-suppression-policies/13905)

<div class="topic-metadata">

**Author:** [@saudiwin](https://discourse.mc-stan.org/u/saudiwin)\
**Replies:** 6\
**Last updated:** [April 1, 2020, 6:03pm UTC](https://discourse.mc-stan.org/t/partially-identified-model-of-covid-19-spread-for-measuring-virus-suppression-policies/13905 "2020-04-01T18:03:24Z")

</div>

Hi all - I have a new model of a latent infectious process (COVID-19) that I am planning to use with an ongoing data collection project of international government responses to the coronavirus epidemic. Compared to the …

---

## [Fitting SEIR using a binomial distribution on the incidence data](https://discourse.mc-stan.org/t/fitting-seir-using-a-binomial-distribution-on-the-incidence-data/11055)

<div class="topic-metadata">

**Author:** [@jandraor](https://discourse.mc-stan.org/u/jandraor)\
**Replies:** 13\
**Last updated:** [November 8, 2019, 12:42pm UTC](https://discourse.mc-stan.org/t/fitting-seir-using-a-binomial-distribution-on-the-incidence-data/11055 "2019-11-08T12:42:52Z")

</div>

Hi, This is my first try with Stan and R. I’m trying to calibrate the contact rate in an SEIR model from incidence data. I assume the incidence data is binomially distributed, where p indicates the probability of a case…

[Next page](https://discourse.mc-stan.org/tag/epidemiology/101.md?match_all_tags=true&page=1&tags%5B%5D=epidemiology)
