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

[Bug] Frank Copula when parameter is negative #50

Closed
Tracked by #114
lidiamandre opened this issue Nov 4, 2023 · 7 comments
Closed
Tracked by #114

[Bug] Frank Copula when parameter is negative #50

lidiamandre opened this issue Nov 4, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@lidiamandre
Copy link

I was using this package for the first time as I need to simulate from some copulas in Julia rather than in R. The Frank copula is defined for all the real values but 0 but here it doesn't allow me to generate when my parameter is negative (and hence when I have negative dependence in the data), could this be fixed please, many thanks :)

A good addition to this package would be to have more Extreme Value copulas, such as the ones we can generate from the evd package in R

@lrnv
Copy link
Owner

lrnv commented Nov 4, 2023

Hey ! Thanks for reaching out !

Yes negatively correlated archimedean copulad is something I am currently working on, through the Williamson transforms. This will be fixed in the next few releases I still need to implement the right interface. This is the current proposal : #51 if you want to take a look.

@lrnv
Copy link
Owner

lrnv commented Nov 5, 2023

@lidiamandre Regarding extreme values copulas, I would really like to get some too. Do you have a reference that we could follow while implementing them ? You could propose a PR if you want I'll help you with it

@Santymax98
Copy link
Contributor

Santymax98 commented Nov 7, 2023

@lidiamandre, @lrnv You don't need this, since theorem 4.6.2 of Nelsen 2006 (also see corollary 4.6.3 and example 4.24) guarantees that, although the parameter of the Frank copula is defined for all reals except 0, the inverse generator is completely monotonic when the parameter is greater than zero. Otherwise this property is not satisfied and therefore the Frank copula cannot be an n-copula.

@lidiamandre
Copy link
Author

@lidiamandre Regarding extreme values copulas, I would really like to get some too. Do you have a reference that we could follow while implementing them ? You could propose a PR if you want I'll help you with it

@lrnv the vignette for the evd package in R is quite good for that actually, at least to get the CDFs. Under the bvevd function. Don't know more, sorry

@lrnv
Copy link
Owner

lrnv commented Nov 7, 2023

@Santymax98 I think that @lidiamandre want in fact the negatively dependent case (the case where the generator is not completely monotonous), which we currently do not have in the package. Same idea for the clayton copula: there should be the possibility to sample with a negative theta but unfortunately the current sampling algorithm (the frailty model) does not work in these cases.

@lidiamandre Thanks for the pointer.

@Santymax98 , @lidiamandre if one of you want to propose another sampling scheme for the negatively dependent archimdeans and/or the evd copulas, I'll gladly review it :)

@lrnv
Copy link
Owner

lrnv commented Nov 8, 2023

Hey @lidiamandre this should now be fixed in version 0.1.14 :) I finally implemented the full Williamson transformations shananigans:

  • You can now provide your own generator and the package can sample from the corresponding archimedean copula without any issues
  • We can now sample e.g. the ClaytonCopula with negative dependence structure in any dimension, while if i recall correctly, R::copula only does it for d=2 :)
  • The franck is now able to take any real parameter and works correctly.

would you mind checking if the new versions meets your expectations ? Then we may close this issue. I'll open anotherone for the extreme values stuff.

@lrnv lrnv added the bug Something isn't working label Nov 8, 2023
@lrnv
Copy link
Owner

lrnv commented Feb 5, 2024

I'll closed this as resolved now, feel free to re-open if you think it is necessary

@lrnv lrnv closed this as completed Feb 5, 2024
@lrnv lrnv mentioned this issue Feb 7, 2024
27 tasks
@lrnv lrnv changed the title Frank Copula when parameter is negative [Bug] Frank Copula when parameter is negative Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants