GithubHelp home page GithubHelp logo

pycopula's People

Contributors

maximejumelle avatar nextkaufmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pycopula's Issues

Archimedian copula PDF for n>2

The pdf (method pdf_param) of Archimedian copulas seems to be incorrect if the dimension is 3 or higher, since I am getting negative and complex results.

I see that for n>2 a numeric differentiation with scipy is used.

BLAS Subroutines

Need to improve nearest Positive Definite Matrix function with BLAS subroutines.

Fitting Student Copula

(1001, 2)
Fitting Student copula.

UnboundLocalError Traceback (most recent call last)
in ()
7 cop = StudentCopula(dim=2)
8 print(X.shape)
----> 9 cop.fit(X, method='clme')
10
11 # Visualization of CDF and PDF

/usr/local/lib/python3.6/dist-packages/pycopula/copula.py in fit(self, X, method, df_fixed, verbose, **kwargs)
809 rho = fitted_params
810 else:
--> 811 nu = fitted_params[0]
812 rho = fitted_params[1:]
813

UnboundLocalError: local variable 'fitted_params' referenced before assignment

GaussianCopula and StudentCopula can't do MLE or IFM estimation

Hi, I'm curious that why GaussianCopula can't do with IFM estimation and StudentCopula can't do with MLE and IFM estimation.
I am very appreciate that you build up this package but just can't understand how it works?
Is there any detailed document?

Thanks

AttributeError: 'GaussianCopula' object has no attribute 'getDimension'

Hello!
I think there is some problems with freshness of documentation, because code from examples did not work. So, for example, I am trying to run this code: https://blent-ai.github.io/pycopula/build/html/examples.html#sampling
And I get the following errors:

---------------------------------------------------------------------------
TypeError                                 
Traceback (most recent call last)
<ipython-input-40-bb6934b931b1> in <module>()
----> 1 gaussian = GaussianCopula(dim=2, sigma=[[1, 0.8], [0.8, 1]])
 
TypeError: __init__() got an unexpected keyword argument 'sigma'

And after removing 'sigma' from arguments I've got a different error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-38-a14416189e8d> in <module>()
----> 1 sim = simulate(archimedean, 100)

/usr/local/lib/python3.5/dist-packages/pycopula/simulation.py in simulate(copula, n)
     19                 The size of the sample.
     20 	"""
---> 21         d = copula.getDimension()
     22 
     23         X = []

AttributeError: 'GaussianCopula' object has no attribute 'getDimension'

I'm using Python 3.5.2 and downloaded PyCopula using pip.
If you need any help, please, let me know.

Put plotting tools in visualization, rather than examples

Hi there, your package works well in Python 3.7.1 on Windows.

For plotting, instead of giving examples in the documentation page, perhaps put plotting tools inside the visualization module / library.

For instance,

def plot_copula_3d(copula,plot_type='pdf',subplot=None):
    """Plots a pycopula copula object's pdf or cdf.

        Usage: 
            plt.figure()
            plot_copula_3d(copula,'pdf')
            plt.figure()
            plt.subplot(2,1,1)
            plot_copula_3d(copula, 'pdf', (2,1,1))
            plt.subplot(2,1,2)
            plot_copula_3d(copula, 'cdf', (2,1,2))
            plt.show()
    """
    if subplot is None: ax = plt.gca(projection='3d')
    else: # Overwrites the entire figure with single plot
        fig = plt.gcf()
        ax = fig.add_subplot(*subplot,projection='3d')
    if plot_type=='pdf':
        u,v,C = pycopula.visualization.pdf_2d(copula)
    elif plot_type=='cdf':
        u,v,C = pycopula.visualization.cdf_2d(copula)
    X, Y = np.meshgrid(u,v)
    ax.plot_surface(X,Y,C)
    ax.plot_wireframe(X,Y,C,color='black',alpha=0.3)

Number of hyperparameters

start_vector = np.repeat(0, d + thetaOffset)

This gives an error if the number of hyperparameters that require estimation exceeds the number of dimensions (d). I think this might be an easy fix:

h=0
for dic in hyper_param:
h+=len(dic)

start_vector = np.repeat(1, h + thetaOffset)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.