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

Add an itau argument to BiCopSelect, RVineCopSelect and RVineStructureSelect #25

Merged
merged 4 commits into from Nov 18, 2016

Conversation

tvatter
Copy link
Contributor

@tvatter tvatter commented Nov 17, 2016

To implement this, I suggest the following:

  • preprocessors: add check_twoparams
  • BiCopSelect, RVineCopSelect, RVineStructureSelect: add a method argument (default method = "mle”) => only affects the one-parameter families… taken care of by adding check_twoparams to the preproc
  • fit.ACopula: add a method argument (default method = “mle”)
  • fit.FirstTreeCopulas and fit.TreeCopulas: add a method argument (default method = “mle”)

You can compare the speed of using itau instead of mle using the examples from RVineCopSelect/RVineStructureSelect:

system.time(RVM <- RVineStructureSelect(daxreturns, c(1,3:6)))
system.time(RVM <- RVineStructureSelect(daxreturns, c(1:6), method = "itau"))
system.time(RVM <- RVineStructureSelect(daxreturns, c(1, 3:6), method = "itau"))

system.time(RVM1 <- RVineCopSelect(simdata, familyset = c(1, 3, 4, 5 ,6), Matrix))
system.time(RVM1 <- RVineCopSelect(simdata, familyset = c(1:6), Matrix, method = "itau"))
system.time(RVM1 <- RVineCopSelect(simdata, familyset = c(1, 3, 4, 5 ,6), Matrix, method = "itau"))

Note that it generates a warning (as expected) when method = "itau" and familyset = 1:6.

As an additional suggestion, in RVineStructureSelect/fit.ACopula, it's probably not worth calling BiCopSelect and BiCopHfunc1/2 when familyset == 0.

@tnagler tnagler merged commit 0b33011 into tnagler:master Nov 18, 2016
@tnagler
Copy link
Owner

tnagler commented Nov 18, 2016

Thanks a lot!

@tnagler
Copy link
Owner

tnagler commented Nov 18, 2016

Given its importance in financial applications, I also added support for the t-copula (see fc4451b). In this case par2 is considered to be fixed with value 5.

Here are some timings on my machine:

library("VineCopula")
data("daxreturns")

system.time(RVM <- RVineStructureSelect(daxreturns, 1:6))
#>    user  system elapsed 
#> 118.232   0.000 118.091 
system.time(RVM <- RVineStructureSelect(daxreturns, 1:6, method = "itau"))
#>    user  system elapsed 
#>   3.976   0.000   3.979 

system.time(RVM1 <- RVineCopSelect(daxreturns, familyset = 1:6, RVM$Matrix))
#>    user  system elapsed 
#> 119.076   0.508 119.548 
system.time(RVM1 <- RVineCopSelect(daxreturns, familyset = 1:6, RVM$Matrix, method = "itau"))
#>    user  system elapsed 
#>   3.576   0.004   3.573 

This is awesome!

@tnagler
Copy link
Owner

tnagler commented Nov 18, 2016

I added a little more flexible by using profile likelihood for par2 instead of keeping it fixed (344fe92). New timings:

system.time(RVM <- RVineStructureSelect(daxreturns, 1:6, method = "itau"))
#>    user  system elapsed 
#>   11.756   0.112  11.875
system.time(RVM <- RVineStructureSelect(daxreturns, c(1, 3:6), method = "itau"))
#>    user  system elapsed 
#>   2.816   0.020   2.830

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.

None yet

2 participants