[Stable]

A continuous distribution on the real line. For binary outcomes the model given by \(P(Y = 1 | X) = F(X \beta)\) where \(F\) is the Logistic cdf() is called logistic regression.

dist_logistic(location, scale)

Arguments

location, scale

location and scale parameters.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_logistic.html

In the following, let \(X\) be a Logistic random variable with location = \(\mu\) and scale = \(s\).

Support: \(R\), the set of all real numbers

Mean: \(\mu\)

Variance: \(s^2 \pi^2 / 3\)

Probability density function (p.d.f):

$$ f(x) = \frac{e^{-\frac{x - \mu}{s}}}{s \left[1 + e^{-\frac{x - \mu}{s}}\right]^2} $$

Cumulative distribution function (c.d.f):

$$ F(x) = \frac{1}{1 + e^{-\frac{x - \mu}{s}}} $$

Moment generating function (m.g.f):

$$ E(e^{tX}) = e^{\mu t} B(1 - st, 1 + st) $$

for \(-1 < st < 1\), where \(B(a, b)\) is the Beta function.

See also

Examples

dist <- dist_logistic(location = c(5,9,9,6,2), scale = c(2,3,4,2,1))

dist
#> <distribution[5]>
#> [1] Logistic(5, 2) Logistic(9, 3) Logistic(9, 4) Logistic(6, 2) Logistic(2, 1)
mean(dist)
#> [1] 5 9 9 6 2
variance(dist)
#> [1] 13.159473 29.608813 52.637890 13.159473  3.289868
skewness(dist)
#> [1] 0 0 0 0 0
kurtosis(dist)
#> [1] 1.2 1.2 1.2 1.2 1.2

generate(dist, 10)
#> [[1]]
#>  [1]  5.134754  5.801184  6.277460 -1.155093  9.429404  2.179077  7.860483
#>  [8]  4.537099  7.000458  3.959552
#> 
#> [[2]]
#>  [1]  1.198022  8.172758  9.652521  2.672765 15.670428 -1.579701  2.355033
#>  [8]  8.547396  4.119431  9.155862
#> 
#> [[3]]
#>  [1] 20.224348 11.972975  7.729282 18.578789 10.139252  6.320606 15.260272
#>  [8] 13.438220  4.273332  6.334347
#> 
#> [[4]]
#>  [1]  4.7255545  4.3254462  7.0125627  3.7704457  1.5150040  3.0726182
#>  [7] -0.6219724  6.1571594  2.9567234  6.5931543
#> 
#> [[5]]
#>  [1]  2.52607543  1.01234568  2.31628873  0.80495674  0.06625611  7.70677980
#>  [7]  1.89704149 -0.31092296  0.83811355  0.94952941
#> 

density(dist, 2)
#> [1] 0.07457323 0.02686172 0.03153231 0.05249679 0.25000000
density(dist, 2, log = TRUE)
#> [1] -2.595974 -3.617053 -3.456743 -2.947003 -1.386294

cdf(dist, 4)
#> [1] 0.3775407 0.1588691 0.2227001 0.2689414 0.8807971

quantile(dist, 0.7)
#> [1]  6.694596 11.541894 12.389191  7.694596  2.847298