Skip to content

Add PERT distribution#782

Merged
dhardy merged 4 commits intorust-random:masterfrom
dhardy:distr
Apr 23, 2019
Merged

Add PERT distribution#782
dhardy merged 4 commits intorust-random:masterfrom
dhardy:distr

Conversation

@dhardy
Copy link
Member

@dhardy dhardy commented Apr 22, 2019

Fixes #778 @barabadzhi can you review?

Testing is incomplete, as with most distributions. We need to add code for histogram/PDF testing.

Error types may see additional tweaking before the next release, but I think this will do for now @vks?

Copy link

@barabadzhi barabadzhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I'd recommend is to decouple Pert from triangular.rs.
It has nothing to do with Triangular (except Beta origins)
and deserves it's own pert.rs. 🙂


/// Set up the PERT distribution with defined `min`, `max`, `mode` and
/// `shape`.
pub fn new_shape(min: f64, max: f64, mode: f64, shape: f64) -> Result<Pert, PertError> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for parametrized constructor

@dhardy
Copy link
Member Author

dhardy commented Apr 22, 2019

Rebased and reorganised commits, moved Pert distr to a new file, renamed Pert::new_shapePert::new_with_shape; renamed Dirichlet::new_with_paramDirichlet::new_with_size to match.

@vks vks self-requested a review April 23, 2019 10:53
@dhardy dhardy merged commit 1f7af60 into rust-random:master Apr 23, 2019
benjamin-lieser pushed a commit to benjamin-lieser/rand that referenced this pull request Feb 5, 2025
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

Successfully merging this pull request may close these issues.

Four-parameter Beta distribution/PERT distribution

3 participants