thinhong / denim

R package for discrete model
https://thinhong.github.io/denim/
Other
1 stars 1 forks source link

Example in the README file #11

Open choisy opened 2 years ago

choisy commented 2 years ago

In the README file you say that the example is simple, which is not the case. It'd be better here to use a really simple SIR example. You can present more complicated models such as this one in vignettes.

choisy commented 2 years ago

Furthermore, I'm confused by what

"0.3 * S -> I" = mathexpr(beta * S * (I + IV) / N),
"0.7 * S -> V" = constant(2),

means, in particular, what do 0.3 and 0.7 represent?

choisy commented 2 years ago

Also, do we really need the functions mathexpr() and constant()? Why couldn't we simply use:

transitions <- list(
  "0.3 * S -> I" = "beta * S * (I + IV) / N",
  "0.7 * S -> V" = 2,
  "I -> R" = gamma(3, 2),
  "V -> IV" = "beta * 0.3 * V * (I + IV) / N",
  "IV -> R" = exponential(2)
)
thinhong commented 2 years ago

Furthermore, I'm confused by what

"0.3 * S -> I" = mathexpr(beta * S * (I + IV) / N),
"0.7 * S -> V" = constant(2),

means, in particular, what do 0.3 and 0.7 represent?

Here is an example that only 70% of the population agree to get a vaccine shot (30% are anti-vaxxers), in the vignette I made another example that when we know the mortality probability i.e 10% patients will die and 90% recover, we can define it by 0.1 * I -> D and 0.9 * I -> R, I'll fix it to explain the example in more detail

thinhong commented 2 years ago

Also, do we really need the functions mathexpr() and constant()? Why couldn't we simply use:

transitions <- list(
  "0.3 * S -> I" = "beta * S * (I + IV) / N",
  "0.7 * S -> V" = 2,
  "I -> R" = gamma(3, 2),
  "V -> IV" = "beta * 0.3 * V * (I + IV) / N",
  "IV -> R" = exponential(2)
)

Thanks, it's better this way. I'm wondering why I make things so complicated lol. I'll fix it!

choisy commented 2 years ago

Furthermore, I'm confused by what

"0.3 * S -> I" = mathexpr(beta * S * (I + IV) / N),
"0.7 * S -> V" = constant(2),

means, in particular, what do 0.3 and 0.7 represent?

Here is an example that only 70% of the population agree to get a vaccine shot (30% are anti-vaxxers), in the vignette I made another example that when we know the mortality probability i.e 10% patients will die and 90% recover, we can define it by 0.1 * I -> D and 0.9 * I -> R, I'll fix it to explain the example in more detail

OK, but then I just want to make sure that your model is like this:

Screen Shot 2022-04-05 at 15 20 27

instead of this:

Screen Shot 2022-04-05 at 15 23 22

Because it's not the same. Your text sounds like the first case but your R code looks more like the second case. Please confirm that your code does the first option and not the second one.

thinhong commented 2 years ago

Furthermore, I'm confused by what

"0.3 * S -> I" = mathexpr(beta * S * (I + IV) / N),
"0.7 * S -> V" = constant(2),

means, in particular, what do 0.3 and 0.7 represent?

Here is an example that only 70% of the population agree to get a vaccine shot (30% are anti-vaxxers), in the vignette I made another example that when we know the mortality probability i.e 10% patients will die and 90% recover, we can define it by 0.1 * I -> D and 0.9 * I -> R, I'll fix it to explain the example in more detail

OK, but then I just want to make sure that your model is like this: Screen Shot 2022-04-05 at 15 20 27 instead of this: Screen Shot 2022-04-05 at 15 23 22 Because it's not the same. Your text sounds like the first case but your R code looks more like the second case. Please confirm that your code does the first option and not the second one.

Oh my god! Sorry, I think they are the same. Can you help me to discriminate them?

choisy commented 2 years ago

In the first case we decide in advance the exact proportion of S who go in the two directions (0.3 and 0.7) whereas in the second case, the exact proportions will also depends on the values of a and b.