Distributions.jl icon indicating copy to clipboard operation
Distributions.jl copied to clipboard

add loglogistic distribution

Open yunzli opened this issue 2 years ago • 3 comments

This PR adds log-logistic distribution to the package.

The log-logistic distribution has two parameters: scale and shape. It has been widely used in survival analysis.

The model implementation is in src/univariate/continuous/loglogistic.jl The test is in test/univariate/continuous/loglogistic.jl

yunzli avatar Sep 19 '23 20:09 yunzli

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/Distributions.jl 100.00% <ø> (ø)
src/univariates.jl 75.90% <ø> (ø)
src/univariate/continuous/loglogistic.jl 43.90% <43.90%> (ø)

... and 10 files with indirect coverage changes

:loudspeaker: Thoughts on this report? Let us know!.

codecov-commenter avatar Sep 19 '23 20:09 codecov-commenter

This looks like a pretty solid implementation, but I do wonder if we should be adding Log* distributions piecemeal like this, rather than providing a more general interface for transformed variables.

ParadaCarleton avatar Sep 22 '23 01:09 ParadaCarleton

This looks like a pretty solid implementation, but I do wonder if we should be adding Log* distributions piecemeal like this, rather than providing a more general interface for transformed variables.

It sounds like a very interesting idea to provide a general interface for transformed variables. But I feel there might be some difficulties. 1) commonly used parameterization might not be consistent for distribution on R and its log transformation on R+. 2) it might not be straightforward to "translate" moments. For example, Logistic(a, b) always has a mean value of a, but LogLogistic(c,d) doesn't always have a finite mean. 3) It might be redundant for users to recreate a transformation, especially for popular ones as LogNormal, LogLogistic, LogUniform, etc.

yunzli avatar Sep 22 '23 15:09 yunzli