-
-
Notifications
You must be signed in to change notification settings - Fork 477
Description
Given an arbitrary distribution w/ parameters, e.g. Uniform or Normal, we might want to compare its parameters to those of another distribution of the same type. Depending on how we come across these structs, we might not easily have access to the underlying distribution parameters. I've thought of a few considerations:
-
Is it worth implementing some way of comparing the distributions in rand?
-
How should comparison be implemented? Float types generally only implement
PartialEq, so doesn't necessarily make sense forDistributionto generally requireEq, onlyPartialEq. Alternatively, one could introduce a new trait with a methodfn dist_eq(&self, other: &Self) -> boolto be implemented by comparable distributions. Even more simply, one could manually expose the distribution parameters on a per-distribution basis, e.g. addNormal::meanandNormal::std_devfunctions, and leave comparison to the user. -
Related to (2), it might be possible that distributions with the same "public" parameters may be implemented with different "private" parameters that determine how samples are drawn from an RNG. Would this complicate the notion of comparing distributions?
Thoughts?