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 97a121e commit 8cb2634
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
39 changes: 39 additions & 0 deletions docs/source/Multivariate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,45 @@ Currently, the following multivariate distributions are implemented:
:file: mvt_table.csv
:header-rows: 1

PreFitContinuousMultivariate
----------------------------
This is the base class for all multivariate distributions. It implements the following methods and attributes:

- logpdf (log of the probability density function)
- pdf (probability density function)
- cdf (cumulative density function)
- mc_cdf (Monte Carlo approximation of the cumulative density function)
- rvs (random variate generator / sampler)
- likelihood (likelihood function)
- loglikelihood (log of the likelihood function)
- aic (Akaike Information Criterion)
- bic (Bayesian Information Criterion)
- marginal_pairplot (pairplot of the marginal distributions)
- pdf_plot (plot of the probability density function)
- cdf_plot (plot of the cumulative density function)
- mc_cdf_plot (plot of the Monte Carlo approximation of the cumulative density function)
- num_params (The number of parameters in the distribution)
- 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 density 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.

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.

FittedContinuousMultivariate
----------------------------
This class is the fitted version of PreFitContinuousMultivariate's subclasses.
It implements the same methods as PreFitContinuousMultivariate, but does not require params as an argument.
It also implements the following additional methods and attributes:

- params (the fitted parameters)
- num_variables (the number of variables the distribution is fitted too)
- fitted_num_data_points (the number of observations used to fit the distribution)
- converged (whether the fitting algorithm converged)
- summary (a summary of the fitted distribution)
- save (save the fitted distribution object)

Multivariate Example
---------------------
Here we use the multivariate normal and multivariate symmetric hyperbolic distributions, though all methods and attributes are generalized.::
Expand Down
3 changes: 2 additions & 1 deletion docs/source/Univariate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ ppf_approx and cdf_approx are approximations of the ppf and cdf functions respec
FittedUnivariateBase
---------------------
This class is the fitted version of PreFitUnivariateBase's subclasses.
It implements the same methods as PreFitUnivariateBase, but does not require params as an argument in addition to the following:
It implements the same methods as PreFitUnivariateBase, but does not require params as an argument.
It also implements the following additional methods and attributes:

- summary (summary of the distribution fit)
- params (the fitted parameters)
Expand Down
8 changes: 4 additions & 4 deletions examples/multivariate_examples/multivariate_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
fitted_msh = mvt_shyperbolic.fit(rvs_df, method='mle', show_progress=True)

# printing our fitted parameters
# print(fitted_msh.params.to_dict)
# print(fitted_msh.params.cov)
print(fitted_msh.params.to_dict)
print(fitted_msh.params.cov)

# printing a summary of our fit
# print(fitted_msh.summary)
#
print(fitted_msh.summary)

# # can plot
fitted_msh.pdf_plot(show=False)
fitted_msh.mc_cdf_plot(show=False)
Expand Down

0 comments on commit 8cb2634

Please sign in to comment.