Giter Club home page Giter Club logo

rvinecopulib's Introduction

rvinecopulib

R build status Coverage Status CRAN version CRAN downloads

Vine copulas are a flexible class of dependence models consisting of bivariate building blocks (see e.g., Aas et al., 2009). You can find a comprehensive list of publications and other materials on vine-copula.org.

This package is the R API to the C++ library vinecopulib, a header-only C++ library for vine copula models based on Boost and Eigen.

It provides high-performance implementations of the core features of the popular VineCopula R library, in particular inference algorithms for both vine copula and bivariate copula models. Advantages over VineCopula are

  • a sleaker and more modern API,
  • shorter runtimes, especially in high dimensions,
  • nonparametric and multi-parameter families,
  • ability to model discrete variables.

As VineCopula, the package is primarily made for the statistical analysis of vine copula models. The package includes tools for parameter estimation, model selection, simulation, and visualization. Tools for estimation, selection and exploratory data analysis of bivariate copula models are also provided. Please see the API documentation for a detailed description of all functions.

Table of contents


How to install

You can install:

  • the stable release on CRAN:

    install.packages("rvinecopulib")
  • the latest development version:

    remotes::install_github("vinecopulib/rvinecopulib")

Package overview

Below, we list most functions and features you should know about. As usual in copula models, data are assumed to be serially independent and lie in the unit hypercube.

Bivariate copula modeling: bicop_dist and bicop

  • bicop_dist: Creates a bivariate copula by specifying the family, rotation and parameters. Returns an object of class bicop_dist. The class has the following methods:

    • print: a brief overview of the bivariate copula.

    • plot, contour: surface/perspective and contour plots of the copula density. Possibly coupled with standard normal margins (default for contour).

  • dbicop, pbicop, rbicop, hbicop: Density, distribution function, random generation and H-functions (with their inverses) for bivariate copula distributions. Additionally to the evaluation points, you can provide either family, rotation and parameter, or an object of class bicop_dist.

  • bicop: Estimates parameters of a bivariate copula. Estimation can be done by maximum likelihood (par_method = "mle") or inversion of the empirical Kendall's tau (par_method = "itau", only available for one-parameter families) for parametric families, and using local-likelihood approximations of order zero/one/two for nonparametric models (nonpar_method="constant"/nonpar_method="linear"/nonpar_method="quadratic"). If family_set is a vector of families, then the family is selected using selcrit="loglik", selcrit="aic" or selcrit="bic". The function returns an object of classes bicop and bicop_dist. The class bicop has the following following methods:

    • print: a more comprehensive overview of the bivariate copula model with fit statistics.

    • predict, fitted: predictions and fitted values for a bivariate copula model.

    • nobs, logLik, AIC, BIC: usual fit statistics.

Vine copula modeling: vinecop_dist and vinecop

  • vinecop_dist: Creates a vine copula by specifying a nested list of bicop_dist objects and a quadratic structure matrix. Returns an object of class vinecop_dist. The class has the following methods:

    • print, summary: a brief and more comprehensive overview of the vine copula.

    • plot: plots of the vine structure.

  • dvinecop, pvinecop, rvinecop: Density, distribution function, random generation for vine copula distributions.

  • vinecop: automated fitting for vine copula models. The function inherits the parameters of bicop. Optionally, a quadratic matrix can be used as input to pre-specify the vine structure. tree_crit describes the criterion for tree selection, one of "tau", "rho", "hoeffd" for Kendall's tau, Spearman's rho, and Hoeffding's D, respectively. Additionally, threshold allows to threshold the tree_crit and trunc_lvl to truncate the vine copula, with threshold_sel and trunc_lvl_sel to automatically select both parameters. The function returns an object of classes vinecop and vinecop_dist. The class has the vinecop has the following following methods:

    • print, summary: a brief and more comprehensive overview of the vine copula with additional fit statistics information.

    • predict, fitted: predictions and fitted values for a vine copula model.

    • nobs, logLik, AIC, BIC: usual fit statistics.

Bivariate copula families

In this package several bivariate copula families are included for bivariate and multivariate analysis using vine copulas. It provides functionality of elliptical (Gaussian and Student-t) as well as Archimedean (Clayton, Gumbel, Frank, Joe, BB1, BB6, BB7 and BB8) copulas to cover a large range of dependence patterns. For Archimedean copula families, rotated versions are included to cover negative dependence as well. Additionally, nonparametric families are also supported.

type name name in R
- Independence "indep"
Elliptical Gaussian "gaussian"
" Student t "t"
Archimedean Clayton "clayton"
" Gumbel "gumbel"
" Frank "frank"
" Joe "joe"
" Clayton-Gumbel (BB1) "bb1"
" Joe-Gumbel (BB6) "bb6"
" Joe-Clayton (BB7) "bb7"
" Joe-Frank (BB8) "bb8"
Nonparametric Transformation kernel "tll"

Note that several convenience vectors of families are included:

  • "all" contains all the families
  • "parametric" contains the parametric families (all except "tll")
  • "nonparametric" contains the nonparametric families ("indep" and "tll")
  • "one_par" contains the parametric families with a single parameter ("gaussian", "clayton", "gumbel", "frank", and "joe")
  • "two_par" contains the parametric families with two parameters ("t", "bb1", "bb6", "bb7", and "bb8")
  • "elliptical" contains the elliptical families
  • "archimedean" contains the archimedean families
  • "BB" contains the BB families
  • "itau" families for which estimation by Kendall's tau inversion is available ("indep","gaussian", "student","clayton", "gumbel", "frank", "joe")

The following table shows the parameter ranges of bivariate copula families with one or two parameters:

Copula family par[1] par[2]
Gaussian (-1, 1) -
Student t (-1, 1) (2,Inf)
Clayton (0, Inf) -
Gumbel [1, Inf) -
Frank R \ {0} -
Joe (1, Inf) -
Clayton-Gumbel (BB1) (0, Inf) [1, Inf)
Joe-Gumbel (BB6) [1 ,Inf) [1, Inf)
Joe-Clayton (BB7) [1, Inf) (0, Inf)
Joe-Frank (BB8) [1, Inf) (0, 1]

References

Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics 44 (2), 182-198.

rvinecopulib's People

Contributors

tnagler avatar tvatter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rvinecopulib's Issues

