Skip to content

Commit

Permalink
Merge pull request #131 from mrc-ide/weibull-log-normal
Browse files Browse the repository at this point in the history
Add log-normal and weibull
  • Loading branch information
richfitz authored Dec 9, 2024
2 parents 13e46d4 + 2bcd948 commit d98d665
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: odin2
Title: Next generation odin
Version: 0.3.13
Version: 0.3.14
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "[email protected]"),
person("Wes", "Hinsley", role = "aut"),
Expand Down
2 changes: 2 additions & 0 deletions vignettes/functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,15 @@ The currently supported distributions are (alphabetically):
- `shape`, `rate` (**default**)
- `shape`, `scale`
* `Hypergeometric` -- the [hypergeometric distribution](https://en.wikipedia.org/wiki/Hypergeometric_distribution) with parameters `m` (number of white balls), `n` (number of black balls), and `k` (number of samples), and we return the number of *white* balls. We may support alternative parametrisations of this distribution in future (this version is the same parametrisation as `rhyper`)
* `LogNormal` -- the [log-normal distribution](https://en.wikipedia.org/wiki/Log-normal_distribution) with parameters `meanlog` and `sdlog`, the mean and standard deviation of the distribution on the log scale
* `NegativeBinomial` -- the [negative binomial distribution](https://en.wikipedia.org/wiki/Negative_binomial_distribution) with two forms:
- `size`, `prob` (**default**)
- `size`, `mu` (the mean)
* `Normal` -- the [normal distribution](https://en.wikipedia.org/wiki/Normal_distribution) with parameters `mean`, `sd`
* `Poisson` -- the [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution) with parameter `lambda` (the mean)
* `TruncatedNormal` -- the [truncated normal distribution](https://en.wikipedia.org/wiki/Truncated_normal_distribution) with parameters `mean`, `sd`, `min` and `max`. For a one-sided truncated normal distribution, you can set `min = -Inf` or `max = Inf`. Note that `mean` and `sd` are not the mean and standard deviation of the truncated normal distribution, but are the mean and standard deviation of the normal distribution that has been truncated.
* `Uniform` -- the [uniform distribution](https://en.wikipedia.org/wiki/Uniform_distribution) with parameters `min` and `max`
* `Weibull` -- the [Weibull distribution](https://en.wikipedia.org/wiki/Weibull_distribution) with parameters `shape` and `scale`

In the future, we plan support for additional distributions, please let us know if we are missing any that you need. The support for these functions comes from `monty` and we will link here to the docs in that package once they exist for additional details.

Expand Down
6 changes: 3 additions & 3 deletions vignettes/migrating.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,21 @@ The mapping is:

* `rbeta()` to `Beta`
* `rbinom()` to `Binomial`
* `rcauchy()` to `Cauchy` (unsupported for now)
* `rcauchy()` to `Cauchy`
* `rchisq()` to `ChiSquared` (unsupported for now)
* `rexp()` to `Exponential`
* `rf()` to `F` (unsupported for now)
* `rgamma()` to `Gamma`
* `rgeometric()` to `Geometric` (unsupported for now)
* `rhyper()` to `Hypergeometric`
* `rlogis()` to `Logistic` (unsupported for now)
* `rlnorm()` to `Lognormal` (unsupported for now)
* `rlnorm()` to `LogNormal`
* `rnbinom()` to `NegativeBinomial`
* `rnorm()` to `Normal`
* `rpois()` to `Poisson`
* `rt()` to `T` (unsupported for now)
* `runif()` to `Uniform`
* `rweibull()` to `Weibull` (unsupported for now)
* `rweibull()` to `Weibull`

(Not all of these are implemented yet).

Expand Down

0 comments on commit d98d665

Please sign in to comment.