Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 27: Create truncnorm distribution #95

Merged
merged 22 commits into from
Apr 23, 2019

Conversation

ManuelAlvarezC
Copy link
Contributor

@ManuelAlvarezC ManuelAlvarezC commented Feb 27, 2019

This PR include the changes in order to add the truncnorm distribution from scipy:

  • Created a new class Univariate.base.ScipyWrapper, it allows to integrate any subclass of scipy.rv_continous by just providing the name of the class and a mapping of the name of its methods, it's based on copulas.univariate.kde that already wraps a distribution from scipy.
  • Implemented scalarize and vectorize decorators to help accept scalar values to vectorial methods and vice-versa.
  • Add the class copulas.univariate.TruncNorm.
  • Add a new implementation of GaussianKDE using the new ScipyWrapper class accepting and returning numpy.array, as requested on Make KDEUnivariate accept arrays as arguments. #85.
  • Make vines and Trees use the new class instead of the old one.
  • Add unittests for all the changes mentioned

Resolves #27, resolves #85, and resolves #90

if method_name is None:
method = getattr(self, name)
setattr(self, name, missing_method_scipy_wrapper(method))
method_names = [
Copy link
Contributor

@csala csala Apr 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be a class level attribute, self.METHOD_NAMES. It also should be a tuple (immutable)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, already changed.

@ManuelAlvarezC ManuelAlvarezC merged commit 821df61 into master Apr 23, 2019
@ManuelAlvarezC ManuelAlvarezC deleted the 27_truncnorm_univariate branch April 23, 2019 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants