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

Integration of copulas pdf not equal to 1. #322

Open
siddharthfcb opened this issue May 24, 2022 · 0 comments
Open

Integration of copulas pdf not equal to 1. #322

siddharthfcb opened this issue May 24, 2022 · 0 comments
Labels
question General question about the software under discussion Issue is currently being discussed

Comments

@siddharthfcb
Copy link

siddharthfcb commented May 24, 2022

Environment details

  • Copulas version: 0.7
  • Python version:3.8
  • Operating System: MacOS

Problem description

I was trying to fit a Gaussian Copula to a bivariate data. After fitting the bivariate copula. I tried integrating the pdf using MC integration, the integration is not equal to 1.

from copulas.datasets import sample_bivariate_age_income

data = sample_bivariate_age_income()
data.head()

from copulas.multivariate import GaussianMultivariate
# from copulas.multivariate import Vine

dist = GaussianMultivariate()
dist.fit(data)

N=1000000

XX=np.random.uniform(0, 100, N)
YY=np.random.uniform(0, 1000, N)
# ZZ=np.random.uniform(-5, 15, N)

# accum=np.sum(dist.pdf(np.transpose(np.array([XX,YY,ZZ]))))
accum=np.sum(dist.pdf(np.transpose(np.array([XX,YY]))))
measure = 100*1000
print(measure * accum/float(N))
@siddharthfcb siddharthfcb added under discussion Issue is currently being discussed question General question about the software labels May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General question about the software under discussion Issue is currently being discussed
Projects
None yet
Development

No branches or pull requests

1 participant