LogNormal distribution

The LogNormal distribution can be characterized by the exponent of its parameters:

• exp(μ): the median
• exp(σ): the multiplicative standard deviation $\sigma^*$.

Function σstar returns the multiplicative standard deviation.

A distribution can be specified by taking the log of median and $\sigma^*$

d = LogNormal(log(2), log(1.2))
σstar(d) == 1.2

Alternatively the distribution can be specified by its mean and either

• Multiplicative standard deviation,$\sigma^*$, using type AbstractΣstar
• Standard deviation at log-scale, $\sigma$, or
• relative error, $cv$.
d = fit(LogNormal, 2, Σstar(1.2))
(mean(d), σstar(d)) == (2, 1.2)
d = fit_mean_Σ(LogNormal, 2, 1.2)
(mean(d),  d.σ) == (2, 1.2)
d = fit_mean_relerror(LogNormal, 2, 0.2)
(mean(d), std(d)/mean(d)) .≈ (2, 0.2)

Detailed API

DistributionFits.σstarMethod
σstar(d)

Get the multiplicative standard deviation of LogNormal distribution d.

Arguments

• d: The type of distribution to fit

Examples

d = LogNormal(2,log(1.2))
σstar(d) == 1.2
StatsAPI.fitMethod
fit(D, mean, σstar::AbstractΣstar)
fit_mean_Σ(D, mean, σ::Real)

Fit a statistical distribution of type D to mean and multiplicative standard deviation, σstar, or scale parameter at log-scale: σ.

Arguments

• D: The type of distribution to fit
• mean: The moments of the distribution
• σstar::AbstractΣstar: The multiplicative standard deviation
• σ: The standard-deviation parameter at log-scale

The first version uses type AbstractΣstar to distinguish from other methods of function fit.

Examples

d = fit(LogNormal, 2, Σstar(1.1));
(mean(d), σstar(d)) == (2, 1.1)
DistributionFits.AbstractΣstarType
Σstar <: AbstractΣstar

Represent the multiplicative standard deviation of a LogNormal distribution.

Supports dispatch of fit. Invoking the type as a function returns its single value.

Examples

a = Σstar(4.2)
a() == 4.2
DistributionFits.fit_mean_relerrorFunction
fit_mean_relerror(D, mean, relerror)

Fit a distribution of type D to mean and relative error.

Arguments

• D: The type of distribution to fit
• mean: The first moment of the distribution
• relerror: The relative error, i.e. the coefficient of variation

Examples

d = fit_mean_relerror(LogNormal, 10.0, 0.03);
(mean(d), std(d)/mean(d)) .≈ (10.0, 0.03)