Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the SEIR-V model from the epidemics R package #2

Open
sdwfrost opened this issue Jun 15, 2023 · 2 comments
Open

Implement the SEIR-V model from the epidemics R package #2

sdwfrost opened this issue Jun 15, 2023 · 2 comments

Comments

@sdwfrost
Copy link
Contributor

See https://github.com/epiverse-trace/epidemics

@sdwfrost
Copy link
Contributor Author

An R version of the code (without vaccination) is here. The blocker at the moment is that the following code for an SEIR model gives the wrong wiring diagram.

using AlgebraicPetri,AlgebraicPetri.TypedPetri
using Catlab, Catlab.CategoricalAlgebra, Catlab.Programs
using Catlab.WiringDiagrams, Catlab.Graphics
using AlgebraicDynamics.UWDDynam


epi_transitions = LabelledPetriNet(
  [:Pop],
  :infection=>((:Pop, :Pop)=>(:Pop, :Pop)),
  :progression=>(:Pop=>:Pop),
  :recovery=>(:Pop=>:Pop)
)

seir_uwd = @relation () where (S::Pop, E::Pop, I::Pop, R::Pop) begin
    infection(S, I, E, I)
    progression(E, I)
    recovery(I, R)
end
seir_acst = oapply_typed(epi_transitions, seir_uwd, [, , ])
seir_lpn = dom(seir_acst)
Graph(seir_lpn)

@slwu89
Copy link
Collaborator

slwu89 commented Mar 9, 2024

@sdwfrost the upstream bugs may have been fixed, see the result below from your code (replacing Graph(seir_lpn) with to_graphviz(seir_lpn) to conform to Catlab's standard graphics interface)

Screenshot 2024-03-08 at 4 31 19 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants