Skip to content

Commit

Permalink
Release 0.5.2.1.0 (#211)
Browse files Browse the repository at this point in the history
* Better structures (#203)

* allow single integer construction of C/D-vines

* a few unit tests

* export plot.rvine_matrix

* unit tests for plot functions

* add `var_names = "hide"` option in plot.vinecop_dist()

* pass dots to plot.vinecop_dist()

* fix plot.vinecop_dist() docs

* fix tau->par for frank (#207)

* fix tau->par for frank

* update version and NEWS

* some typos and doc formatting (#208)

* switch to github actions (#204)

* switch to github actions

* what happened

* no idea

* do one check on R 3.5

* remove CRAN mirror on actions/linux

* try different shell for escaping issue

* escape one more?

* change CI badge

* Rcpp bug on macOS-3.5 RcppCore/Rcpp#1046

* same bug on macOS-3.6

* trigger

* use R 4.0

* pull current dev (#209)

* Prepare release (#210)

* bump version

* update NEWS

* cran comments

* update website
  • Loading branch information
tnagler authored May 7, 2020
1 parent 2fc5eb8 commit cf2cc69
Show file tree
Hide file tree
Showing 162 changed files with 2,803 additions and 2,159 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
\.dll$
^src/update_vinecopulib\.sh$
^docs$
.github/

69 changes: 69 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on: [push, pull_request]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- { os: windows-latest, r: '4.0', args: "--no-manual"}
- { os: macOS-latest, r: 'devel', args: "--no-manual"}
- { os: ubuntu-16.04, r: '3.6', args: "--no-manual" }
- { os: ubuntu-16.04, r: '4.0', args: "--no-manual" }

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}

steps:
- uses: actions/checkout@v1

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- uses: r-lib/actions/setup-tinytex@master
if: contains(matrix.config.args, 'no-manual') == false

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }}

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "install.packages('remotes')" -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: Rscript -e "install.packages('remotes')" -e "remotes::install_deps(dependencies = TRUE)" -e "remotes::install_cran('rcmdcheck')"

- name: Check
run: Rscript -e "rcmdcheck::rcmdcheck(args = '${{ matrix.config.args }}', error_on = 'warning', check_dir = 'check')"

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: Test coverage
if: matrix.config.os == 'macOS-latest' && matrix.config.r == '3.6'
run: |
Rscript -e 'remotes::install_github("r-lib/covr@gh-actions")'
Rscript -e 'covr::codecov(line_exclusion = list.files(recursive = TRUE)[grep("^(?!.*wrappers).*\\\.(hpp|h|cpp|c|ipp)$", list.files(recursive = TRUE), perl = TRUE)], token = "${{secrets.CODECOV_TOKEN}}")'
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rvinecopulib
Type: Package
Title: High Performance Algorithms for Vine Copula Modeling
Version: 0.5.1.1.0
Version: 0.5.2.1.0
Authors@R: c(
person("Thomas", "Nagler",, "[email protected]", role = c("aut", "cre")),
person("Thibault", "Vatter",, "[email protected]", role = c("aut"))
Expand All @@ -13,7 +13,7 @@ Description: Provides an interface to 'vinecopulib', a C++ library for vine
and more modern API, improved performances, especially in high dimensions,
nonparametric and multi-parameter families, and the ability to model discrete
variables. The 'rvinecopulib' package includes 'vinecopulib' as header-only
C++ library (currently version 0.5.1). Thus users do not need to install
C++ library (currently version 0.5.2). Thus users do not need to install
'vinecopulib' itself in order to use 'rvinecopulib'. Since their initial
releases, 'vinecopulib' is licensed under the MIT License, and 'rvinecopulib'
is licensed under the GNU GPL version 3.
Expand Down Expand Up @@ -45,4 +45,4 @@ LinkingTo:
BugReports: https://github.com/vinecopulib/rvinecopulib/issues
Roxygen: list(markdown = TRUE)
SystemRequirements: C++11
RoxygenNote: 7.0.0
RoxygenNote: 7.1.0
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ S3method(logLik,vine)
S3method(logLik,vinecop)
S3method(plot,bicop)
S3method(plot,bicop_dist)
S3method(plot,rvine_matrix)
S3method(plot,rvine_structure)
S3method(plot,vinecop)
S3method(plot,vinecop_dist)
Expand Down
25 changes: 25 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# rvinecopulib 0.5.2.1.0 (May 7, 2020)

Release following the updates of vinecopulib to 0.5.2, see
https://github.com/vinecopulib/vinecopulib/releases. The most
relevant changes are summarized below.

NEW FEATURES

* single-integer constructors for `dvine_structure()`/`cvine_structure()`. (#203)

* add `var_names = "hide"` option in `plot.vinecop_dist()`. (#203)

* add function `plot.rvine_matrix()`. (#203)

BUG FIXES

* fix bug for (negative) tau to parameter conversion for Frank family. (#207)

* fix rare error `rvine_structure_sim()/rvine_matrix_sim()`

* safeguard `"tll"` family against comonotonic data.

* stabilize archimedean h-functions near independence.


# rvinecopulib 0.5.1.1.0 (November 25, 2019)

Release following the updates of vinecopulib to 0.5.1, see
Expand Down
2 changes: 1 addition & 1 deletion R/bicop.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#'
#' ## Discrete variables
#'
#' When at least one variable is discrete, mote than two columns are required
#' When at least one variable is discrete, more than two columns are required
#' for `data`: the first \eqn{n \times 2} block contains realizations of
#' \eqn{F_{X_1}(x_1), F_{X_2}(x_2)}. The second \eqn{n \times 2} block contains
#' realizations of \eqn{F_{X_1}(x_1^-), F_{X_1}(x_1^-)}. The minus indicates a
Expand Down
6 changes: 3 additions & 3 deletions R/bicop_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' other variable, that is `v` when `cond_var = 1` and `u` when `cond_var = 2`.
#'
#' ## Discrete variables
#' When at least one variable is discrete, mote than two columns are required
#' When at least one variable is discrete, more than two columns are required
#' for `u`: the first \eqn{n \times 2} block contains realizations of
#' \eqn{F_{X_1}(x_1), F_{X_2}(x_2)}. The second \eqn{n \times 2} block contains
#' realizations of \eqn{F_{X_1}(x_1^-), F_{X_1}(x_1^-)}. The minus indicates a
Expand Down Expand Up @@ -169,7 +169,7 @@ par_to_ktau <- function(family, rotation, parameters) {
#' @export
ktau_to_par <- function(family, tau) {
bicop <- args2bicop(family)
if (!(bicop$family %in% c(family_set_elliptical, family_set_nonparametric))) {
if (!(bicop$family %in% family_set_rotationless)) {
bicop$rotation <- ifelse(tau > 0, 0, 90)
}
bicop_tau_to_par_cpp(bicop, tau)
Expand All @@ -195,7 +195,7 @@ ktau_to_par <- function(family, tau) {
#'
#'
#' ## Discrete variables
#' When at least one variable is discrete, mote than two columns are required
#' When at least one variable is discrete, more than two columns are required
#' for `newdata`: the first \eqn{n \times 2} block contains realizations of
#' \eqn{F_{X_1}(x_1), F_{X_2}(x_2)}. The second \eqn{n \times 2} block contains
#' realizations of \eqn{F_{X_1}(x_1^-), F_{X_1}(x_1^-)}. The minus indicates a
Expand Down
2 changes: 1 addition & 1 deletion R/bicop_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' \code{"exp"} with standard exponential margins, and \code{"flexp"} with
#' flipped exponential margins. Default is \code{"norm"} for \code{type =
#' "contour"}, and \code{"unif"} for \code{type = "surface"}.
#' @param size integer; the plot is based on values on a \eqn{size x size} grid,
#' @param size integer; the plot is based on values on a `size x size` grid,
#' default is 100.
#' @param \dots optional arguments passed to \code{\link{contour}} or
#' \code{\link{wireframe}}.
Expand Down
4 changes: 4 additions & 0 deletions R/family_sets.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ family_set_itau <- c(
"indep", family_set_onepar, "t"
)

family_set_rotationless <- c(
"frank", family_set_elliptical, family_set_nonparametric
)

family_set_all <- unique(
c(family_set_parametric, family_set_nonparametric)
)
Expand Down
2 changes: 1 addition & 1 deletion R/rosenblatt.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' V_1 = F^{-1}(U_1), V_{2} = F^{-1}(U_2|U_1), \ldots,
#' V_d =F^{-1}(U_d|U_1,\ldots,U_{d-1}),
#' }
#' can can be used to simulate from a distribution. For any copula \eqn{F}, if
#' can be used to simulate from a distribution. For any copula \eqn{F}, if
#' \eqn{U} is a vector of independent random variables, \eqn{V = T^{-1}(U)} has
#' distribution \eqn{F}.
#'
Expand Down
30 changes: 12 additions & 18 deletions R/rvine_structure.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' 0 \tab 0 \tab `(1, 4)` \cr
#' \tab 1 \tab `(2, 4)` \cr
#' \tab 2 \tab `(3, 4)` \cr
#' 1 \tab 0 \tab `(1, 3; 2)` \cr
#' 1 \tab 0 \tab `(1, 3; 4)` \cr
#' \tab 1 \tab `(2, 3; 4)` \cr
#' 2 \tab 0 \tab `(1, 2; 3, 4)`
#' }
Expand Down Expand Up @@ -192,45 +192,37 @@ rvine_structure <- function(order, struct_array = list(), is_natural_order = FAL
#'
#' Plot one or all trees of an R-vine structure.
#'
#' @param x an `rvine_structure` or `rvine_matrixc` object.
#' @param tree `"ALL"` or integer vector; specifies which trees are
#' plotted.
#' @param edge_labels either `TRUE` or `FALSE`; if `TRUE` the edge index is
#' added to the plot.
#' @param ... unused.
#' @param x an `rvine_structure` or `rvine_matrix` object.
#' @param ... passed to `plot.vinecop_dist()`.
#' @aliases plot.rvine_matrix
#' @export
#' @examples
#' plot(cvine_structure(1:5))
#' plot(rvine_structure_sim(5))
plot.rvine_structure <- function(x, tree = 1, edge_labels = FALSE, ...) {
assert_that(is.flag(edge_labels))
plot.rvine_structure <- function(x, ...) {
d <- dim(x)[1]
trunc_lvl <- dim(x)[2]
pcs <- lapply(seq_len(min(d - 1, trunc_lvl)),
function(i) lapply(seq_len(d - i), function(j) bicop_dist()))
plot(vinecop_dist(pcs, x),
tree = tree,
edge_labels = if (edge_labels) "pair" else NULL)
plot.vinecop_dist(vinecop_dist(pcs, x), ...)
}

#' @rdname plot.rvine_structure
#' @examples
#' mat <- rbind(c(1, 1, 1), c(2, 2, 0), c(3, 0, 0))
#' plot(rvine_matrix(mat))
#' plot(rvine_matrix_sim(5))
plot.rvine_matrix <- function(x, tree = 1, edge_labels = FALSE, ...) {
plot(as_rvine_structure(x), tree = tree, edge_labels = edge_labels)
#' @export
plot.rvine_matrix <- function(x, ...) {
plot(as_rvine_structure(x), ...)
}

#' @rdname rvine_structure
#' @param trunc_lvl the truncation level
#' @export
#' @examples
#' cvine <- cvine_structure(1:5)
#' cvine
#' plot(cvine)
cvine_structure <- function(order, trunc_lvl = Inf) {
if (is.count(order))
order <- seq_len(order)
assert_that(is.vector(order) && all(sapply(order, is.count)),
msg = "Order should be a vector of positive integers.")
assert_that(is.scalar(trunc_lvl) & is.number(trunc_lvl))
Expand All @@ -255,6 +247,8 @@ cvine_structure <- function(order, trunc_lvl = Inf) {
#' @rdname rvine_structure
#' @export
dvine_structure <- function(order, trunc_lvl = Inf) {
if (is.count(order))
order <- seq_len(order)
assert_that(is.vector(order) && all(sapply(order, is.count)),
msg = "Order should be a vector of positive integers.")
assert_that(is.scalar(trunc_lvl) & is.number(trunc_lvl))
Expand Down
2 changes: 1 addition & 1 deletion R/rvinecopulib.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' Advantages over 'VineCopula' are a sleeker and more modern API, improved
#' performances, especially in high dimensions, nonparametric and
#' multi-parameter families. The 'rvinecopulib' package includes 'vinecopulib'
#' as header-only C++ library (currently version 0.3.1). Thus users do not need
#' as header-only C++ library (currently version 0.5.2). Thus users do not need
#' to install 'vinecopulib' itself in order to use 'rvinecopulib'. Since their
#' initial releases, 'vinecopulib' is licensed under the MIT License, and
#' 'rvinecopulib' is licensed under the GNU GPL version 3.
Expand Down
6 changes: 3 additions & 3 deletions R/vinecop.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#' @details
#'
#' ## Discrete variables
#'
#' Let `n` be the number of observations and `d` the number of variables.
#' When at least one variable is discrete, two types of
#' "observations" are required in `data`: the first \eqn{n x d} block
#' contains realizations of \eqn{F_{X_j}(X_j)}. The second \eqn{n x d}
#' "observations" are required in `data`: the first `n x d` block
#' contains realizations of \eqn{F_{X_j}(X_j)}. The second `n x d`
#' block contains realizations of \eqn{F_{X_j}(X_j^-)}. The minus indicates a
#' left-sided limit of the cdf. For, e.g., an integer-valued variable, it holds
#' \eqn{F_{X_j}(X_j^-) = F_{X_j}(X_j - 1)}. For continuous variables the left
Expand Down
Loading

0 comments on commit cf2cc69

Please sign in to comment.