Release 0.3.0.1.0

  • seed
  • refactor rvine structures
  • num_threads for vinecop pdf/cdf/etc
  • improve doc (#116)
  • Bugs in vine class (#128)
  • Bug in vinecop class (#129)
  • keep_data = FALSE

Reference to mbicv

Damien made me notice that there is no reference to mbicv in the doc.

keep_data for both original and copula data in vine()

I don't think this makes sense anymore:

## to avoid saving copula data
keep_data <- copula_controls$keep_data
copula_controls$keep_data <- FALSE
        
## estimate the copula
vine$copula  <- do.call(vinecop, copula_controls)

## to potentially save the data on the standard scale
copula_controls$keep_data <- keep_data

There is no need to restrict the user's control over what data is kept.

Something wrong when passing a truncated structure

n <- 1e2
d <- 3
data <- matrix(runif(n*d), n, d)

struct <- rvine_matrix(matrix(c(1, 1, 1,2, 2, 0, 3, 0, 0), 3, 3, byrow = TRUE))
struct_trunc <- truncate_model(struct, 1)

cop <- vinecop(data, structure = struct)
cop_trunc <- vinecop(data, structure = struct_trunc)

rvinecop(n, cop)
rvinecop(n, cop_trunc)

print/summary bugs

  • summary.vinecop() with tll families
  • print.vinecop() for 0-truncated vines

Bug in vinecop class

# specify pair-copulas
bicop <- bicop_dist("bb1", 90, c(3, 2))
pcs <- list(
    list(bicop, bicop),  # pair-copulas in first tree 
    list(bicop)          # pair-copulas in second tree 
)

# specify R-vine matrix
mat <- matrix(c(1, 2, 3, 1, 2, 0, 1, 0, 0), 3, 3) 

# set up vine copula model
vc <- vinecop_dist(pcs, mat)

# simulate some data
u <- rvinecop(50, vc)

# estimate a vine copula model
fit <- vinecop(u, "par", trunc_lvl = 1)

# simulate from truncated model
rvinecop(50, fit)

# Error in vinecop_inverse_rosenblatt_cpp(U, vinecop) : 
#    size of pair_copulas[0] does not match dimension of matrix (3); expected size: 1, actual size: 2 

Coef generic

We should probably have coef generics to get the parameters of bicops and vinecops.

Cannot install v0.2.3.1.0 on macOS

Dear authors,

I have problem installing the latest version of rvinecopulib (v0.2.3.1.0). Below are the installation messages.

> devtools::install_github("vinecopulib/rvinecopulib")
Downloading GitHub repo vinecopulib/rvinecopulib@master
from URL https://api.github.com/repos/vinecopulib/rvinecopulib/zipball/master
Installing rvinecopulib
'/usr/local/Cellar/r/3.4.3/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore  \
  --quiet CMD INSTALL  \
  '/private/var/folders/ls/3nddvrtd1dl2m09ch7bn1rd80000gn/T/RtmpPpcAJa/devtools87383727f23a/vinecopulib-rvinecopulib-0a6617b'  \
  --library='/usr/local/lib/R/3.4/site-library' --install-tests 

* installing *source* package ‘rvinecopulib’ ...
** libs
clang++ -std=gnu++11 -I/usr/local/Cellar/r/3.4.3/lib/R/include -DNDEBUG -I../inst/include -pthread -I"/usr/local/lib/R/3.4/site-library/BH/include" -I"/usr/local/lib/R/3.4/site-library/Rcpp/include" -I"/usr/local/lib/R/3.4/site-library/RcppEigen/include" -I"/usr/local/lib/R/3.4/site-library/RcppThread/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include   -fPIC  -g -O2 -c RcppExports.cpp -o RcppExports.o
clang++ -std=gnu++11 -I/usr/local/Cellar/r/3.4.3/lib/R/include -DNDEBUG -I../inst/include -pthread -I"/usr/local/lib/R/3.4/site-library/BH/include" -I"/usr/local/lib/R/3.4/site-library/Rcpp/include" -I"/usr/local/lib/R/3.4/site-library/RcppEigen/include" -I"/usr/local/lib/R/3.4/site-library/RcppThread/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include   -fPIC  -g -O2 -c bicop_wrappers.cpp -o bicop_wrappers.o
clang++ -std=gnu++11 -I/usr/local/Cellar/r/3.4.3/lib/R/include -DNDEBUG -I../inst/include -pthread -I"/usr/local/lib/R/3.4/site-library/BH/include" -I"/usr/local/lib/R/3.4/site-library/Rcpp/include" -I"/usr/local/lib/R/3.4/site-library/RcppEigen/include" -I"/usr/local/lib/R/3.4/site-library/RcppThread/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include   -fPIC  -g -O2 -c vinecop_wrappers.cpp -o vinecop_wrappers.o
clang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -L/usr/local/Cellar/r/3.4.3/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o rvinecopulib.so RcppExports.o bicop_wrappers.o vinecop_wrappers.o -L/usr/local/Cellar/r/3.4.3/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
installing to /usr/local/lib/R/3.4/site-library/rvinecopulib/libs
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘rvinecopulib’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/3.4/site-library/rvinecopulib/libs/rvinecopulib.so':
  dlopen(/usr/local/lib/R/3.4/site-library/rvinecopulib/libs/rvinecopulib.so, 6): Symbol not found: __ZSt5Rcout
  Referenced from: /usr/local/lib/R/3.4/site-library/rvinecopulib/libs/rvinecopulib.so
  Expected in: flat namespace
 in /usr/local/lib/R/3.4/site-library/rvinecopulib/libs/rvinecopulib.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/3.4/site-library/rvinecopulib’
Installation failed: Command failed (1)

I can successfully install v0.2.0.1.0 using the following command, but not v0.2.2.1.0.
devtools::install_github("vinecopulib/[email protected]")

Below is some information about my computer

  • OS:
    System Version: macOS 10.13.2 (17C88)
    Kernel Version: Darwin 17.3.0
  • R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
  • Compiler:
    Apple LLVM version 9.0.0 (clang-900.0.39.2)
    Target: x86_64-apple-darwin17.3.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Could you please help? Thanks in advance.

Bo

bicop summary doesn't show AIC etc

We say "for mor information, fit model with keep_data = TRUE", but we don't need the data to compute the AIC etc (log-likelihood is always stored.

truncate_model docs need example

Since we're preparing a (rather) large new release, we should also make sure that all functionalities are properly documented/exemplified.

Evaluating copula density --> NaN and inaccuracies

Hello,
I got problems evaluating the copula density of vines. To be precise, it occurs that dvinecop returns a NaN. I wrote a small reproducible example:

ncol=30
nrow=10
set.seed(123)
data=matrix(rnorm(nrow*ncol),ncol=ncol)
vine=vinecop(pseudo_obs(data))
res=dvinecop(rep(0,ncol),vine)
print(res)

settingncol=20 or nrow=20 leads to result of 0 and not NaN. So this might be a problem for large p/small n-data. The dataset I am using and where this occured first is also a large p/small n dataset. But the result of exactly 0 is still not satisfactory because it is far away from the correct value 1 (the columns are independent) and it cancels the joint density aswell, since this is the product of copula density and marginal densities.

Many thanks in advance!

pbicop returning values > 1

In R:

u = matrix(c(0.5215358, 0.5762758,
0.1901277, 0.6213009,
0.6106837, 0.8506270,
0.2900435, 0.3769789,
0.3729131, 0.4309416,
0.6349203, 0.6944853), ncol = 2, byrow = TRUE)

pbicop(u, family='t', rotation = 0, parameters = c(0.920266, 6.295919))

[1] 0.8205036 0.3230017 1.0363803 0.4517086 0.5717643 1.0253078

D-vine and C-vine

It would be nice (and super easy) to create constructors for D/C-vine structures taking only an order vector as input.

Bugs in vine class

x <- replicate(3, rnorm(100))
colnames(x) <- c("a", "b", "c")

fit <- vine(x)
fit
#> 3-dimensional vine copula fit ('vinecop')
#> nobs = 100   logLik = 0   npars = 0   AIC = 0   BIC = 0   

should rather say vine distribution fit ('vine').

plot(fit$copula, var_names = "use")  # no variable names
fit$copula$names
#> NULL

Automatic Threshold selection without automatic truncation causes error

Hello,
I am using your package for my research and I have trouble using the automated threshold selection using the mbicv in the function vinecop.
Setting threshold = NA without setting trunc_lvl=NA aswell (this mean trunc_lvl=Inf) leads to several error messages like, bad_alloc,

invalid permissions

*** caught segfault ***
address 0x14df5c002000, cause 'invalid permissions'
Traceback:
1: vinecop_select_cpp(data = as.matrix(data), structure = structure,     family_set = family_set, par_method = par_method,  nonpar_method = nonpar_method,     mult = mult, selection_criterion = selcrit, weights = weights,     psi0 = psi0, preselect_families = presel, truncation_level = ifelse(is.finite(trunc_lvl),         trunc_lvl, .Machine$integer.max), tree_criterion = tree_crit,     threshold = threshold, select_truncation_level = is.na(trunc_lvl),     select_threshold = is.na(threshold), show_trace = show_trace,     num_threads = cores, var_types = var_types)
2: vinecop(pseudo_obs(dataset), selcrit = "mbicv", threshold = NA,     cores = available.cores())
An irrecoverable exception occurred. R is aborting now ...

or memory not mapped (same traceback as above)

*** caught segfault ***
address (nil), cause 'memory not mapped'

Unfortunately, I was not able to get the systematic behind these three error messages, since the error message differs sometimes even if the code is rerun without any changes. I wrote a little example using normal distributed data to illustrate the problem. The only way I was able to use the automatic threshold selection in this example was by setting trunc_lvl=NA aswell.

library(rvinecopulib)
library(parallel)

available.cores = function () {
  max(1, detectCores() - 1)
}

set.seed(12)
dataset <- matrix(ncol=10,rnorm(50*10,0,1))

copula = vinecop(pseudo_obs(dataset),
                 threshold = NA,
                 trunc_lvl = NA,    #comment this out for testing
                 show_trace = TRUE,
                 cores=available.cores())

Mysteriously, using the data given in https://github.com/mcwachter/rvinecopulib_Issue/blob/main/data.csv trunc_lvl=NA is not neccessary. So in general, using threshold=NA with trunc_lvl=Inf is possible. But for many other datasets I tried, it was the same as in the example with the normal distributed data.

Honestly, I have no clue where this comes from but I looked into the R source Code and noticed that in the vinecop function (https://github.com/vinecopulib/rvinecopulib/blob/master/R/vinecop.R) does not check in line 167 whether threshold is NA. Contrary, in line 161 truncation_lvl is set to the maximum Integer if trunc_lvl is NA, since is.finite(NA) is FALSE. So for trunc_lvl NA is not passed to C++ but for threshold this is the case. Maybe this causes the described behaviour.

Many thanks in advance!

-Wno-ignored-attributes

I just ran a check and I got compilation used the following non-portable flag(s): -Wno-ignored-attributes... Maybe we'll need to find an alternative solution for CRAN.

plot font size selection

Thank you so much for your excellent work.

When charting for multiple variables the edge label looks over-crowded and would like to shrink them. not yet doable by par(cex).
image

BTW, Is the output from plot function of ggraph class?
Wondering if we can have more compatible output like of igraph or NetworkX then we can modify the visualisation (layout & label font & edge color/line types/thickness) by ourselves.

Thanks a lot!

Compilation time

Vinecopulib is growing, and so does its compilation time. Furthermore, since it is header-only and rvinecopulib includes the library via three xyz_wrappers.cpp files, building rvinecopulib means compiling vinecopulib three times.

I see three solutions:

  1. Importing the non-header only version.
  2. Using a single wrapper file.
  3. Being "more careful" when including headers of vinecopulib in the wrappers (i.e., including only what's necessary rather than the full library).

1 and 2 are equivalent in term of raw performance. In terms of drawbacks: 1 would imply that other packages can't use LinkingTo (is it true though? if we just move the cpp files in src via the script and keep the headers as they are now?), while 2 would amount at using a large big messy file.

Now 3 is a way of keeping the header-only while being a bit cleaner than 2. However, we'll still build parts of vinecopulib several times.

Any thoughts?

rvine_structure(): storage/input order of struct_array

rvine_structure(order = c(5,2,4,1,3), 
                struct_array = list(c(1,4,2,5), c(4,2,5), c(2,5), 5),
                is_natural_order = FALSE)
#> 5-dimensional R-vine structure ('rvine_structure')
#> 5 1 2 3 5
#> 1 2 3 2  
#> 2 3 4    
#> 3 1      
#> 3 

does not print a valid R-vine matrix. This is related to some inconsistencies in rvine_structure():

  • so far there is no conversion to natural order before storage,
  • storage is column-wise, but input of rvine_structure() is row-wise and that's not accounted for in all cases.

My proposals:

  1. Expect column-wise input to rvine_structure() to keep things consistent. I agree that row-wise is more intuitive. But overall it's confusing unless we change storage order to row-wise, too (and that makes the wrappers quite messy).
  2. Set up the rvine_structure() objects in cpp. We do this for the checks anyway and just need to wrap the object back to an R list.
  3. Set is_natural_order = FALSE as default. I believe users will rarely want to specify the natural order version.
  4. The documentation should contain information on what the "natural order" is exactly.

Having vine additionally to vinecop

In the same spirit as there is the kdevine equivalent of kdevinecop while taking care of the margin and discrete variables automatically, we should have a vine additionally to vinecop, in order to be able to get density/distribution/random variables for distributions with arbitrary margins.

Next release

A collection of things we have to take care of:

  • new storage order of rvine structures
  • plotting rvine matrices
  • simulation of structures
  • joe's criterion for tree selection
  • discrete variables (additional effort for vine()/kde1d())
  • documentation for new features
  • examples for new features
  • final pull of cpp sources

Cannot install version 0.5.2.1.0 on Linux Iridis 5

Dear authors,

I have problem installing the latest version of rvinecopulib (version 0.5.2.1.0). Could you please kindly have a look at the error messages (shown below) for me. I have installed the essential packages, e.g. RcppEigen, Rcpp, BH, wdm, RcppThread, kde1d. I am using R version 3.5.2 ("Eggshell Igloo").

=============================================================

devtools::install_github("vinecopulib/[email protected]")
Downloading GitHub repo vinecopulib/[email protected]
v checking for file '/tmp/RtmpJo03YK/remotes4b10e252d27c4/vinecopulib-rvinecopulib-cf2cc69/DESCRIPTION' (1.3s)

  • preparing 'rvinecopulib':
    v checking DESCRIPTION meta-information ...
  • cleaning src
  • checking for LF line-endings in source and make files and shell scripts (339ms)
  • checking for empty or unneeded directories
    Removed empty directory 'rvinecopulib/.github'
  • building 'rvinecopulib_0.5.2.1.0.tar.gz'
    Warning: invalid uid value replaced by that for user 'nobody'

Installing package into '/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5'
(as 'lib' is unspecified)

  • installing source package 'rvinecopulib' ...
    ** libs
    g++ -std=gnu++11 -I"/local/software/R/3.5.2/lib64/R/include" -DNDEBUG -I../inst/include -pthread -I"/mainfs/local/software/R/3.5.2/lib64/R/library/BH/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/wdm/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/kde1d/include" -I/usr/local/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
    g++ -std=gnu++11 -I"/local/software/R/3.5.2/lib64/R/include" -DNDEBUG -I../inst/include -pthread -I"/mainfs/local/software/R/3.5.2/lib64/R/library/BH/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/wdm/include" -I"/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/kde1d/include" -I/usr/local/include -fpic -g -O2 -c vinecopulib-interface.cpp -o vinecopulib-interface.o
    In file included from /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread.h:11:0,
    from ../inst/include/vinecopulib/misc/tools_interface.hpp:15,
    from ../inst/include/vinecopulib/bicop/implementation/class.ipp:10,
    from ../inst/include/vinecopulib/bicop/class.hpp:157,
    from ../inst/include/vinecopulib.hpp:9,
    from ../inst/include/vinecopulib-wrappers.hpp:16,
    from vinecopulib-interface.cpp:1:
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/Thread.hpp: In lambda function:
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/Thread.hpp:42:19: error: parameter packs not expanded with '...':
    f(args...);
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/Thread.hpp:42:19: note: 'args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/Thread.hpp:42:23: error: expansion pattern 'args' contains no argument packs
    f(args...);
    ^
    In file included from /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread.h:13:0,
    from ../inst/include/vinecopulib/misc/tools_interface.hpp:15,
    from ../inst/include/vinecopulib/bicop/implementation/class.ipp:10,
    from ../inst/include/vinecopulib/bicop/class.hpp:157,
    from ../inst/include/vinecopulib.hpp:9,
    from ../inst/include/vinecopulib-wrappers.hpp:16,
    from vinecopulib-interface.cpp:1:
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In member function 'void RcppThread::ThreadPool::push(F&&, Args&& ...)':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:31: error: expected ',' before '...' token
    jobs_.emplace([f, args...] { f(args...); });
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:31: error: expected identifier before '...' token
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:34: error: parameter packs not expanded with '...':
    jobs_.emplace([f, args...] { f(args...); });
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:34: note: 'args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In lambda function:
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:44: error: expansion pattern 'args' contains no argument packs
    jobs_.emplace([f, args...] { f(args...); });
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In member function 'std::future<decltype (f(args ...))> RcppThread::ThreadPool::pushReturn(F&&, Args&& ...)':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:144:54: error: expected ',' before '...' token
    auto job = std::make_shared([&f, args...] {
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:144:54: error: expected identifier before '...' token
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:144:57: error: parameter packs not expanded with '...':
    auto job = std::make_shared([&f, args...] {
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:144:57: note: 'args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In lambda function:
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:145:22: error: expansion pattern 'args' contains no argument packs
    return f(args...);
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In instantiation of 'struct RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Bicop::select(const MatrixXd&, vinecopulib::FitControlsBicop)::__lambda64&; Args = {vinecopulib::Bicop&}]::__lambda56':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:9: required from 'void RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Bicop::select(const MatrixXd&, vinecopulib::FitControlsBicop)::__lambda64&; Args = {vinecopulib::Bicop&}]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:161:9: required from 'void RcppThread::ThreadPool::map(F&&, I&&) [with F = vinecopulib::Bicop::select(const MatrixXd&, vinecopulib::FitControlsBicop)::__lambda64&; I = std::vectorvinecopulib::Bicop&]'
    ../inst/include/vinecopulib/bicop/implementation/class.ipp:829:37: required from here
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:27: error: using invalid field 'RcppThread::ThreadPool::push(F&&, Args&& ...)::__lambda56::_args'
    jobs
    .emplace([f, args...] { f(args...); });
    ^
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In instantiation of 'struct RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::tools_select::VinecopSelector::add_allowed_edges(vinecopulib::tools_select::VineTree&)::__lambda65&; Args = {long unsigned int&}]::__lambda56':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:9: required from 'void RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::tools_select::VinecopSelector::add_allowed_edges(vinecopulib::tools_select::VineTree&)::__lambda65&; Args = {long unsigned int&}]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:161:9: required from 'void RcppThread::ThreadPool::map(F&&, I&&) [with F = vinecopulib::tools_select::VinecopSelector::add_allowed_edges(vinecopulib::tools_select::VineTree&)::__lambda65&; I = std::pair<boost::range_detail::integer_iterator, boost::range_detail::integer_iterator >]'
    ../inst/include/vinecopulib/vinecop/implementation/tools_select.ipp:401:51: required from here
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:27: error: using invalid field 'RcppThread::ThreadPool::push(F&&, Args&& ...)::__lambda56::__args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In instantiation of 'struct RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::tools_select::VinecopSelector::select_pair_copulas(vinecopulib::tools_select::VineTree&, const VineTree&)::__lambda66&; Args = {boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>&}]::__lambda56':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:9: required from 'void RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::tools_select::VinecopSelector::select_pair_copulas(vinecopulib::tools_select::VineTree&, const VineTree&)::__lambda66&; Args = {boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>&}]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:161:9: required from 'void RcppThread::ThreadPool::map(F&&, I&&) [with F = vinecopulib::tools_select::VinecopSelector::select_pair_copulas(vinecopulib::tools_select::VineTree&, const VineTree&)::__lambda66&; I = std::pair<boost::detail::undirected_edge_iter<std::_List_iterator<boost::list_edge<long unsigned int, boost::property<boost::edge_weight_t, double, vinecopulib::tools_select::EdgeProperties> > >, boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>, long int>, boost::detail::undirected_edge_iter<std::_List_iterator<boost::list_edge<long unsigned int, boost::property<boost::edge_weight_t, double, vinecopulib::tools_select::EdgeProperties> > >, boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>, long int> >]'
    ../inst/include/vinecopulib/vinecop/implementation/tools_select.ipp:1010:42: required from here
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:27: error: using invalid field 'RcppThread::ThreadPool::push(F&&, Args&& ...)::__lambda56::__args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In instantiation of 'struct RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Vinecop::pdf(Eigen::MatrixXd, size_t) const::__lambda67&; Args = {vinecopulib::tools_batch::Batch&}]::__lambda56':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:9: required from 'void RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Vinecop::pdf(Eigen::MatrixXd, size_t) const::__lambda67&; Args = {vinecopulib::tools_batch::Batch&}]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:161:9: required from 'void RcppThread::ThreadPool::map(F&&, I&&) [with F = vinecopulib::Vinecop::pdf(Eigen::MatrixXd, size_t) const::__lambda67&; I = std::vectorvinecopulib::tools_batch::Batch]'
    ../inst/include/vinecopulib/vinecop/implementation/class.ipp:826:74: required from here
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:27: error: using invalid field 'RcppThread::ThreadPool::push(F&&, Args&& ...)::__lambda56::__args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In instantiation of 'struct RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Vinecop::rosenblatt(const MatrixXd&, size_t) const::__lambda68&; Args = {vinecopulib::tools_batch::Batch&}]::__lambda56':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:9: required from 'void RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Vinecop::rosenblatt(const MatrixXd&, size_t) const::__lambda68&; Args = {vinecopulib::tools_batch::Batch&}]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:161:9: required from 'void RcppThread::ThreadPool::map(F&&, I&&) [with F = vinecopulib::Vinecop::rosenblatt(const MatrixXd&, size_t) const::__lambda68&; I = std::vectorvinecopulib::tools_batch::Batch]'
    ../inst/include/vinecopulib/vinecop/implementation/class.ipp:1079:67: required from here
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:27: error: using invalid field 'RcppThread::ThreadPool::push(F&&, Args&& ...)::__lambda56::__args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In instantiation of 'struct RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Vinecop::inverse_rosenblatt(const MatrixXd&, size_t) const::__lambda69&; Args = {vinecopulib::tools_batch::Batch&}]::__lambda56':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:9: required from 'void RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = vinecopulib::Vinecop::inverse_rosenblatt(const MatrixXd&, size_t) const::__lambda69&; Args = {vinecopulib::tools_batch::Batch&}]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:161:9: required from 'void RcppThread::ThreadPool::map(F&&, I&&) [with F = vinecopulib::Vinecop::inverse_rosenblatt(const MatrixXd&, size_t) const::__lambda69&; I = std::vectorvinecopulib::tools_batch::Batch]'
    ../inst/include/vinecopulib/vinecop/implementation/class.ipp:1196:67: required from here
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:27: error: using invalid field 'RcppThread::ThreadPool::push(F&&, Args&& ...)::__lambda56::__args'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp: In instantiation of 'struct RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = RcppThread::ThreadPool::parallelFor(ptrdiff_t, ptrdiff_t, F&&, size_t) [with F = fit_margins_cpp(const MatrixXd&, const VectorXi&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXi&, const VectorXd&, size_t)::__lambda84&; ptrdiff_t = long int; size_t = long unsigned int]::__lambda59&; Args = {const RcppThread::Batch&}]::__lambda56':
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:9: required from 'void RcppThread::ThreadPool::push(F&&, Args&& ...) [with F = RcppThread::ThreadPool::parallelFor(ptrdiff_t, ptrdiff_t, F&&, size_t) [with F = fit_margins_cpp(const MatrixXd&, const VectorXi&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXi&, const VectorXd&, size_t)::__lambda84&; ptrdiff_t = long int; size_t = long unsigned int]::__lambda59&; Args = {const RcppThread::Batch&}]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:199:9: required from 'void RcppThread::ThreadPool::parallelFor(ptrdiff_t, ptrdiff_t, F&&, size_t) [with F = fit_margins_cpp(const MatrixXd&, const VectorXi&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXi&, const VectorXd&, size_t)::__lambda84&; ptrdiff_t = long int; size_t = long unsigned int]'
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/parallelFor.hpp:48:5: required from 'void RcppThread::parallelFor(ptrdiff_t, ptrdiff_t, F&&, size_t, size_t) [with F = fit_margins_cpp(const MatrixXd&, const VectorXi&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXd&, const VectorXi&, const VectorXd&, size_t)::__lambda84; ptrdiff_t = long int; size_t = long unsigned int]'
    vinecopulib-interface.cpp:310:38: required from here
    /mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/RcppThread/include/RcppThread/ThreadPool.hpp:127:27: error: using invalid field 'RcppThread::ThreadPool::push(F&&, Args&& ...)::__lambda56::__args'
    make: *** [vinecopulib-interface.o] Error 1
    ERROR: compilation failed for package 'rvinecopulib'
  • removing '/mainfs/home/sw2d16/R/x86_64-pc-linux-gnu-library/3.5/rvinecopulib'
    Error: Failed to install 'rvinecopulib' from GitHub:
    (converted from warning) installation of package '/tmp/RtmpJo03YK/file4b10e46ca3b1a/rvinecopulib_0.5.2.1.0.tar.gz' had non-zero exit status

=============================================================
Thank you so much in advance for your help.

Suttisak

Unexpected behaviour of vinecop()

Hi! I've been working with your package, and have come across an issue. Sometimes when I estimate a model using the vinecop() function, some of the variable type pairs encoded in each bicop() object, are in the wrong order. If I refit the model using the structure found in the first instance, all of the variable type pairs seem to be in the right order. Since all the pair copulas have the same rotations and parameters, in both cases, I assume that the issue is just the label in the bicop() object, see example below.


# Compile data
x <- cbind(MASS::Boston[, c(4, 1, 6, 7)], discr_medv=1*(MASS::Boston[, 14] > 20))
x_type <- apply(x, 2, 
                function(z) switch (1 + (length(unique(z)) > 2),
                                    "d",
                                    "c"))

names(x_type) <- c()

margins <- apply(x, 2, ecdf)
u <- cbind(sapply(1:ncol(x), function(j) margins[[j]](x[, j])
                  * nrow(x)/(nrow(x) + 1)),
           sapply(which(x_type=="d"),
                  function(j) margins[[j]](x[, j] - 0.0000001)
                  * nrow(x)/(nrow(x) + 1)))


# fit model
model_x <- rvinecopulib::vinecop(u, x_type, family_set = c("gaussian", "clayton", "gumbel"))
model_mat <- rvinecopulib::as_rvine_matrix(model_x$structure)

# Compile a vector that lists the variable types of the margins in each copula
actual_var_types <- rbind(t(sapply(1:(5 - 1),
                                   function(e) x_type[model_mat[c(5 + 1 - e, 1),
                                                                e]])),
                          t(sapply(1:(5 - 2),
                                   function(e) x_type[model_mat[c(5 + 1 - e, 2),
                                                                e]])),
                          t(sapply(1:(5 - 3),
                                   function(e) x_type[model_mat[c(5 + 1 - e, 3),
                                                                e]])),
                          t(sapply(1:(5 - 4),
                                   function(e) x_type[model_mat[c(5 + 1 - e, 4),
                                                                e]])))
e]])))
summ <- summary(model_x)
summ$act_var_type <- apply(actual_var_types, 1,
                           function(x) paste(x, collapse=","))
