dist_logistic(location, scale)

## Arguments

location location and scale parameters. location and scale parameters.

## Details

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.

We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.

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 [1 + \exp(-(\frac{x - \mu}{s})) ]^2}$$

Cumulative distribution function (c.d.f):

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

Moment generating function (m.g.f):

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

where $$\beta(x, y)$$ is the Beta function.

## Examples

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

dist
#> <distribution>
#>  Logistic(5, 2) Logistic(9, 3) Logistic(9, 4) Logistic(6, 2) Logistic(2, 1)mean(dist)
#>  5 9 9 6 2variance(dist)
#>  13.159473 29.608813 52.637890 13.159473  3.289868skewness(dist)
#>  0 0 0 0 0kurtosis(dist)
#>  1.2 1.2 1.2 1.2 1.2
generate(dist, 10)
#> []
#>   3.051111 4.443118 4.328958 1.273285 6.566140 1.858059 9.981575 5.926152
#>   3.452139 7.896554
#>
#> []
#>   15.671659  3.170429  9.791241  3.234065 10.565773  1.477064  6.247261
#>    6.608087  3.718496 13.154582
#>
#> []
#>    2.713815 14.196408  8.519997  7.920825 10.201478 12.977880 17.536972
#>    3.944472  5.449427 14.875827
#>
#> []
#>   -0.1761264  6.0421749  3.7127549  6.7208426 13.0320687  3.6139797
#>    9.7566396  1.8340325  8.7912884  7.3081170
#>
#> []
#>   2.6280814 0.7708067 3.7661612 1.7409898 1.1011250 2.5648962 0.9774935
#>   1.5369747 2.4861284 2.1671001
#>
density(dist, 2)
#>  0.07457323 0.02686172 0.03153231 0.05249679 0.25000000density(dist, 2, log = TRUE)
#>  -2.595974 -3.617053 -3.456743 -2.947003 -1.386294
cdf(dist, 4)
#>  0.3775407 0.1588691 0.2227001 0.2689414 0.8807971
quantile(dist, 0.7)
#>   6.694596 11.541894 12.389191  7.694596  2.847298