Skip to content

Commit 9b5162f

Browse files
committed
document fitting ScaledLogNormal
1 parent c0c5c92 commit 9b5162f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/src/lognormal.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,33 @@ d = fit_mean_relerror(LogNormal, 2, 0.2)
4545
(true, true)
4646
```
4747

48+
## ScaledLogNormal: LogNormal(-x)
49+
To support the use case of a distribution of strictly negative values, the
50+
fitting of a mirrored LogNormal on `-x` is supported.
51+
52+
There is a type-alias
53+
`ScaledLogNormal = LocationScale{T, Continuous, LogNormal{T}} where T`,
54+
denoting a scaled and shifted LogNormal distribution.
55+
56+
There are fitting function dispatched by this type that fit
57+
such a mirrored distribution.
58+
59+
```jldoctest; output = false, setup = :(using DistributionFits)
60+
d = fit_mean_Σ(ScaledLogNormal, -1, log(1.1))
61+
(mean(d), σstar(d)) .≈ (-1.0, 1.1)
62+
# output
63+
(true, true)
64+
```
65+
66+
```jldoctest; output = false, setup = :(using DistributionFits)
67+
d = fit(ScaledLogNormal, -1.0, @qp_ll(-1.32), Val(:mode))
68+
(mode(d), quantile(d, 0.025)) .≈ (-1.0, -1.32)
69+
# output
70+
(true, true)
71+
```
72+
Note the usage of lower quantile for the mirrored distribution, here.
73+
74+
4875
## Detailed API
4976

5077
```@docs

0 commit comments

Comments
 (0)