This report summarizes the work done in my GSoC 2019 project, Enhancement of Statistics Module wth SymPy. My mentors were, Francesco Bonazzi and Sidhant Nagpal. Blog post with step by step development of the project is avaiable at ritesh99rakesh.github.com.
I am Ritesh Kumar, 4th year Computer Science and Engineering Student from Indian Institute of Technology Kanpur.
The project plan was focused on the following areas of statistics that were required to be added to sympy.stats
.
- Community Bonding - I was supposed to add Inverse Gaussian, Levy, Non-central Beta, Beta-Binomial, Poisson binomial, Wishart, Inverse Wishart, Dirichlet, Inverted Dirichlet, Multivariate Pareto, Normal Inverse Gamma, Normal Inverse Wishart adn Normal Wishart distributions.
- Phase 1 - I was supposed to work on exporting expressions of RVs to external libraries like NumPy, SciPy and PyMC3, including it's API design and implementation.
- Phase 2 - I was expected to work on compound distributions including it's API design and implementation.
- Phase 3 - I planned to work on writing a wrapper for exporting RV to external libraries and Random Walk implementation.
This section describes the actual work done during the coding period in terms of PRs.
- Community Bonding
-
#16814 : This PR implemented
Inverse Normal
distribution insympy/stats/crv_types.py
. -
#16815 : This PR added
Beta-Binomial
distribution undersympy/stats/frv_types.py
. -
#16827 : This PR implemented
Non-central Beta
distribution undersympy/stats/crv_types.py
. -
#16843 : This PR enhances the function modules by implementing
Multivariate Gamma
function. Multivariate gamma is used inWishart
,Inverse Wishart
distributions andMatrix variate beta
distribution. The code is undersympy/functions/special/gamma_functions.py
. -
#16848 : This PR added
Log-logistic
distribution undersympy/stats/crv_types.py
.
- Phase 1
-
#16858 : This PR added test for
moment generating function
and missing checks incrv_types.py
. -
#16935 : This PR enchanced the RV function interface by implementing
Kurtosis
function undersympy/stats/rv_interface.py
. -
#16942 : This issue discusses the API design and implementation details for exporting expression of RVs to external libraries like NumPy, SciPy and PyMC3.
-
#17068 : This PR added
Log Normal
distributiontosympy/stats/crv_types.py
. -
#17070 : This PR added
Exponential Power distribution
undersympy/stats/crv_types.py
. -
#17076 : This PR enchanced continuous distribution by adding
Exponentially modified Gaussian distribution
undersympy/stats/crv_types.py
. -
#17077 : This PR added
Factorial Moment
function tosympy/stats/rv_interface.py
. -
#17099 : This PR implemented
Skellam distribution
undersympy/stats/drv_types.py
.
- Phase 2
-
#16970 : This PR added
PERT
distribution insympy/stats/crv_types.py
. -
#17004 : This PR enhances the function module by implementing the
Incomplete Beta
function undersympy/functions/special/beta_functions.py
. -
#17033 : This PR is to finalize the prototype of exporting RV to external libraries.
-
#17036 : This is one of the major PR for the project. In this PR, I conceptualized compound distributions by implementing
CompoundPSpace
andCompoundDistribution
. The code files includesympy/stats/compound_rv.py
. -
#17057 : This is one of the most difficult PR since it involved designing the API for sampling and intraction with external libraries. Refer to the comment. Implemented sample methods for continuous RV under
sympy/stats/crv_types.py
and added tests.
- Phase 3
-
#17197 : This issue discusses the API design and implementation details of Random Walk.
-
#17199 : This PR is related to refactoring
sympy/stats/joint_rv_types.py
. -
#17204 : This PR added
Wishart distribution
undersympy/stats/joint_rv_types.py
-
#17210 : This PR added
MultivariateNormal
andMultivariateLaplace
functions insympy/stats/joint_rv_types.py
. -
#17257 : This PR added sample methods using libraries like NumPy, SciPy and PyMC3 for Discrete RVs in
sympy/stats/drv_types.py
-
#17268 : This was enhancement related PR to allow symbolic parameters for Joint RVs in
sympy/stats/joint_rv_types.py
. -
#17445 : This PR added sample methods using libraries like NumPy, SciPy and PyMC3 for Finite RV in
sympy/stats/frv_types.py
.
This section contains some of my PRs related to miscellanous issues like, workflow improvement, etc.
-
#16820 : This was bug fix related PR to solve the issue with
Range
function insympy/sets/fancysets.py
. -
#16886 : This was bug fix related PR to correct morse code for 1 and add tests for morse code in
sympy/crypto/crypto.py
. -
#16888 : This PR added
powsimp
in_combine_inverse
undersympy/core/mul.py
and added corresponding tests. -
#17037 : This PR was related to change in
isqrt
function insympy/core/power.py
. -
#17239 : This was enchancement related PR to add relational operator printer for various languages in
sympy/printing
.
Some more work has to be done to complete the sampling from external libraries. Last part of Compound distribution is left which will be completed very soon. For long term future work, more compound distributions could be added by following the present implementation pattern.