tag:blogger.com,1999:blog-5952320191615496730.post8136500099638443691..comments2026-04-16T08:33:01.906+01:00Comments on The Beginner Programmer: Copulalib: How to use copulas in PythonMichttp://www.blogger.com/profile/18151225177833588981noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-5952320191615496730.post-65058697868558057132022-10-02T05:33:01.528+01:002022-10-02T05:33:01.528+01:00Thanks for pointing the bug and solution. I have u...Thanks for pointing the bug and solution. I have updated the package in pip.Sat Kumar Tomerhttps://www.blogger.com/profile/12179791862848600443noreply@blogger.comtag:blogger.com,1999:blog-5952320191615496730.post-91243143338243210002021-11-30T09:18:11.115+00:002021-11-30T09:18:11.115+00:00Btw, I'm Andrea. Nice to talk to you. :-)Btw, I'm Andrea. Nice to talk to you. :-)Anonymoushttps://www.blogger.com/profile/03057065956106912926noreply@blogger.comtag:blogger.com,1999:blog-5952320191615496730.post-34009538644677993062021-11-30T09:17:15.989+00:002021-11-30T09:17:15.989+00:00Thank you very much for this post. If I got correc...Thank you very much for this post. If I got correct here the intention is to create a dependence structure for U and V. The support of the numbers is 0,1. Inverting the random numbers using the desire analytical distribution should return a multivariate distribution. So let's suppose X and Y are lognormal, if I got correct I should invert respectively the distribution in U and V to get the multivariate. I tried to call generate_xy (not used in the code above but included in the library) but I'm getting back that the module 'statistics' has no attribute 'cpdf'. Btw, if I got correct, generate_xy is using a Kernel approach that can be replaced by the logic I explained above (inverting U and V using the lognormal). Could you please help me to understand if what above is correct?Anonymoushttps://www.blogger.com/profile/03057065956106912926noreply@blogger.comtag:blogger.com,1999:blog-5952320191615496730.post-89200066255014912952021-03-24T10:04:58.671+00:002021-03-24T10:04:58.671+00:00thank you very useful post.
I think the error men...thank you very useful post.<br /><br />I think the error mentioned in the post, related to the large size of x and y is due to the line 58 of copulalib.py. There is a conditional statement, comparing the sizes of X and Y, by using is not, instead of using !=. The is not operator is checking if the sizes are not the same object, rather then check if they have not the same value.<br />to avoid the error you can modify the following code in the copulalib.py (line 58): <br /><br />before:<br /> <br /> # input array should have same zie<br /> if X.size is not Y.size:<br /> raise ValueError('The size of both array should be same.')<br /><br /> # input array should have same zie<br /> if X.size != Y.size:<br /> raise ValueError('The size of both array should be same.')<br /><br />Grateful,<br />Lucaluca pizzimbonehttps://www.blogger.com/profile/09472929517298050976noreply@blogger.comtag:blogger.com,1999:blog-5952320191615496730.post-63438743329353453142019-11-02T03:49:22.934+00:002019-11-02T03:49:22.934+00:00Thank you!! I was looking just for this :)
Thank you!! I was looking just for this :)<br />pb05https://www.blogger.com/profile/00606420296342090594noreply@blogger.comtag:blogger.com,1999:blog-5952320191615496730.post-83000519057493578052019-09-02T11:00:18.396+01:002019-09-02T11:00:18.396+01:00I am also wandering why the fitting procedure is t...I am also wandering why the fitting procedure is taking the raw data values directly. Have you got any answer. <br /><br />Anonymoushttps://www.blogger.com/profile/16030043824248302999noreply@blogger.comtag:blogger.com,1999:blog-5952320191615496730.post-16332223100997937292017-01-03T03:02:18.681+00:002017-01-03T03:02:18.681+00:00Thanks for the nice post. I am also trying to move...Thanks for the nice post. I am also trying to move my R copula script to Python.<br /><br /><br />I agree that the current copulalib is quite limited, and I think that size greater than 300 problem is a bug.<br /><br />Also wonder why the fitting procedure is not taking U and V values in [0,1] and instead taking raw data values. Suppose I have X and Y raw data and fitted in certain (but different) distributions that I preferred, I would want to use my own set of Us and Vs to fit the copula.<br />Short Ivory Towerhttps://www.blogger.com/profile/00686576536783783528noreply@blogger.com