summ <- summ[, c(1:5, 12, 6:11)]

summ

# Output: 
#   # A data.frame: 10 x 12 
#   tree edge conditioned conditioning var_types act_var_type   family rotation parameters df    tau loglik
#   1    1        3, 5                    d,c          c,d   gumbel        0        1.8  1  0.444  69.21
#   1    2        2, 4                    c,c          c,c gaussian        0       0.59  1  0.402 132.61
#   1    3        1, 5                    d,d          d,d   gumbel        0        1.2  1  0.169   3.39
#   1    4        4, 5                    d,c          c,d   gumbel       90        1.9  1 -0.469  84.37
#   2    1        3, 1            5       c,d          c,d   gumbel        0          1  1  0.028   0.42
#   2    2        2, 5            4       d,c          c,d gaussian        0      -0.34  1 -0.220  13.18
#   2    3        1, 4            5       c,d          d,c gaussian        0        0.2  1  0.128   3.59
#   3    1        3, 4         1, 5       c,c          c,c  clayton      270       0.12  1 -0.057   9.08
#   3    2        2, 1         5, 4       d,c          c,d  clayton        0       0.31  1  0.134   1.07
#   4    1        3, 2      4, 1, 5       c,c          c,c  clayton      270       0.21  1 -0.097   6.23

