fslaborg / FSharp.Stats

statistical testing, linear algebra, machine learning, fitting and signal processing in F#
https://fslab.org/FSharp.Stats/
Other
205 stars 54 forks source link

Update `Support` member for all probability distributions #292

Closed bvenn closed 9 months ago

bvenn commented 9 months ago

Description

The syntax for the static member Support [within distributions] are written in a different syntax. @Freymaurer in #222

The Support of distributions defines the range of values the parameter can take. At the moment, there is a mixture of types for the Support. It is either defined as tuple, Interval, or undefined. To homogenize all distribution fields, it is required to change all tuple supports to Interval<float> or Interval<int> like it is done here:

https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Discrete/Binomial.fs#L120-L122

Please check the validity of each existing distribution-support and create the appropriate Interval that either is of type Interval<float> or Interval<int> for discrete distributions. The Wikipedia pages for probability distributions are a great source to verify the correct support (e.g. on the right side of Chi squared distribution).

There may be distributions where no support can be defined or it is not clear on first sight. Please comment these cases here!

References

Pointers

Hints (click to expand if you need additional pointers) - [ ] https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/Beta.fs#L129 - [ ] https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/Chi.fs#L76 - [ ] https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/F.fs#L103 - [ ] https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/Gamma.fs#L166 - [ ] https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/LogNormal.fs#L76 - [ ] https://github.com/fslaborg/FSharp.Stats/blob/developer/src/FSharp.Stats/Distributions/Continuous/MultivariateNormal.fs - [ ] https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/Normal.fs#L132 - [ ] https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/StudentT.fs#L78 - [ ] [StudentizedRange distribution](https://github.com/fslaborg/FSharp.Stats/blob/developer/src/FSharp.Stats/Distributions/Continuous/StudentizedRange.fs) - [ ] [MultivariateNormal distribution](https://github.com/fslaborg/FSharp.Stats/blob/developer/src/FSharp.Stats/Distributions/Continuous/MultivariateNormal.fs) - [ ] check for correct interval type! https://github.com/fslaborg/FSharp.Stats/blob/8fb5d6dd07ff213a4e91b618fb2e654bc6147985/src/FSharp.Stats/Distributions/Continuous/Exponential.fs#L91 - To be able to contribute to this library you'll need - an GitHub account - an IDE like Visual Studio Community or Visual Studio Code - [dotnet 6 sdk](https://dotnet.microsoft.com/en-us/download) - to build the binaries yourself follow the [instructions](https://fslab.org/FSharp.Stats/#Installation) - while working on the [FSharp.Stats documentation](https://fslab.org/FSharp.Stats/) (any file within https://github.com/fslaborg/FSharp.Stats/tree/developer/docs) you can navigate to the project folder with a prompt of your choice and use the command `./build watchdocs` - unit tests can be executed via `./build runtests`
valbers commented 9 months ago

I'm going to take a look at that.

valbers commented 9 months ago

--> https://github.com/fslaborg/FSharp.Stats/pull/301