pub struct LogNormal {
pub mu: f64,
pub sigma: f64,
}Expand description
Log-Normal distribution LogNormal(μ, σ).
§Examples
use rs_stats::distributions::lognormal::LogNormal;
use rs_stats::distributions::traits::Distribution;
let ln = LogNormal::new(0.0, 1.0).unwrap();
// Mean of LogNormal(0, 1) = exp(0.5)
assert!((ln.mean() - 0.5_f64.exp()).abs() < 1e-10);Fields§
§mu: f64Location (mean of ln X) μ
sigma: f64Scale (std-dev of ln X) σ > 0
Implementations§
Trait Implementations§
Source§impl Distribution for LogNormal
impl Distribution for LogNormal
Source§fn num_params(&self) -> usize
fn num_params(&self) -> usize
Number of free parameters (used when computing AIC / BIC).
Source§fn inverse_cdf(&self, p: f64) -> StatsResult<f64>
fn inverse_cdf(&self, p: f64) -> StatsResult<f64>
Quantile (inverse CDF): find x such that F(x) = p.
Source§fn log_likelihood(&self, data: &[f64]) -> StatsResult<f64>
fn log_likelihood(&self, data: &[f64]) -> StatsResult<f64>
Sum of log-likelihoods: Σ ln f(xᵢ).
impl Copy for LogNormal
Auto Trait Implementations§
impl Freeze for LogNormal
impl RefUnwindSafe for LogNormal
impl Send for LogNormal
impl Sync for LogNormal
impl Unpin for LogNormal
impl UnsafeUnpin for LogNormal
impl UnwindSafe for LogNormal
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