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

C-vine pdf #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

C-vine pdf #23

wants to merge 5 commits into from

Conversation

wgurecky
Copy link
Owner

@wgurecky wgurecky commented Aug 19, 2019

  • New c-vine pdf and cdf routines.
  • C-vine PDF is from "Dependence Modeling with Copulas" by Harry Joe, 2015. Pg. 113.
  • No closed form cdf exists for a vine-copula. Integration is performed by quadpy (https://github.com/nschloe/quadpy), a quadrature package.

@coveralls
Copy link

coveralls commented Aug 19, 2019

Coverage Status

Coverage increased (+0.3%) to 79.856% when pulling f3d00a0 on cvine_pdf_cdf into ac46fb8 on master.

j += 1

dim = len(x.columns)
scheme = quadpy.ncube.stroud_cn_5_9(dim)
Copy link
Owner Author

@wgurecky wgurecky Oct 10, 2019

Choose a reason for hiding this comment

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

probably best to rework this. Unfortunately this can become extremely expensive in higher dimensions. Split hypercube up into chunks, then integrate pdf over each chunk. Try scipy.spatial.Delaunay to chop up integration domain, then use quadpy to perform the integration on each chunk.

Comment on lines 94 to 101
tstX['1a'] = [0.01, 0.4, 0.5, 0.6, 0.99, 0.999]
tstX['2b'] = [0.01, 0.4, 0.5, 0.6, 0.99, 0.999]
tstX['3c'] = [0.01, 0.4, 0.5, 0.6, 0.99, 0.999]
tstX['4d'] = [0.01, 0.4, 0.5, 0.6, 0.99, 0.999]
tstX['5e'] = [0.01, 0.4, 0.5, 0.6, 0.99, 0.999]
pdf_at_tstX = tstVine.vinePdf(tstX)
print(pdf_at_tstX)
self.assertTrue(np.all(pdf_at_tstX > 0.0))
Copy link
Owner Author

Choose a reason for hiding this comment

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

only check pdf on diagonal?

self.assertTrue(np.all(pdf_at_tstX > 0.0))

# check vine cdf values
cdf_at_tstX = tstVine.vineCdf(tstX)
Copy link
Owner Author

@wgurecky wgurecky Oct 10, 2019

Choose a reason for hiding this comment

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

same with CDF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants