Skip to content

Commit

Permalink
adding to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tfm000 committed Nov 29, 2023
1 parent e12ae04 commit 43111af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions docs/source/Copulas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Unlike univariate distributions, these are not wrappers of scipy objects.
All implemented copula models are able to be fitted to both multivariate numpy and pandas data and contain easy saving and plotting methods.

An important concept to remember when using these models that they are composed of 2 overall parts:

1. The marginal distributions. These are univariate distributions of each random variable.
2. The copula distribution. This multivariate model captures the dependence structure between the variables.

The overall multivariate joint distribution is created by combining these two parts.
The overall multivariate joint distribution is created by combining these two parts,
which is handled by SklarPy's copula models.

Which copula models are implemented?
------------------------------------
Expand Down Expand Up @@ -208,7 +210,7 @@ Producing a pairplot of the marginals::

Copula Example
--------------
Here we use the generalized hyperbolic copula, though all methods and attributes are generalized.::
Here we use the generalized hyperbolic copula, though all methods and attributes are generalized::

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -270,7 +272,7 @@ Printing covariance parameters::
[[ 0.39404386 -0.18821382]
[-0.18821382 0.3928638 ]]
Printing a summargy of our joint fit::
Printing a summary of our joint fit::

print(fitted_copula.summary)

Expand Down
7 changes: 5 additions & 2 deletions docs/source/Multivariate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ This is the base class for all multivariate distributions. It implements the fol
- num_scalar_params (The number of scalar values across all parameters in the distribution)
- fit (fitting the distribution to data)

mc_cdf is a numerical approximation of the cumulative distribution function. This is usually necessary for distributions that do not have a closed form cumulative density function, as the numerical integration alternative is computationally expensive.
mc_cdf is a numerical approximation of the cumulative distribution function.
This is usually necessary for distributions that do not have a closed form cumulative distribution function,
as the numerical integration alternative is computationally expensive.

num_params is the number of parameter objects in the distribution, i.e. a vector / matrix is counted as 1.
num_scalar_params counts the number of unique scalar values across all parameter objects.
Expand All @@ -62,7 +64,8 @@ It also implements the following additional methods and attributes:

Multivariate Example
---------------------
Here we use the multivariate normal and multivariate symmetric hyperbolic distributions, though all methods and attributes are generalized.::
Here we use the multivariate normal and multivariate symmetric hyperbolic
distributions, though all methods and attributes are generalized::

import numpy as np
import pandas as pd
Expand Down
9 changes: 5 additions & 4 deletions docs/source/Univariate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you try::
from sklarpy.univariate import normal

You will likely find that your interpreter flags an error along the lines of "cannot find reference 'normal' in __init__.py".
Do not worry, this is to be expected an a side effect of the dynamic way SklarPy univariate distributions are created from scipy.stats distributions.
Do not worry, this is to be expected as a side effect of the dynamic way SklarPy univariate distributions are created from scipy.stats distributions.
At runtime, *your code will work without any errors*!

But how do I know which distributions are available?
Expand Down Expand Up @@ -50,7 +50,7 @@ PreFitUnivariateBase
This class and its subclasses contain the following methods / functions:

- pdf (probability density function)
- cdf (cumulative density function)
- cdf (cumulative distribution function)
- ppf (percent point function / cumulative inverse function)
- support
- ppf_approx (approximate ppf)
Expand All @@ -67,6 +67,7 @@ This class and its subclasses contain the following methods / functions:
- fit (fitting the distribution to data)

Many / all of these methods take params as an argument. This is a tuple containing the parameters of the associated scipy.stats distribution object.

ppf_approx and cdf_approx are approximations of the ppf and cdf functions respectively, which may be useful for distributions where the cdf and therefore ppf functions require numerical integration to evaluate.

FittedUnivariateBase
Expand Down Expand Up @@ -116,7 +117,7 @@ It also implements the following additional methods and attributes:

Continuous Example
---------------------
Here we use the normal and gamma distributions, though all methods and attributes are generalized.::
Here we use the normal and gamma distributions, though all methods and attributes are generalized::

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -274,7 +275,7 @@ We can then easily reload our saved model::

UnivariateFitter Example
-------------------------
Here we use the UnivariateFitter object to fit a distribution to a dataset.::
Here we use the UnivariateFitter object to fit a distribution to a dataset::

import numpy as np

Expand Down

0 comments on commit 43111af

Please sign in to comment.