Giter Club home page Giter Club logo

statrs's People

Contributors

alimf17 avatar asayers avatar boxtown avatar doraneko94 avatar freezylemon avatar henryjac avatar iago-lito avatar julianknodt avatar kalev avatar larsgw avatar manifoldfr avatar marwes avatar michiel-de-muynck avatar millardjn avatar mp4096 avatar mutlusun avatar noamteyssier avatar nottotis avatar palladinium avatar rationalash avatar rikhuijzer avatar saona-raimundo avatar sirfrancisbeaufort avatar sphqxe avatar tessob avatar tonyrippy avatar troublescooter avatar vks avatar warrenweckesser avatar yeungonion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

statrs's Issues

Refactor traits

Refactor traits to be more specific e.g. (trait Mode and trait Median). Should probably done in the same step as this issue

Test coverage for Statistic.rank for n > 10

Need code coverage on case where data length > 10 for rank function in order to cover the quick_sort impl. As a side note, the quick sort impl is borrowed whole sale from Math.NET and there is probably a more idiomatic Rust implementation that could be used.

Implementation of inverse digamma

Need resources on good implementation of inverse digamma (psi) function. The Math.NET code seems to be incorrect and doesn't even pass their own unit tests

Error handling: Panics vs Result

Currently the responsibility for guarding against exceptional cases (e.g. input not in valid domain, mathematically invalid operations etc) is passed to the user. We panic when an operation does not make mathematical sense (e.g. calculating the cumulative distribution function for discrete distributions at a negative input) which forces users to double check to make sure their inputs are valid. While this results in technically correct and predictable behavior from the API, I'm not sure if it's ergonomic or idiomatic and have been mulling over possibly introducing a Result based API either replacing or in addition to the stricter panic based API. This however warrants some discussion and I would love feedback from the community

Review of iterator statistics trait

Currently the iterator statistics trait is treated as a special case since to act over the iterator the methods need to take a mutable reference, so all the traits from statrs::statistics are (going to be) combined in the IterStatistics trait that is implemented for all Iterators. I haven't come up with a better solution but for some reason this implementation doesn't sit too well with me and I'd love to have someone review it and provide feedback.

Port streaming statistics

Port over streaming statistics. Implement statistics trait for Vector (should be simple wrapper of slice)

Better implementation for 'hidden' generics

For certain distributions, (Bernoulli comes to mind), the second generic parameter N is hidden since Bernoulli depends on Binomial which has two parameters P and N but the N parameter is always 1 in the Bernoulli distribution. This effectively prevents users from defining the numeric types for such a distribution with the constructor and requires them to explicitly define the type on the variable, leading to verbose declarations such as let n: Result<Bernoulli<f64, u64>> = Bernoulli::new(0.5). I'd like to find a way around this issue after 0.4.0 is released. (Or maybe before if a solution is found quick enough)

Support for multiple numeric types

Currently statrs only supports f64 but I'd like to at the minimum extend that to f32 and possibly other numeric types as well (especially for things in the statistics module). The num crate might be worth looking into but I'm hesistant about introducing the dependency when it might make it's way in to the standard library at some point.

Consolidate cdf error handling behavior

Some distributions panic:

  • Beta
  • Chi
  • ChiSquared
  • Gamma
  • Exponential
  • Hypergeometric
  • InverseGamma (subject to gamma::gamma_ur, may also return NaN or 0, consider consolidating special function error handling as well)
  • LogNormal
  • Poisson
  • StudentsT (subject to beta::beta_reg, unchecked if freedom is +inf)
  • Weibull

Some distributions return 0 or 1:

  • Binomial
  • Bernoulli
  • DiscreteUniform
  • Triangular
  • Uniform

Some distributions return NaN:

  • FisherSnedecor (check construction args as well)

No error handling defined:

  • Cauchy
  • Geometric
  • Normal

My gut reaction is to panic on all invalid input domains for cdf and possibly special functions as well. The other options are to move towards propagating NaN or returning Result<T, StatsError> for functions like cdf, pdf, pmf, ln_pdf, and ln_pmf (possibly including special functions).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.