-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
C-vine pdf #23
Conversation
wgurecky
commented
Aug 19, 2019
•
edited
Loading
edited
- 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.
… uses quadrature in quadpy for integration
starvine/vine/C_vine.py
Outdated
j += 1 | ||
|
||
dim = len(x.columns) | ||
scheme = quadpy.ncube.stroud_cn_5_9(dim) |
There was a problem hiding this comment.
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.
tests/test_C_vine_construct.py
Outdated
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)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with CDF?