From 8cb2634ec36093962138d9b34389f75d1d675c9e Mon Sep 17 00:00:00 2001 From: Tyler Date: Wed, 29 Nov 2023 00:58:11 +0000 Subject: [PATCH] adding to docs --- docs/source/Multivariate.rst | 39 +++++++++++++++++++ docs/source/Univariate.rst | 3 +- .../multivariate_example.py | 8 ++-- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/docs/source/Multivariate.rst b/docs/source/Multivariate.rst index debcc34..e92e315 100644 --- a/docs/source/Multivariate.rst +++ b/docs/source/Multivariate.rst @@ -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.:: diff --git a/docs/source/Univariate.rst b/docs/source/Univariate.rst index a630ae5..e92c88b 100644 --- a/docs/source/Univariate.rst +++ b/docs/source/Univariate.rst @@ -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) diff --git a/examples/multivariate_examples/multivariate_example.py b/examples/multivariate_examples/multivariate_example.py index 60fcd15..ad6b928 100644 --- a/examples/multivariate_examples/multivariate_example.py +++ b/examples/multivariate_examples/multivariate_example.py @@ -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)