# Refit, but provide the structure as the one estimated the first time,
# and print summary (Now the variable types switches)
summary(vinecop(u, x_type, structure = model_x$structure,
                family_set = c("gaussian", "clayton", "gumbel")))

# Output:
#  # A data.frame: 10 x 11 
#  tree edge conditioned conditioning var_types   family rotation parameters df    tau loglik
#  1    1        3, 5                    c,d   gumbel        0        1.8  1  0.444  69.21
#  1    2        2, 4                    c,c gaussian        0       0.59  1  0.402 132.61
#  1    3        1, 5                    d,d   gumbel        0        1.2  1  0.169   3.39
#  1    4        4, 5                    c,d   gumbel       90        1.9  1 -0.469  84.37
#  2    1        3, 1            5       c,d   gumbel        0          1  1  0.028   0.42
#  2    2        2, 5            4       c,d gaussian        0      -0.34  1 -0.220  13.18
#  2    3        1, 4            5       d,c gaussian        0        0.2  1  0.128   3.59
#  3    1        3, 4         1, 5       c,c  clayton      270       0.12  1 -0.057   9.08
#  3    2        2, 1         5, 4       c,d  clayton        0       0.31  1  0.134   1.07
#  4    1        3, 2      4, 1, 5       c,c  clayton      270       0.21  1 -0.097   6.23

