Copulas icon indicating copy to clipboard operation
Copulas copied to clipboard

vine copulas

Open noonsad opened this issue 3 years ago • 3 comments

Problem description

I have a question regarding vine copulas. I'm using a made-up dataset to test it, and the issue is when I run the lines: copula = copulas.multivariate.vine.VineCopula(data) copula.fit(data)

I get this error: ValueError: Invalid tree type

What I already tried

I tried the default data set in the example as well, and the same error appears. I also tried this line: copulas.multivariate.VineCopula(data). It gives another error, and needs another argument called X.

noonsad avatar Jun 14 '23 11:06 noonsad

Maybe you can try: copula = copulas.multivariate.vine.VineCopula('regular') copula.fit(data)

The vine copula document: https://sdv.dev/Copulas/tutorials/03_Multivariate_Distributions.html#Vine-Copulas

DILIU899 avatar Jul 04 '23 07:07 DILIU899

Hi @noonsad, I think @DILIU899 is correct.

I also referenced the API docs. When you instantiate a VineCopula, the first argument should be the vine type -- which a string of either 'regular', 'center' or 'direct'.

I'm closing the issue off since this seems to solve the error. Please feel free to reply if you continue to notice any crashes and we can reopen to investigate.

npatki avatar Jul 17 '23 23:07 npatki

@DILIU899 and @npatki thanks for the response guys! you're right. I have tried this and it works:

from copulas.multivariate import VineCopula copula = VineCopula('center') #center is the type, 'regular' and 'direct' are also available. copula.fit(data)

noonsad avatar Jul 22 '23 11:07 noonsad