vinecopulib / rvinecopulib
Showing 2 of 3 files from the diff.

@@ -120,11 +120,13 @@
Loading
120 120
121 121
#' @importFrom utils capture.output
122 122
#' @export
123 -
summary.vinecop_dist <- function(object, ...) {
123 +
summary.vinecop_dist <- function(object,
124 +
                                 trees = seq_len(dim(object)["trunc_lvl"]),
125 +
                                 ...) {
124 126
  mat <- as_rvine_matrix(get_structure(object))
125 127
  d <- dim(object)[1]
126 -
  n_trees <- dim(object)[2]
127 -
  n_pcs <- length(unlist(object$pair_copulas, recursive = FALSE))
128 +
  trees <- intersect(trees, seq_len(dim(object)["trunc_lvl"]))
129 +
  n_pcs <- length(unlist(object$pair_copulas[trees], recursive = FALSE))
128 130
  mdf <- as.data.frame(matrix(NA, n_pcs, 10))
129 131
  names(mdf) <- c(
130 132
    "tree", "edge",
@@ -132,7 +134,7 @@
Loading
132 134
    "family", "rotation", "parameters", "df", "tau"
133 135
  )
134 136
  k <- 1
135 -
  for (t in seq_len(n_trees)) {
137 +
  for (t in trees) {
136 138
    for (e in seq_len(d - t)) {
137 139
      mdf$tree[k] <- t
138 140
      mdf$edge[k] <- e
@@ -293,13 +295,12 @@
Loading
293 295
294 296
295 297
#' @export
296 -
summary.vinecop <- function(object, ...) {
297 -
  mdf <- summary.vinecop_dist(object)
298 -
298 +
summary.vinecop <- function(object, trees = seq_len(dim(object)["trunc_lvl"]), ...) {
299 +
  trees <- intersect(trees, seq_len(dim(object)["trunc_lvl"]))
300 +
  mdf <- summary.vinecop_dist(object, trees)
299 301
  d <- dim(object)[1]
300 -
  trunc_lvl <- dim(object)[2]
301 302
  k <- 1
302 -
  for (t in seq_len(trunc_lvl)) {
303 +
  for (t in trees) {
303 304
    for (e in seq_len(d - t)) {
304 305
      mdf$loglik[k] <- object$pair_copulas[[t]][[e]]$loglik
305 306
      k <- k + 1

@@ -147,7 +147,7 @@
Loading
147 147
summary.vine_dist <- function(object, ...) {
148 148
  list(
149 149
    margins = get_vine_dist_margin_summary(object),
150 -
    copula = summary(object$copula)
150 +
    copula = summary(object$copula, ...)
151 151
  )
152 152
}
153 153
Files Coverage
R 94.08%
inst/include/vinecopulib-wrappers.hpp 98.08%
Project Totals (16 files) 94.48%
__run_7

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading