Struct russell_stat::DistributionFrechet
source · pub struct DistributionFrechet { /* private fields */ }
Expand description
Defines the Frechet / Type II Extreme Value Distribution (largest value)
Implementations§
source§impl DistributionFrechet
impl DistributionFrechet
sourcepub fn new(location: f64, scale: f64, shape: f64) -> Result<Self, StrError>
pub fn new(location: f64, scale: f64, shape: f64) -> Result<Self, StrError>
Examples found in repository?
examples/distribution_frechet.rs (line 6)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
fn main() -> Result<(), StrError> {
// generate samples
let mut rng = rand::thread_rng();
let dist = DistributionFrechet::new(0.0, 1.0, 1.0)?;
let nsamples = 10_000;
let mut data = vec![0.0; nsamples];
for i in 0..nsamples {
data[i] = dist.sample(&mut rng);
}
println!("{}", statistics(&data));
// text-plot
let stations = (0..20).map(|i| (i as f64) * 0.5).collect::<Vec<f64>>();
let mut hist = Histogram::new(&stations)?;
hist.count(&data);
println!("{}", hist);
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DistributionFrechet
impl RefUnwindSafe for DistributionFrechet
impl Send for DistributionFrechet
impl Sync for DistributionFrechet
impl Unpin for DistributionFrechet
impl UnwindSafe for DistributionFrechet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more