Misleading error message in vinecop_dist()

Misleading error message (pcs and structure have incompatible dimension):

> library(rvinecopulib)
> u <- replicate(20, runif(100))
> cop <- vinecop(u, family = "indep")
> pcs <- lapply(1:20, function(i) lapply(1:(20 - i), function(j) bicop_dist("gauss", 0, 0.2)))
> 
> model <- vinecop_dist(pcs, cop$structure)
 Error: trunc_lvl should be a number between 1 and the number of trees (19). 

Speed issue

We have an issue with tll families:

rm(list = ls())
library(kdecopula)
library(rvinecopulib)

n <- 1e3
u <- matrix(runif(2*n), n, 2)

methods <- list(
    rvcl = function(x) 
        bicop(x, family_set = "tll", nonpar_method = "quadratic"),
    kdec = function(x) kdecop(x, method = "TLL2"))

sampling <- list(rbicop, rkdecop)

mapply(function(f, s) {
    t_fit <- system.time(fit <- f(u))[3]
    t_sim <- system.time(sim <- s(n, fit))[3]
    res <- c(t_fit, t_sim)
    names(res) <- c("fit [s]", "sim [s]")
    res
    }, methods, sampling)

screen shot 2018-06-14 at 15 37 23

remove unique_ptr to ThreadPool

The internal ThreadPool can be constructed using an initializer list in StructureSelector constructor, no need for the pointer.

Code coverage

For some reason, we did not send reports to codecov for more than a year. We should improve the current status (85%) a bit.

wrappers.cpp is a mess

... but I'm not sure what could be done about it without a huge increase in compilation time.

Error when running vine()

When running test=vine(df, copula_controls = list(family_set = "nonparametric"))

where df is a dataframe with 3 numerical columns without NA or Inf values gives the following error:

Error in fit_kde1d_cpp(x, bw, xmin, xmax, deg) :
Error in function boost::math::pdf(const normal_distribution&, double): Random variate x is nan, but must be finite!

Getters for PCCs

We should add the getters for PCCs (like get_pair_copula , get_all_pair_copulas and get_matrix).

Documentation wrong for bicop_dist Student t Distribution

Hello,
this is just a documentation error but to avoid confusion I wanted to notify you about this issue. In the documentation of bicop_dist the Student t family is said to be implemented with "student" but

bicop_dist("student", 0,c(0.5,2))

returns an family not implemented error. Instead, "t" works:

bicop_dist("t", 0,c(0.5,2))

Many thanks for that great package!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.