From noreply at r-forge.r-project.org Wed Jul 1 21:28:15 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 1 Jul 2015 21:28:15 +0200 (CEST) Subject: [Vinecopula-commits] r102 - in pkg: . R inst Message-ID: <20150701192815.BFE6E187ABA@r-forge.r-project.org> Author: ben_graeler Date: 2015-07-01 21:28:15 +0200 (Wed, 01 Jul 2015) New Revision: 102 Modified: pkg/DESCRIPTION pkg/R/BiCopCDF.r pkg/inst/ChangeLog Log: Definition of "C" in BiCopCDF for tawn copulas used constants u1 und u2 instead of arguments u and v - this caused false values for families 114, 124, 134, 214, 224, 234 Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2015-06-23 19:51:10 UTC (rev 101) +++ pkg/DESCRIPTION 2015-07-01 19:28:15 UTC (rev 102) @@ -1,8 +1,8 @@ Package: VineCopula Type: Package Title: Statistical Inference of Vine Copulas -Version: 1.5 -Date: 2015-06-05 +Version: 1.6 +Date: 2015-07-01 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler, Thomas Nagler, Tobias Erhardt Maintainer: Tobias Erhardt Depends: R (>= 2.11.0) Modified: pkg/R/BiCopCDF.r =================================================================== --- pkg/R/BiCopCDF.r 2015-06-23 19:51:10 UTC (rev 101) +++ pkg/R/BiCopCDF.r 2015-07-01 19:28:15 UTC (rev 102) @@ -165,11 +165,11 @@ (1 - par3) * (1 - t) + (1 - par2) * t + ta(t, par, par2, par3)^(1/par) } - w <- function(u1, u2) { - log(u2)/log(u1 * u2) + w <- function(u, v) { + log(v)/log(u * v) } C <- function(u, v, par, par2, par3) { - (u1 * u2)^A(w(u1, u2), par, par2, par3) + (u * v)^A(w(u, v), par, par2, par3) } if (family == 104) { Modified: pkg/inst/ChangeLog =================================================================== --- pkg/inst/ChangeLog 2015-06-23 19:51:10 UTC (rev 101) +++ pkg/inst/ChangeLog 2015-07-01 19:28:15 UTC (rev 102) @@ -4,6 +4,9 @@ Former authors: Eike Brechmann and Jakob Stoeber Maintainer: Tobias Erhardt and Thomas Nagler +Version 1.6 (July 1, 2015) +- Bug fix: + * Definition of "C" in BiCopCDF for tawn copulas used constants u1 und u2 instead of arguments u and v Version 1.5 (June 2, 2015) From noreply at r-forge.r-project.org Thu Jul 16 12:28:23 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jul 2015 12:28:23 +0200 (CEST) Subject: [Vinecopula-commits] r103 - pkg/R Message-ID: <20150716102824.078E5186C0D@r-forge.r-project.org> Author: etobi Date: 2015-07-16 12:28:23 +0200 (Thu, 16 Jul 2015) New Revision: 103 Modified: pkg/R/RVineStructureSelect.r Log: RVineStructureSelect: Adjust to new version of igraph. Tree structure was not selected correctly. igraph function names changed to the names used in the new version. Some small modifications to avoid some for loops and make the code easier to read. Modified: pkg/R/RVineStructureSelect.r =================================================================== --- pkg/R/RVineStructureSelect.r 2015-07-01 19:28:15 UTC (rev 102) +++ pkg/R/RVineStructureSelect.r 2015-07-16 10:28:23 UTC (rev 103) @@ -46,9 +46,9 @@ ## estimation in first tree ---------------------------- # find optimal tree g <- initializeFirstGraph(data, weights) - mst <- findMaximumTauTree(g, mode = type) + MST <- findMaximumTauTree(g, mode = type) # estimate pair-copulas - VineTree <- fit.FirstTreeCopulas(mst, + VineTree <- fit.FirstTreeCopulas(MST, data, familyset, selectioncrit, @@ -67,9 +67,9 @@ familyset <- 0 # find optimal tree g <- buildNextGraph(VineTree, weights) - mst <- findMaximumTauTree(g, mode = type) + MST <- findMaximumTauTree(g, mode = type) # estimate pair-copulas - VineTree <- fit.TreeCopulas(mst, + VineTree <- fit.TreeCopulas(MST, VineTree, familyset, selectioncrit, @@ -86,49 +86,53 @@ as.RVM(RVine) } +## full graph with Kendall's tau as edge weights initializeFirstGraph <- function(data.univ, weights) { # C = cor(data.univ,method='kendall') q <- dim(data.univ)[2] - C <- matrix(rep(1, q * q), ncol = q) +# C <- matrix(rep(1, q * q), ncol = q) +# +# for (i in 1:(q - 1)) { +# for (j in (i + 1):q) { +# tau <- fasttau(data.univ[, i], data.univ[, j], weights) +# C[i, j] <- tau +# C[j, i] <- tau +# } +# } +# rownames(C) <- colnames(C) <- colnames(data.univ) + C <- TauMatrix(data = data.univ, weights = weights) - for (i in 1:(q - 1)) { - for (j in (i + 1):q) { - tau <- fasttau(data.univ[, i], data.univ[, j], weights) - C[i, j] <- tau - C[j, i] <- tau - } - } - rownames(C) <- colnames(C) <- colnames(data.univ) - - g <- graph.adjacency(C, mode = "lower", weighted = TRUE, diag = FALSE) + g <- graph_from_adjacency_matrix(C, mode = "lower", weighted = TRUE, diag = FALSE) E(g)$tau <- E(g)$weight - E(g)$name <- paste(get.edgelist(g)[, 1], get.edgelist(g)[, 2], sep = ",") + E(g)$name <- paste(as_edgelist(g)[, 1], as_edgelist(g)[, 2], sep = ",") - for (i in 1:ecount(g)) { - E(g)$conditionedSet[[i]] <- get.edges(g, i) + for (i in 1:gsize(g)) { + E(g)$conditionedSet[[i]] <- ends(g, i, names = FALSE) } return(g) } +## find maximum spanning tree/ first vine tree findMaximumTauTree <- function(g, mode = "RVine") { if (mode == "RVine") { - return(minimum.spanning.tree(g, weights = 1 - abs(E(g)$weight))) + return(mst(g, weights = 1 - abs(E(g)$weight))) } else if (mode == "CVine") { - M <- abs(get.adjacency(g, attr = "weight", sparse = 0)) + M <- abs(as_adjacency_matrix(g, attr = "weight", sparse = 0)) sumtaus <- rowSums(M) root <- which.max(sumtaus) - Ecken <- get.edges(g, 1:ecount(g)) + Ecken <- ends(g, 1:gsize(g), names = FALSE) pos <- Ecken[, 2] == root | Ecken[, 1] == root - mst <- delete.edges(g, E(g)[!pos]) + MST <- delete_edges(g, E(g)[!pos]) - return(mst) + return(MST) } } +# not required any longer? Use TauMatrix instead fasttau <- function(x, y, weights = NA) { if (any(is.na(weights))) { m <- length(x) @@ -155,41 +159,41 @@ return(ktau) } - -fit.FirstTreeCopulas <- function(mst, data.univ, type, copulaSelectionBy, testForIndependence, testForIndependence.level, weights = NA) { +## fit pair-copulas for the first vine tree +fit.FirstTreeCopulas <- function(MST, data.univ, type, copulaSelectionBy, testForIndependence, testForIndependence.level, weights = NA) { - d <- ecount(mst) + d <- gsize(MST) parameterForACopula <- list() for (i in 1:d) { parameterForACopula[[i]] <- list() - a <- get.edges(mst, i) + a <- ends(MST, i, names = FALSE) parameterForACopula[[i]]$zr1 <- data.univ[, a[1]] parameterForACopula[[i]]$zr2 <- data.univ[, a[2]] - E(mst)[i]$Copula.Data.1 <- list(data.univ[, a[1]]) - E(mst)[i]$Copula.Data.2 <- list(data.univ[, a[2]]) + E(MST)[i]$Copula.Data.1 <- list(data.univ[, a[1]]) + E(MST)[i]$Copula.Data.2 <- list(data.univ[, a[2]]) - if (is.null(V(mst)[a[1]]$name)) { - E(mst)[i]$Copula.CondName.1 <- a[1] + if (is.null(V(MST)[a[1]]$name)) { + E(MST)[i]$Copula.CondName.1 <- a[1] } else { - E(mst)[i]$Copula.CondName.1 <- V(mst)[a[1]]$name + E(MST)[i]$Copula.CondName.1 <- V(MST)[a[1]]$name } - if (is.null(V(mst)[a[2]]$name)) { - E(mst)[i]$Copula.CondName.2 <- a[2] + if (is.null(V(MST)[a[2]]$name)) { + E(MST)[i]$Copula.CondName.2 <- a[2] } else { - E(mst)[i]$Copula.CondName.2 <- V(mst)[a[2]]$name + E(MST)[i]$Copula.CondName.2 <- V(MST)[a[2]]$name } - if (is.null(V(mst)[a[1]]$name) || is.null(V(mst)[a[2]]$name)) { - E(mst)[i]$Copula.Name <- paste(a[1], a[2], sep = " , ") + if (is.null(V(MST)[a[1]]$name) || is.null(V(MST)[a[2]]$name)) { + E(MST)[i]$Copula.Name <- paste(a[1], a[2], sep = " , ") } else { - E(mst)[i]$Copula.Name <- paste(V(mst)[a[1]]$name, - V(mst)[a[2]]$name, + E(MST)[i]$Copula.Name <- paste(V(MST)[a[1]]$name, + V(MST)[a[2]]$name, sep = " , ") } } @@ -202,29 +206,30 @@ weights) for (i in 1:d) { - E(mst)$Copula.param[[i]] <- c(outForACopula[[i]]$par, + E(MST)$Copula.param[[i]] <- c(outForACopula[[i]]$par, outForACopula[[i]]$par2) - E(mst)[i]$Copula.type <- outForACopula[[i]]$family - E(mst)[i]$Copula.out <- list(outForACopula[[i]]) + E(MST)[i]$Copula.type <- outForACopula[[i]]$family + E(MST)[i]$Copula.out <- list(outForACopula[[i]]) - E(mst)[i]$Copula.CondData.1 <- list(outForACopula[[i]]$CondOn.1) - E(mst)[i]$Copula.CondData.2 <- list(outForACopula[[i]]$CondOn.2) + E(MST)[i]$Copula.CondData.1 <- list(outForACopula[[i]]$CondOn.1) + E(MST)[i]$Copula.CondData.2 <- list(outForACopula[[i]]$CondOn.2) } - return(mst) + return(MST) } -fit.TreeCopulas <- function(mst, oldVineGraph, type, copulaSelectionBy, testForIndependence, testForIndependence.level, progress, weights = NA) { - d <- ecount(mst) +## fit pair-copulas for vine trees 2,... +fit.TreeCopulas <- function(MST, oldVineGraph, type, copulaSelectionBy, testForIndependence, testForIndependence.level, progress, weights = NA) { + d <- gsize(MST) parameterForACopula <- list() for (i in 1:d) { parameterForACopula[[i]] <- list() - con <- get.edge(mst, i) + con <- as.vector(ends(MST, i, names = FALSE)) - temp <- get.edges(oldVineGraph, con) + temp <- ends(oldVineGraph, con, names = FALSE) if ((temp[1, 1] == temp[2, 1]) || (temp[1, 2] == temp[2, 1])) { same <- temp[2, 1] @@ -234,8 +239,8 @@ } } - other1 <- temp[1, temp[1, ] != same] - other2 <- temp[2, temp[2, ] != same] + # other1 <- temp[1, temp[1, ] != same] + # other2 <- temp[2, temp[2, ] != same] if (temp[1, 1] == same) { zr1 <- E(oldVineGraph)[con[1]]$Copula.CondData.2 @@ -266,16 +271,16 @@ } if (progress == TRUE) - message(n1a, " + ", n2a, " --> ", E(mst)[i]$name) + message(n1a, " + ", n2a, " --> ", E(MST)[i]$name) parameterForACopula[[i]]$zr1 <- zr1a parameterForACopula[[i]]$zr2 <- zr2a - E(mst)[i]$Copula.Data.1 <- list(zr1a) - E(mst)[i]$Copula.Data.2 <- list(zr2a) + E(MST)[i]$Copula.Data.1 <- list(zr1a) + E(MST)[i]$Copula.Data.2 <- list(zr2a) - E(mst)[i]$Copula.CondName.2 <- n1a - E(mst)[i]$Copula.CondName.1 <- n2a + E(MST)[i]$Copula.CondName.1 <- n1a + E(MST)[i]$Copula.CondName.2 <- n2a } outForACopula <- lapply(X = parameterForACopula, @@ -286,24 +291,25 @@ weights) for (i in 1:d) { - E(mst)$Copula.param[[i]] <- c(outForACopula[[i]]$par, outForACopula[[i]]$par2) - E(mst)[i]$Copula.type <- outForACopula[[i]]$family - E(mst)[i]$Copula.out <- list(outForACopula[[i]]) + E(MST)$Copula.param[[i]] <- c(outForACopula[[i]]$par, outForACopula[[i]]$par2) + E(MST)[i]$Copula.type <- outForACopula[[i]]$family + E(MST)[i]$Copula.out <- list(outForACopula[[i]]) - E(mst)[i]$Copula.CondData.2 <- list(outForACopula[[i]]$CondOn.1) - E(mst)[i]$Copula.CondData.1 <- list(outForACopula[[i]]$CondOn.2) + E(MST)[i]$Copula.CondData.1 <- list(outForACopula[[i]]$CondOn.1) + E(MST)[i]$Copula.CondData.2 <- list(outForACopula[[i]]$CondOn.2) } - return(mst) + return(MST) } +## initialize graph for next vine tree (possible edges) buildNextGraph <- function(oldVineGraph, weights = NA) { - EL <- get.edgelist(oldVineGraph) - d <- ecount(oldVineGraph) + # EL <- as_edgelist(oldVineGraph) + d <- gsize(oldVineGraph) - g <- graph.full(d) + g <- make_full_graph(d) V(g)$name <- E(oldVineGraph)$name V(g)$conditionedSet <- E(oldVineGraph)$conditionedSet @@ -311,14 +317,14 @@ V(g)$conditioningSet <- E(oldVineGraph)$conditioningSet } - for (i in 1:ecount(g)) { + for (i in 1:gsize(g)) { - con <- get.edge(g, i) + con <- as.vector(ends(g, i, names = FALSE)) - temp <- get.edges(oldVineGraph, con) + temp <- ends(oldVineGraph, con, names = FALSE) + ## check for proximity condition ok <- FALSE - if ((temp[1, 1] == temp[2, 1]) || (temp[1, 2] == temp[2, 1])) { ok <- TRUE same <- temp[2, 1] @@ -329,9 +335,10 @@ } } + ## if proximity condition is fulfilled if (ok) { - other1 <- temp[1, temp[1, ] != same] - other2 <- temp[2, temp[2, ] != same] + # other1 <- temp[1, temp[1, ] != same] + # other2 <- temp[2, temp[2, ] != same] if (temp[1, 1] == same) { zr1 <- E(oldVineGraph)[con[1]]$Copula.CondData.2 @@ -354,39 +361,40 @@ } keine_nas <- !(is.na(zr1a) | is.na(zr2a)) # print(keine_nas) print(zr1a) E(g)[i]$weight = cor(x=zr1[keine_nas],y=zr2[keine_nas], method='kendall') - E(g)[i]$weight <- fasttau(zr1a[keine_nas], zr2a[keine_nas], weights) + E(g)[i]$weight <- TauMatrix(cbind(zr1a[keine_nas], zr2a[keine_nas]), weights)[2,1] - name.node1 <- strsplit(V(g)[con[1]]$name, split = " *[,|] *")[[1]] - name.node2 <- strsplit(V(g)[con[2]]$name, split = " *[,|] *")[[1]] + name.node1 <- strsplit(V(g)[con[1]]$name, split = " *[,;] *")[[1]] + name.node2 <- strsplit(V(g)[con[2]]$name, split = " *[,;] *")[[1]] - schnitt <- c() + ## conditioning set + schnitt <- intersect(name.node1, name.node2) +# for (j in 1:length(name.node1)) { +# for (k in 1:length(name.node2)) { +# if (name.node1[j] == name.node2[k]) { +# schnitt <- c(schnitt, name.node1[j]) +# name.node1[j] <- "" +# name.node2[k] <- "" +# break +# } +# } +# } - for (j in 1:length(name.node1)) { - for (k in 1:length(name.node2)) { - if (name.node1[j] == name.node2[k]) { - schnitt <- c(schnitt, name.node1[j]) - name.node1[j] <- "" - name.node2[k] <- "" - break - } - } - } + ## conditioned set + differenz <- c(setdiff(name.node1, name.node2), setdiff(name.node2, name.node1)) +# for (j in 1:length(name.node1)) { +# if (name.node1[j] != "") { +# differenz <- c(differenz, name.node1[j]) +# } +# } +# for (j in 1:length(name.node2)) { +# if (name.node2[j] != "") { +# differenz <- c(differenz, name.node2[j]) +# } +# } - differenz <- c() - for (j in 1:length(name.node1)) { - if (name.node1[j] != "") { - differenz <- c(differenz, name.node1[j]) - } - } - for (j in 1:length(name.node2)) { - if (name.node2[j] != "") { - differenz <- c(differenz, name.node2[j]) - } - } - E(g)[i]$name <- paste(paste(differenz, collapse = ","), paste(schnitt, collapse = ","), - sep = " | ") + sep = " ; ") if (is.list(V(g)[con[1]]$conditionedSet)) { l1 <- c(as.vector(V(g)[con[1]]$conditionedSet[[1]]), @@ -414,7 +422,7 @@ E(g)$tau <- E(g)$weight - g <- delete.edges(g, E(g)[E(g)$todel]) + g <- delete_edges(g, E(g)[E(g)$todel]) return(g) } @@ -428,34 +436,35 @@ intern_SchnittDifferenz <- function(liste1, liste2) { out <- list() - out$schnitt <- c() - out$differenz <- c() + out$schnitt <- intersect(liste1, liste2) + out$differenz <- c(setdiff(liste1, liste2), setdiff(liste2, liste1)) - for (j in 1:length(liste1)) { - for (k in 1:length(liste2)) { - if (!is.na(liste2[k]) && liste1[j] == liste2[k]) { - out$schnitt <- c(out$schnitt, liste1[j]) - liste1[j] <- NA - liste2[k] <- NA - break - } - } - } +# for (j in 1:length(liste1)) { +# for (k in 1:length(liste2)) { +# if (!is.na(liste2[k]) && liste1[j] == liste2[k]) { +# out$schnitt <- c(out$schnitt, liste1[j]) +# liste1[j] <- NA +# liste2[k] <- NA +# break +# } +# } +# } +# +# for (j in 1:length(liste1)) { +# if (!is.na(liste1[j])) { +# out$differenz <- c(out$differenz, liste1[j]) +# } +# } +# for (j in 1:length(liste2)) { +# if (!is.na(liste2[j])) { +# out$differenz <- c(out$differenz, liste2[j]) +# } +# } - for (j in 1:length(liste1)) { - if (!is.na(liste1[j])) { - out$differenz <- c(out$differenz, liste1[j]) - } - } - for (j in 1:length(liste2)) { - if (!is.na(liste2[j])) { - out$differenz <- c(out$differenz, liste2[j]) - } - } - return(out) } +## bivariate copula selection fit.ACopula <- function(u1, u2, familyset = NA, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, weights = NA) { ## select family and estimate parameter(s) for the pair copula @@ -505,6 +514,7 @@ out } +## build R-Vine matrix object based on nested set of trees as.RVM <- function(RVine) { ## initialize objects From noreply at r-forge.r-project.org Thu Jul 16 16:42:52 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jul 2015 16:42:52 +0200 (CEST) Subject: [Vinecopula-commits] r104 - in pkg: . R inst man Message-ID: <20150716144252.37036187129@r-forge.r-project.org> Author: etobi Date: 2015-07-16 16:42:51 +0200 (Thu, 16 Jul 2015) New Revision: 104 Modified: pkg/DESCRIPTION pkg/NAMESPACE pkg/R/ClaytonGumbelCopula.R pkg/R/RVineTreePlot.r pkg/inst/ChangeLog pkg/man/BiCopGofTest.Rd pkg/man/RVineTreePlot.Rd pkg/man/VineCopula-package.Rd Log: - Imports * extend Imports to avoid undefined globals (CRAN E-mail 02.07.2015) * new version reqiures igraph (>= 1.0.0) - New functionality: * RVineTreePlot: option for a legend (and numbered nodes and edges) Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2015-07-16 10:28:23 UTC (rev 103) +++ pkg/DESCRIPTION 2015-07-16 14:42:51 UTC (rev 104) @@ -2,11 +2,11 @@ Type: Package Title: Statistical Inference of Vine Copulas Version: 1.6 -Date: 2015-07-01 +Date: 2015-07-16 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler, Thomas Nagler, Tobias Erhardt Maintainer: Tobias Erhardt Depends: R (>= 2.11.0) -Imports: MASS, mvtnorm, igraph, methods, copula, ADGofTest, lattice +Imports: graphics, grDevices, stats, utils, MASS, mvtnorm, igraph (>= 1.0.0), methods, copula, ADGofTest, lattice Suggests: CDVine, TSP Description: Tools for bivariate exploratory data analysis, bivariate copula selection and (vine) tree construction are provided. Vine copula models can be estimated either sequentially or by joint maximum likelihood estimation. Sampling algorithms and plotting methods are included. Data is assumed to lie in the unit hypercube (so-called copula data). For C- and D-vines links to the package 'CDVine' are provided. License: GPL (>= 2) Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2015-07-16 10:28:23 UTC (rev 103) +++ pkg/NAMESPACE 2015-07-16 14:42:51 UTC (rev 104) @@ -1,11 +1,18 @@ +import("graphics") +import("grDevices") +import("stats") +import("utils") import(MASS) import(mvtnorm) -import(igraph) import(copula) import(methods) import(lattice) importFrom(ADGofTest, ad.test) +importFrom("igraph", "E", "E<-", "V", "V<-", "as_adjacency_matrix", + "as_edgelist", "delete_edges", "ends", "graph_from_adjacency_matrix", + "graph_from_edgelist", "gsize", "layout_in_circle", "layout_with_graphopt", + "make_full_graph", "mst", "plot.igraph") export(pobs) Modified: pkg/R/ClaytonGumbelCopula.R =================================================================== --- pkg/R/ClaytonGumbelCopula.R 2015-07-16 10:28:23 UTC (rev 103) +++ pkg/R/ClaytonGumbelCopula.R 2015-07-16 14:42:51 UTC (rev 104) @@ -1,435 +1,435 @@ -##################################### -## ## -## additions to the Clayton copula ## -## ## -##################################### - -############################# -## Clayton survival copula ## -############################# - -validClaytonCopula = function(object) { - if (object at dimension != 2) - return("Only Clayton copulas of dimension 2 are supported.") - param <- object at parameters - upper <- object at param.upbnd - lower <- object at param.lowbnd - if (length(param) != length(upper)) - return("Parameter and upper bound have non-equal length") - if (length(param) != length(lower)) - return("Parameter and lower bound have non-equal length") - if (any(is.na(param) | param >= upper | param <= lower )) - return("Parameter value out of bound.") - else return (TRUE) -} - -setClass("surClaytonCopula", - representation = representation("copula", family="numeric"), - validity = validClaytonCopula, - contains = list("copula") -) - -# constructor -surClaytonCopula <- function (param=1) { - new("surClaytonCopula", dimension = as.integer(2), parameters = param, param.names = c("theta"), - param.lowbnd = 0, param.upbnd = Inf, family=13, - fullname = "Survival Clayton copula family. Number 13 in VineCopula.") -} - -## density ## -setMethod("dCopula", signature("numeric","surClaytonCopula"), - function(u, copula, log) { - linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) - }) -setMethod("dCopula", signature("matrix","surClaytonCopula"), linkVineCop.PDF) - -## jcdf ## -setMethod("pCopula", signature("numeric","surClaytonCopula"), - function(u, copula, log) { - linkVineCop.surCDF(matrix(u,ncol=copula at dimension),copula, log) - }) -setMethod("pCopula", signature("matrix","surClaytonCopula"), linkVineCop.surCDF) - -## partial derivatives ## -# ddu -setMethod("dduCopula", signature("numeric","surClaytonCopula"), - function(u, copula, log) { - linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("dduCopula", signature("matrix","surClaytonCopula"), linkVineCop.ddu) - -# ddv -setMethod("ddvCopula", signature("numeric","surClaytonCopula"), - function(u, copula, log) { - linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("ddvCopula", signature("matrix","surClaytonCopula"), linkVineCop.ddv) - -## random number generater ?? -setMethod("rCopula", signature("numeric","surClaytonCopula"), linkVineCop.r) - -## Kendalls tau to parameter conversion -setMethod("iTau", signature("surClaytonCopula"), - function(copula, tau) { - if(tau <= 0) - return(NA) - linkVineCop.iTau(copula, max(1e-6,abs(tau))) - }) - -setMethod("tau",signature("surClaytonCopula"),linkVineCop.tau) -setMethod("tailIndex",signature("surClaytonCopula"),linkVineCop.tailIndex) - -####################### -## Clayton copula 90 ## -####################### - -validRotClaytonCopula = function(object) { - if (object at dimension != 2) - return("Only Clayton copulas of dimension 2 are supported.") - param <- object at parameters - upper <- object at param.upbnd - lower <- object at param.lowbnd - if (length(param) != length(upper)) - return("Parameter and upper bound have non-equal length") - if (length(param) != length(lower)) - return("Parameter and lower bound have non-equal length") - if (any(is.na(param) | param >= upper | param <= lower)) - return("Parameter value out of bound") - else return (TRUE) -} - -setClass("r90ClaytonCopula", - representation = representation("copula", family="numeric"), - validity = validRotClaytonCopula, - contains = list("copula") -) - -# constructor -r90ClaytonCopula <- function (param=-1) { - new("r90ClaytonCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), - param.lowbnd = -Inf, param.upbnd = 0, family=23, - fullname = "90 deg rotated Clayton copula family. Number 23 in VineCopula.") -} - -## density ## -setMethod("dCopula", signature("numeric","r90ClaytonCopula"), - function(u, copula, log) { - linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) - }) -setMethod("dCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.PDF) - -## jcdf ## -setMethod("pCopula", signature("numeric","r90ClaytonCopula"), - function(u, copula) { - linkVineCop.r90CDF(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("pCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.r90CDF) - -## partial derivatives ## -# ddu -setMethod("dduCopula", signature("numeric","r90ClaytonCopula"), - function(u, copula) { - linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("dduCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.ddu) - -## ddv -setMethod("ddvCopula", signature("numeric","r90ClaytonCopula"), - function(u, copula) { - linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("ddvCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.ddv) - -## random number generator -setMethod("rCopula", signature("numeric","r90ClaytonCopula"), linkVineCop.r) - -## Kendalls tau to parameter conversion -setMethod("iTau", signature("r90ClaytonCopula"), - function(copula, tau) { - if(tau >= 0) - return(NA) - linkVineCop.iTau(copula, min(-1e-6,-abs(tau))) - }) - -setMethod("tau",signature("r90ClaytonCopula"),linkVineCop.tau) -setMethod("tailIndex",signature("r90ClaytonCopula"),linkVineCop.tailIndex) - -######################## -## Clayton copula 270 ## -######################## - -setClass("r270ClaytonCopula", - representation = representation("copula", family="numeric"), - validity = validRotClaytonCopula, - contains = list("copula") -) - -# constructor -r270ClaytonCopula <- function (param=-1) { - new("r270ClaytonCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), - param.lowbnd = -Inf, param.upbnd = 0, family=33, - fullname = "270 deg rotated Clayton copula family. Number 33 in VineCopula.") -} - -## density ## -setMethod("dCopula", signature("numeric","r270ClaytonCopula"), - function(u, copula, log) { - linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) - }) -setMethod("dCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.PDF) - -## jcdf ## -setMethod("pCopula", signature("numeric","r270ClaytonCopula"), - function(u, copula) { - linkVineCop.r270CDF(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("pCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.r270CDF) - -## partial derivatives ## -# ddu -setMethod("dduCopula", signature("numeric","r270ClaytonCopula"), - function(u, copula) { - linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("dduCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.ddu) - -## ddv -setMethod("ddvCopula", signature("numeric","r270ClaytonCopula"), - function(u, copula) { - linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("ddvCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.ddv) - -## random number generator -setMethod("rCopula", signature("numeric","r270ClaytonCopula"), linkVineCop.r) - -## Kendalls tau to parameter conversion -setMethod("iTau", signature("r270ClaytonCopula"), - function(copula, tau) { - if(tau >= 0) - return(NA) - linkVineCop.iTau(copula, min(-1e-6,-abs(tau))) - }) - -setMethod("tau",signature("r270ClaytonCopula"),linkVineCop.tau) - -setMethod("tailIndex",signature("r270ClaytonCopula"),linkVineCop.tailIndex) - -#################################### -## ## -## additions to the Gumbel copula ## -## ## -#################################### - -validGumbelCopula = function(object) { - if (object at dimension != 2) - return("Only Gumbel copulas of dimension 2 are supported.") - param <- object at parameters - upper <- object at param.upbnd - lower <- object at param.lowbnd - if (length(param) != length(upper)) - return("Parameter and upper bound have non-equal length") - if (length(param) != length(lower)) - return("Parameter and lower bound have non-equal length") - if (any(is.na(param) | param >= upper | param < lower )) - return("Parameter value out of bound.") - else return (TRUE) -} - -############################ -## Gumbel survival copula ## -############################ - -setClass("surGumbelCopula", - representation = representation("copula", family="numeric"), - validity = validGumbelCopula, - contains = list("copula") - ) - -# constructor -surGumbelCopula <- function (param=1) { - new("surGumbelCopula", dimension = as.integer(2), parameters = param, param.names = c("theta"), - param.lowbnd = 1, param.upbnd = Inf, family=14, - fullname = "Survival Gumbel copula family. Number 14 in VineCopula.") -} - -## density ## -setMethod("dCopula", signature("numeric","surGumbelCopula"), - function(u, copula, log) { - linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) - }) -setMethod("dCopula", signature("matrix","surGumbelCopula"), linkVineCop.PDF) - -## jcdf ## -setMethod("pCopula", signature("numeric","surGumbelCopula"), - function(u, copula) { - linkVineCop.surCDF(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("pCopula", signature("matrix","surGumbelCopula"), linkVineCop.surCDF) - -## partial derivatives ## -# ddu -setMethod("dduCopula", signature("numeric","surGumbelCopula"), - function(u, copula) { - linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("dduCopula", signature("matrix","surGumbelCopula"), linkVineCop.ddu) - -# ddv -setMethod("ddvCopula", signature("numeric","surGumbelCopula"), - function(u, copula) { - linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("ddvCopula", signature("matrix","surGumbelCopula"), linkVineCop.ddv) - -## random number generater ?? -setMethod("rCopula", signature("numeric","surGumbelCopula"), linkVineCop.r) - -## Kendalls tau to parameter conversion -setMethod("iTau", signature("surGumbelCopula"), - function(copula, tau) { - if(tau < 0) - return(NA) - linkVineCop.iTau(copula, max(0,abs(tau))) - }) - -setMethod("tau",signature("surGumbelCopula"),linkVineCop.tau) - -setMethod("tailIndex",signature("surGumbelCopula"),linkVineCop.tailIndex) - -####################### -## Gumbel copula 90 ## -####################### - -validRotGumbelCopula = function(object) { - if (object at dimension != 2) - return("Only Gumbel copulas of dimension 2 are supported.") - param <- object at parameters - upper <- object at param.upbnd - lower <- object at param.lowbnd - if (length(param) != length(upper)) - return("Parameter and upper bound have non-equal length") - if (length(param) != length(lower)) - return("Parameter and lower bound have non-equal length") - if (any(is.na(param) | param > upper | param <= lower)) - return("Parameter value out of bound") - else return (TRUE) -} - -setClass("r90GumbelCopula", - representation = representation("copula", family="numeric"), - validity = validRotGumbelCopula, - contains = list("copula") - ) - -# constructor -r90GumbelCopula <- function (param=-1) { - new("r90GumbelCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), - param.lowbnd = -Inf, param.upbnd = -1, family=24, - fullname = "90 deg rotated Gumbel copula family. Number 24 in VineCopula.") -} - -## density ## -setMethod("dCopula", signature("numeric","r90GumbelCopula"), - function(u, copula, log) { - linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) - }) -setMethod("dCopula", signature("matrix","r90GumbelCopula"), linkVineCop.PDF) - -## jcdf ## -setMethod("pCopula", signature("numeric","r90GumbelCopula"), - function(u, copula) { - linkVineCop.r90CDF(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("pCopula", signature("matrix","r90GumbelCopula"), linkVineCop.r90CDF) - -## partial derivatives ## -# ddu -setMethod("dduCopula", signature("numeric","r90GumbelCopula"), - function(u, copula) { - linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("dduCopula", signature("matrix","r90GumbelCopula"), linkVineCop.ddu) - -## ddv -setMethod("ddvCopula", signature("numeric","r90GumbelCopula"), - function(u, copula) { - linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("ddvCopula", signature("matrix","r90GumbelCopula"), linkVineCop.ddv) - -## random number generator -setMethod("rCopula", signature("numeric","r90GumbelCopula"), linkVineCop.r) - -## Kendalls tau to parameter conversion -setMethod("iTau", signature("r90GumbelCopula"), - function(copula, tau) { - if(tau > 0) - return(NA) - linkVineCop.iTau(copula, min(0,-abs(tau))) - }) - -setMethod("tau",signature("r90GumbelCopula"),linkVineCop.tau) - -setMethod("tailIndex",signature("r90GumbelCopula"),linkVineCop.tailIndex) - -######################## -## Gumbel copula 270 ## -######################## - -setClass("r270GumbelCopula", - representation = representation("copula", family="numeric"), - validity = validRotGumbelCopula, - contains = list("copula") - ) - -# constructor -r270GumbelCopula <- function (param=-1) { - new("r270GumbelCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), - param.lowbnd = -Inf, param.upbnd = -1, family=34, - fullname = "270 deg rotated Gumbel copula family. Number 34 in VineCopula.") -} - -## density ## -setMethod("dCopula", signature("numeric","r270GumbelCopula"), - function(u, copula, log) { - linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) - }) -setMethod("dCopula", signature("matrix","r270GumbelCopula"), linkVineCop.PDF) - -## jcdf ## -setMethod("pCopula", signature("numeric","r270GumbelCopula"), - function(u, copula) { - linkVineCop.r270CDF(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("pCopula", signature("matrix","r270GumbelCopula"), linkVineCop.r270CDF) - -## partial derivatives ## -# ddu -setMethod("dduCopula", signature("numeric","r270GumbelCopula"), - function(u, copula) { - linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("dduCopula", signature("matrix","r270GumbelCopula"), linkVineCop.ddu) - -## ddv -setMethod("ddvCopula", signature("numeric","r270GumbelCopula"), - function(u, copula) { - linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) - }) -setMethod("ddvCopula", signature("matrix","r270GumbelCopula"), linkVineCop.ddv) - -## random number generator -setMethod("rCopula", signature("numeric","r270GumbelCopula"), linkVineCop.r) - -## Kendalls tau to parameter conversion -setMethod("iTau", signature("r270GumbelCopula"), - function(copula, tau) { - if(tau >= 0) - return(NA) - linkVineCop.iTau(copula, min(-1e-6,-abs(tau))) - }) - -setMethod("tau",signature("r270GumbelCopula"),linkVineCop.tau) - -setMethod("tailIndex",signature("r270GumbelCopula"),linkVineCop.tailIndex) +##################################### +## ## +## additions to the Clayton copula ## +## ## +##################################### + +############################# +## Clayton survival copula ## +############################# + +validClaytonCopula = function(object) { + if (object at dimension != 2) + return("Only Clayton copulas of dimension 2 are supported.") + param <- object at parameters + upper <- object at param.upbnd + lower <- object at param.lowbnd + if (length(param) != length(upper)) + return("Parameter and upper bound have non-equal length") + if (length(param) != length(lower)) + return("Parameter and lower bound have non-equal length") + if (any(is.na(param) | param >= upper | param <= lower )) + return("Parameter value out of bound.") + else return (TRUE) +} + +setClass("surClaytonCopula", + representation = representation("copula", family="numeric"), + validity = validClaytonCopula, + contains = list("copula") +) + +# constructor +surClaytonCopula <- function (param=1) { + new("surClaytonCopula", dimension = as.integer(2), parameters = param, param.names = c("theta"), + param.lowbnd = 0, param.upbnd = Inf, family=13, + fullname = "Survival Clayton copula family. Number 13 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","surClaytonCopula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","surClaytonCopula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","surClaytonCopula"), + function(u, copula) { + linkVineCop.surCDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","surClaytonCopula"), linkVineCop.surCDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","surClaytonCopula"), + function(u, copula, log) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","surClaytonCopula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","surClaytonCopula"), + function(u, copula, log) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","surClaytonCopula"), linkVineCop.ddv) + +## random number generater ?? +setMethod("rCopula", signature("numeric","surClaytonCopula"), linkVineCop.r) + +## Kendalls tau to parameter conversion +setMethod("iTau", signature("surClaytonCopula"), + function(copula, tau) { + if(tau <= 0) + return(NA) + linkVineCop.iTau(copula, max(1e-6,abs(tau))) + }) + +setMethod("tau",signature("surClaytonCopula"),linkVineCop.tau) +setMethod("tailIndex",signature("surClaytonCopula"),linkVineCop.tailIndex) + +####################### +## Clayton copula 90 ## +####################### + +validRotClaytonCopula = function(object) { + if (object at dimension != 2) + return("Only Clayton copulas of dimension 2 are supported.") + param <- object at parameters + upper <- object at param.upbnd + lower <- object at param.lowbnd + if (length(param) != length(upper)) + return("Parameter and upper bound have non-equal length") + if (length(param) != length(lower)) + return("Parameter and lower bound have non-equal length") + if (any(is.na(param) | param >= upper | param <= lower)) + return("Parameter value out of bound") + else return (TRUE) +} + +setClass("r90ClaytonCopula", + representation = representation("copula", family="numeric"), + validity = validRotClaytonCopula, + contains = list("copula") +) + +# constructor +r90ClaytonCopula <- function (param=-1) { + new("r90ClaytonCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), + param.lowbnd = -Inf, param.upbnd = 0, family=23, + fullname = "90 deg rotated Clayton copula family. Number 23 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r90ClaytonCopula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r90ClaytonCopula"), + function(u, copula) { + linkVineCop.r90CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.r90CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r90ClaytonCopula"), + function(u, copula) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.ddu) + +## ddv +setMethod("ddvCopula", signature("numeric","r90ClaytonCopula"), + function(u, copula) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r90ClaytonCopula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r90ClaytonCopula"), linkVineCop.r) + +## Kendalls tau to parameter conversion +setMethod("iTau", signature("r90ClaytonCopula"), + function(copula, tau) { + if(tau >= 0) + return(NA) + linkVineCop.iTau(copula, min(-1e-6,-abs(tau))) + }) + +setMethod("tau",signature("r90ClaytonCopula"),linkVineCop.tau) +setMethod("tailIndex",signature("r90ClaytonCopula"),linkVineCop.tailIndex) + +######################## +## Clayton copula 270 ## +######################## + +setClass("r270ClaytonCopula", + representation = representation("copula", family="numeric"), + validity = validRotClaytonCopula, + contains = list("copula") +) + +# constructor +r270ClaytonCopula <- function (param=-1) { + new("r270ClaytonCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), + param.lowbnd = -Inf, param.upbnd = 0, family=33, + fullname = "270 deg rotated Clayton copula family. Number 33 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r270ClaytonCopula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r270ClaytonCopula"), + function(u, copula) { + linkVineCop.r270CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.r270CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r270ClaytonCopula"), + function(u, copula) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.ddu) + +## ddv +setMethod("ddvCopula", signature("numeric","r270ClaytonCopula"), + function(u, copula) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r270ClaytonCopula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r270ClaytonCopula"), linkVineCop.r) + +## Kendalls tau to parameter conversion +setMethod("iTau", signature("r270ClaytonCopula"), + function(copula, tau) { + if(tau >= 0) + return(NA) + linkVineCop.iTau(copula, min(-1e-6,-abs(tau))) + }) + +setMethod("tau",signature("r270ClaytonCopula"),linkVineCop.tau) + +setMethod("tailIndex",signature("r270ClaytonCopula"),linkVineCop.tailIndex) + +#################################### +## ## +## additions to the Gumbel copula ## +## ## +#################################### + +validGumbelCopula = function(object) { + if (object at dimension != 2) + return("Only Gumbel copulas of dimension 2 are supported.") + param <- object at parameters + upper <- object at param.upbnd + lower <- object at param.lowbnd + if (length(param) != length(upper)) + return("Parameter and upper bound have non-equal length") + if (length(param) != length(lower)) + return("Parameter and lower bound have non-equal length") + if (any(is.na(param) | param >= upper | param < lower )) + return("Parameter value out of bound.") + else return (TRUE) +} + +############################ +## Gumbel survival copula ## +############################ + +setClass("surGumbelCopula", + representation = representation("copula", family="numeric"), + validity = validGumbelCopula, + contains = list("copula") + ) + +# constructor +surGumbelCopula <- function (param=1) { + new("surGumbelCopula", dimension = as.integer(2), parameters = param, param.names = c("theta"), + param.lowbnd = 1, param.upbnd = Inf, family=14, + fullname = "Survival Gumbel copula family. Number 14 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","surGumbelCopula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","surGumbelCopula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","surGumbelCopula"), + function(u, copula) { + linkVineCop.surCDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","surGumbelCopula"), linkVineCop.surCDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","surGumbelCopula"), + function(u, copula) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","surGumbelCopula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","surGumbelCopula"), + function(u, copula) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","surGumbelCopula"), linkVineCop.ddv) + +## random number generater ?? +setMethod("rCopula", signature("numeric","surGumbelCopula"), linkVineCop.r) + +## Kendalls tau to parameter conversion +setMethod("iTau", signature("surGumbelCopula"), + function(copula, tau) { + if(tau < 0) + return(NA) + linkVineCop.iTau(copula, max(0,abs(tau))) + }) + +setMethod("tau",signature("surGumbelCopula"),linkVineCop.tau) + +setMethod("tailIndex",signature("surGumbelCopula"),linkVineCop.tailIndex) + +####################### +## Gumbel copula 90 ## +####################### + +validRotGumbelCopula = function(object) { + if (object at dimension != 2) + return("Only Gumbel copulas of dimension 2 are supported.") + param <- object at parameters + upper <- object at param.upbnd + lower <- object at param.lowbnd + if (length(param) != length(upper)) + return("Parameter and upper bound have non-equal length") + if (length(param) != length(lower)) + return("Parameter and lower bound have non-equal length") + if (any(is.na(param) | param > upper | param <= lower)) + return("Parameter value out of bound") + else return (TRUE) +} + +setClass("r90GumbelCopula", + representation = representation("copula", family="numeric"), + validity = validRotGumbelCopula, + contains = list("copula") + ) + +# constructor +r90GumbelCopula <- function (param=-1) { + new("r90GumbelCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), + param.lowbnd = -Inf, param.upbnd = -1, family=24, + fullname = "90 deg rotated Gumbel copula family. Number 24 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r90GumbelCopula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","r90GumbelCopula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r90GumbelCopula"), + function(u, copula) { + linkVineCop.r90CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r90GumbelCopula"), linkVineCop.r90CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r90GumbelCopula"), + function(u, copula) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r90GumbelCopula"), linkVineCop.ddu) + +## ddv +setMethod("ddvCopula", signature("numeric","r90GumbelCopula"), + function(u, copula) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r90GumbelCopula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r90GumbelCopula"), linkVineCop.r) + +## Kendalls tau to parameter conversion +setMethod("iTau", signature("r90GumbelCopula"), + function(copula, tau) { + if(tau > 0) + return(NA) + linkVineCop.iTau(copula, min(0,-abs(tau))) + }) + +setMethod("tau",signature("r90GumbelCopula"),linkVineCop.tau) + +setMethod("tailIndex",signature("r90GumbelCopula"),linkVineCop.tailIndex) + +######################## +## Gumbel copula 270 ## +######################## + +setClass("r270GumbelCopula", + representation = representation("copula", family="numeric"), + validity = validRotGumbelCopula, + contains = list("copula") + ) + +# constructor +r270GumbelCopula <- function (param=-1) { + new("r270GumbelCopula", dimension = as.integer(2), parameters = param, param.names = c("theta", "delta"), + param.lowbnd = -Inf, param.upbnd = -1, family=34, + fullname = "270 deg rotated Gumbel copula family. Number 34 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r270GumbelCopula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","r270GumbelCopula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r270GumbelCopula"), + function(u, copula) { + linkVineCop.r270CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r270GumbelCopula"), linkVineCop.r270CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r270GumbelCopula"), + function(u, copula) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r270GumbelCopula"), linkVineCop.ddu) + +## ddv +setMethod("ddvCopula", signature("numeric","r270GumbelCopula"), + function(u, copula) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r270GumbelCopula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r270GumbelCopula"), linkVineCop.r) + +## Kendalls tau to parameter conversion +setMethod("iTau", signature("r270GumbelCopula"), [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/vinecopula -r 104 From noreply at r-forge.r-project.org Thu Jul 30 11:06:25 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 30 Jul 2015 11:06:25 +0200 (CEST) Subject: [Vinecopula-commits] r105 - in pkg: . R inst src Message-ID: <20150730090625.929D1187AE2@r-forge.r-project.org> Author: ben_graeler Date: 2015-07-30 11:06:24 +0200 (Thu, 30 Jul 2015) New Revision: 105 Modified: pkg/DESCRIPTION pkg/R/0_prep_object.R pkg/R/BiCopSim.R pkg/R/tawnCopula.R pkg/inst/ChangeLog pkg/src/evCopula.c Log: - new version - corrected CDF functions for S4-class Tawn Copulas Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2015-07-16 14:42:51 UTC (rev 104) +++ pkg/DESCRIPTION 2015-07-30 09:06:24 UTC (rev 105) @@ -1,8 +1,8 @@ Package: VineCopula Type: Package Title: Statistical Inference of Vine Copulas -Version: 1.6 -Date: 2015-07-16 +Version: 1.7 +Date: 2015-07-30 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler, Thomas Nagler, Tobias Erhardt Maintainer: Tobias Erhardt Depends: R (>= 2.11.0) Modified: pkg/R/0_prep_object.R =================================================================== --- pkg/R/0_prep_object.R 2015-07-16 14:42:51 UTC (rev 104) +++ pkg/R/0_prep_object.R 2015-07-30 09:06:24 UTC (rev 105) @@ -148,6 +148,115 @@ PACKAGE = "VineCopula")[[6]] } +## for Tawn +# TawnC(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) +linkVineCop.CDFtawn <- function(u, copula) { + param <- copula at parameters + if (!is.matrix(u)) u <- matrix(u, ncol = 2) + u1 <- u[, 1] + u2 <- u[, 2] + n <- nrow(u) + fam <- copula at family + + if (fam == 104) { + par3 <- 1 + res <- .C("TawnC", + as.double(u1), + as.double(u2), + as.integer(n), + as.double(param[1]), + as.double(param[2]), + as.double(par3), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + if (fam == 114) { + par3 <- 1 + res <- u1 + u2 - 1 + .C("TawnC", + as.double(1-u1), + as.double(1-u2), + as.integer(n), + as.double(param[1]), + as.double(param[2]), + as.double(par3), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + if (fam == 124) { + par3 <- 1 + res <- u2 - .C("TawnC", + as.double(1-u1), + as.double(u2), + as.integer(n), + as.double(-param[1]), + as.double(param[2]), + as.double(par3), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + if (fam == 134) { + par3 <- 1 + res <- u1 - .C("TawnC", + as.double(u1), + as.double(1-u2), + as.integer(n), + as.double(-param[1]), + as.double(param[2]), + as.double(par3), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + if (fam == 204) { + par2 <- 1 + res <- .C("TawnC", + as.double(u1), + as.double(u2), + as.integer(n), + as.double(param[1]), + as.double(par2), + as.double(param[2]), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + if (fam == 214) { + par2 <- 1 + res <- u1 + u2 - 1 + .C("TawnC", + as.double(1-u1), + as.double(1-u2), + as.integer(n), + as.double(param[1]), + as.double(par2), + as.double(param[2]), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + if (fam == 224) { + par2 <- 1 + res <- u2 - .C("TawnC", + as.double(1-u1), + as.double(u2), + as.integer(n), + as.double(-param[1]), + as.double(par2), + as.double(param[2]), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + if (fam == 234) { + par2 <- 1 + res <- u1 - .C("TawnC", + as.double(u1), + as.double(1-u2), + as.integer(n), + as.double(-param[1]), + as.double(par2), + as.double(param[2]), + as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] + } + return(res) +} + ## derivtives/h-function from BiCopHfunc ddu linkVineCop.ddu <- function(u, copula) { param <- copula at parameters Modified: pkg/R/BiCopSim.R =================================================================== --- pkg/R/BiCopSim.R 2015-07-16 14:42:51 UTC (rev 104) +++ pkg/R/BiCopSim.R 2015-07-30 09:06:24 UTC (rev 105) @@ -98,18 +98,18 @@ stop("Please choose 'par2' of the Tawn copula in [0,1].") ## simulate data - if (!any(family %in% c(2, 7:10, 17:20, 27:30, 37:40, 104, 114, 124, 134, 204, 214, 224, 234))) { - # one-parameter families - tmp <- .C("pcc", - as.integer(N), - as.integer(2), - as.integer(family), - as.integer(1), - as.double(par), - as.double(0), - as.double(rep(0, N * 2)), - PACKAGE = "VineCopula")[[7]] - } else { +# if (!any(family %in% c(2, 7:10, 17:20, 27:30, 37:40, 104, 114, 124, 134, 204, 214, 224, 234))) { +# # one-parameter families +# tmp <- .C("pcc", +# as.integer(N), +# as.integer(2), +# as.integer(family), +# as.integer(1), +# as.double(par), +# as.double(0), +# as.double(rep(0, N * 2)), +# PACKAGE = "VineCopula")[[7]] +# } else { # two-parameter families tmp <- .C("pcc", as.integer(N), @@ -120,7 +120,7 @@ as.double(par2), as.double(rep(0, N * 2)), PACKAGE = "VineCopula")[[7]] - } + # } ## return results U <- matrix(tmp, ncol = 2) Modified: pkg/R/tawnCopula.R =================================================================== --- pkg/R/tawnCopula.R 2015-07-16 14:42:51 UTC (rev 104) +++ pkg/R/tawnCopula.R 2015-07-30 09:06:24 UTC (rev 105) @@ -43,9 +43,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","tawnT1Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","tawnT1Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","tawnT1Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu @@ -98,9 +98,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","surTawnT1Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","surTawnT1Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","surTawnT1Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu @@ -153,9 +153,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","r90TawnT1Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","r90TawnT1Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","r90TawnT1Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu @@ -208,9 +208,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","r270TawnT1Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","r270TawnT1Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","r270TawnT1Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu @@ -265,9 +265,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","tawnT2Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","tawnT2Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","tawnT2Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu @@ -320,9 +320,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","surTawnT2Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","surTawnT2Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","surTawnT2Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu @@ -375,9 +375,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","r90TawnT2Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","r90TawnT2Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","r90TawnT2Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu @@ -430,9 +430,9 @@ ## jcdf ## setMethod("pCopula", signature("numeric","r270TawnT2Copula"), function(u, copula, ...) { - linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + linkVineCop.CDFtawn(matrix(u,ncol=copula at dimension),copula) }) -setMethod("pCopula", signature("matrix","r270TawnT2Copula"), linkVineCop.CDF) +setMethod("pCopula", signature("matrix","r270TawnT2Copula"), linkVineCop.CDFtawn) ## partial derivatives ## # ddu Modified: pkg/inst/ChangeLog =================================================================== --- pkg/inst/ChangeLog 2015-07-16 14:42:51 UTC (rev 104) +++ pkg/inst/ChangeLog 2015-07-30 09:06:24 UTC (rev 105) @@ -4,6 +4,10 @@ Former authors: Eike Brechmann and Jakob Stoeber Maintainer: Tobias Erhardt and Thomas Nagler +Version 1.7 (July 30, 2015) +- Bug fix: + * The S4-class objets of the Tawn copulas pointed to Archimedean CDFs, now corrected to true CDFs based on c-code + Version 1.6 (July 16, 2015) - Imports Modified: pkg/src/evCopula.c =================================================================== --- pkg/src/evCopula.c 2015-07-16 14:42:51 UTC (rev 104) +++ pkg/src/evCopula.c 2015-07-30 09:06:24 UTC (rev 105) @@ -1,323 +1,326 @@ -#include "include/vine.h" -#include "include/evCopula.h" -#include - -#define UMAX 1-1e-10 - -#define UMIN 1e-10 - -#define XEPS 1e-4 - -// Some function for the Tawn copula -// (theory based on the extreme value copulas) -// Reference: See help (some master thesis) - -// for the calculation of the density as well as for the h-function we need some help functions -// the naming of the functions is due to the notation of the master thesis (and also references therein) - -// CDF - -/////////////////////////////////// -// -// Input: -// t t-vector -// n number of observations -// par first parameter -// par2 second parameter -// par3 third parameter -// -// Output: -// out ta -////////////////////////////// - -void ta(double* t, int* n, double* par, double* par2, double* par3, double* out) //for CDF -{ - int i=0; - double t1,t2; - for(i=0; i<*n;i++) - { - t1=pow(*par2*t[i],*par); - t2=pow(*par3*(1.0-t[i]),*par); - out[i]=t1+t2; - } -} - -//ta<-function(t,par,par2,par3) {(par2*t)^par+(par3*(1-t))^par} - -//////////////////////////////////////////////// -// Pickands A for the Tawn copula -// Input: -// t t-vector -// n number of observations -// par first parameter -// par2 second parameter -// par3 third parameter -// -// Output: -// out Pickands A for the Tawn copula -////////////////////////////// - -void Tawn(double* t, int* n, double* par, double* par2, double* par3, double* out) //für CDF -{ - int i=0, T=1; - double t1,t2,t3,t4; - for(i=0; i<*n;i++) - { - t1=(1.0-*par3)*(1.0-t[i]); - t2=(1.0-*par2)*t[i]; - ta(t, &T, par, par2, par3, &t3); - t4=pow(t3,1.0/(*par)); - out[i]=t1+t2+t4; - } -} - -//Tawn<-function(t,par,par2,par3) {(1-par3)*(1-t)+(1-par2)*t+ta(t,par,par2,par3)^(1/par)} - -//////////////////////////////////////////////////// -// CDF of Tawn -// Input: -// t t-vector -// n number of observations -// par first parameter -// par2 second parameter -// par3 third parameter -// -// Output: -// out CDF -///////////////////////////////////////////////////// - - -void TawnCDF(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) // CDF-function -{ - int i=0, T=1; - double w, A; - for(i=0; i<*n;i++) - { - w=log(v[i])/log(u[i]*v[i]); // w vector - Tawn(&w, &T, par, par2, par3, &A); //Pickands A - out[i]=pow(u[i]*v[i],A); // CDF - } -} - - -////////////////////////////////////////////////////////////////// -// PDF - -// some more help function for the PDF -// see reference for details - -void ta2(double* t, int* n, double* par, double* par2, double* par3, double* out) //für PDF -{ - int i=0; - double t1,t2; - for(i=0; i<*n;i++) - { - t1=pow(*par3*t[i],*par); - t2=pow(*par2*(1.0-t[i]),*par); - out[i]=t1+t2; - } -} - -// something like the first derivative of the ta function - -void d1ta(double* t, int* n, double* par, double* par2, double* par3, double* out) //für PDF -{ - int i=0; - double t1,t2; - for(i=0; i<*n;i++) - { - t1=*par3 * pow((*par3*t[i]),*par-1.0); - t2=*par2 * pow(*par2*(1.0-t[i]),*par-1.0); - out[i]=*par*(t1-t2); - } -} - -//d1ta<-function(t,par,par2,par3) {par*(par3*(par3*t)^(par-1)-par2*(par2*(1-t))^(par-1))} - -void d2ta(double* t, int* n, double* par, double* par2, double* par3, double* out) //für PDF -{ - int i=0; - double t1,t2; - for(i=0; i<*n;i++) - { - t1=pow(*par3,2) * pow(*par3*t[i],*par-2.0); - t2=pow(*par2,2) * pow(*par2*(1.0-t[i]),*par-2.0); - out[i]=*par*(*par-1) * (t1 + t2); - } -} - -//d2ta<-function(t,par,par2,par3) {par*(par-1)*(par3^2*(par3*t)^(par-2)+par2^2*(par2*(1-t))^(par-2))} - -// I guess this was some kind of derivative of A (I don't remember, see master thesis) -void Tawn2(double* t, int* n, double* par, double* par2, double* par3, double* out) //für PDF -{ - int i=0, T=1; - double t1,t2,t3,t4; - for(i=0; i<*n;i++) - { - t1=(1.0-*par2)*(1.0-t[i]); - t2=(1.0-*par3)*t[i]; - ta2(&t[i], &T, par, par2, par3, &t3); //!!! - t4=pow(t3,1.0/(*par)); - out[i]=t1+t2+t4; - } -} - -//Tawn<-function(t,par,par2,par3) {(1-par2)*(1-t)+(1-par3)*t+ta(t,par,par2,par3)^(1/par)} - -void d1Tawn(double* t, int* n, double* par, double* par2, double* par3, double* out) //für PDF -{ - int i=0, T=1; - double t2,t1; - for(i=0; i<*n;i++) - { - ta2(&t[i], &T, par, par2, par3, &t1); //!! - d1ta(&t[i], &T, par, par2, par3, &t2); - out[i]=*par2-*par3+1.0/(*par) * pow(t1,(1.0/(*par)-1.0)) * t2; - } -} - -//d1Tawn<-function(t,par,par2,par3) {par2-par3+1/par*ta(t,par,par2,par3)^(1/par-1)*d1ta(t,par,par2,par3)} Wie in Afunc2Deriv - -void d2Tawn(double* t, int* n, double* par, double* par2, double* par3, double* out) //für PDF -{ - int i=0, T=1; - double t2,t1,t3; - for(i=0; i<*n;i++) - { - ta2(&t[i], &T, par, par2, par3, &t1); //!! - d1ta(&t[i], &T, par, par2, par3, &t2); - d2ta(&t[i], &T, par, par2, par3, &t3); - out[i] = 1.0/(*par) * ( (1.0/(*par)-1.0) * pow(t1,(1.0/(*par)-2)) * pow(t2,2) + pow(t1,(1.0/(*par)-1)) * t3 ); - } -} - -//d2Tawn<-function(t,par,par2,par3) {1/par*((1/par-1)*ta(t,par,par2,par3)^(1/par-2)*d1ta(t,par,par2,par3)^2+ta(t,par,par2,par3)^(1/par-1)*d2ta(t,par,par2,par3))} - -// Ableitung von A nach u -// derivative of A with respect to u (first argument) -// needed for the derivative of c with respect to u -void dA_du(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) -{ - int i=0, T=1; - double dA, dw, w; - for(i=0; i<*n;i++) - { - w=log(v[i]) / log(u[i]*v[i]); - dw=-log(v[i]) / (u[i]*pow(log(u[i]*v[i]),2.0)); - d1Tawn(&w, &T, par, par2, par3, &dA); - out[i]=dA*dw; - } -} - -//dA_du<-function(u,v,par,par2,par3) {evcBiCopAfuncDeriv(w(u,v),fam,par,par2,par3)*dw_du(u,v)} - -// derivative of A with respect to v - -void dA_dv(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) -{ - int i=0, T=1; - double dA, dw, w; - for(i=0; i<*n;i++) - { - w=log(v[i])/log(u[i]*v[i]); - dw=1.0 / (v[i]*log(u[i]*v[i])) - log(v[i]) / (v[i]*pow(log(u[i]*v[i]),2)); - d1Tawn(&w, &T, par, par2, par3, &dA); - out[i]=dA*dw; - } -} - -// second derivative with respect to u and v - -void dA_dudv(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) -{ - int i=0, T=1; - double dA, dw_dv, dw_du, w, d2w_dudv, d2A; - for(i=0; i<*n;i++) - { - w=log(v[i])/log(u[i]*v[i]); - dw_du=-log(v[i])/(u[i]*pow(log(u[i]*v[i]),2)); - dw_dv=1.0 / (v[i]*log(u[i]*v[i])) - log(v[i]) / (v[i]*pow(log(u[i]*v[i]),2)); - d2w_dudv = 2*log(v[i]) / (v[i]*u[i]*pow(log(u[i]*v[i]),3)) - 1.0 / (v[i]*u[i]*pow(log(u[i]*v[i]),2)); - d1Tawn(&w, &T, par, par2, par3, &dA); - d2Tawn(&w, &T, par, par2, par3, &d2A); - out[i]=d2A*dw_dv*dw_du + dA*d2w_dudv; - } -} - -//d2A_dudv<-function(u,v,par,par2,par3) {evcBiCopAfunc2Deriv(w(u,v),fam,par,par2,par3)*dw_dv(u,v)*dw_du(u,v)+evcBiCopAfuncDeriv(w(u,v),fam,par,par2,par3)*d2w_dudv(u,v)} - - -void TawnC(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) // für PDF -{ - int i=0, T=1; - double w, A; - for(i=0; i<*n;i++) - { - w=log(v[i])/log(u[i]*v[i]); - Tawn2(&w, &T, par, par2, par3, &A); //!!! - out[i]=pow(u[i]*v[i],A); - } -} - -// Ableitung von C nach u -// derivative of PDF with respect to u -void dC_du(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) -{ - int i=0, T=1; - double w, A, C, dA; - for(i=0; i<*n;i++) - { - w=log(v[i])/log(u[i]*v[i]); - Tawn2(&w, &T, par, par2, par3, &A); //!! - TawnC(&u[i], &v[i], &T, par, par2, par3, &C); //!! - dA_du(&u[i], &v[i], &T, par, par2, par3, &dA); - out[i]=C * (1.0 / u[i] * A + log(u[i]*v[i])*dA); - } -} - -//dC_du<-function(u,v,par,par2,par3) {C(u,v,par,par2,par3) * (1/u*evcBiCopAfunc(w(u,v),fam,par,par2,par3)+log(u*v) * dA_du(u,v,par,par2,par3))} - -void TawnPDF(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) -{ - int i=0, T=1; - double w, A, dC, t3, t4, t1, C, t5, t2; - for(i=0; i<*n;i++) - { - w=log(v[i])/log(u[i]*v[i]); - Tawn2(&w, n, par, par2, par3, &A); - dC_du(&u[i], &v[i], &T, par, par2, par3, &dC); - dA_du(&u[i], &v[i], &T, par, par2, par3, &t3); - dA_dv(&u[i], &v[i], &T, par, par2, par3, &t4); - t1=dC * (1.0/v[i] * A + log(u[i]*v[i]) * t4); - TawnC(&u[i], &v[i], &T, par, par2, par3, &C); - dA_dudv(&u[i], &v[i], &T, par, par2, par3, &t5); - t2=C * (1.0/u[i]*t4 + 1.0/v[i]*t3 + log(u[i]*v[i])*t5); - out[i]=t1+t2; - } -} - - -// d2C_dvdu<-function(u,v,par,par2,par3) -// { -// dC_du(u,v,par,par2,par3)*(1/v*evcBiCopAfunc(w(u,v),fam,par,par2,par3) + log(u*v)*dA_dv(u,v,par,par2,par3))+ -// C(u,v,par,par2,par3)* -// (1/u*dA_dv(u,v,par,par2,par3) + 1/v*dA_du(u,v,par,par2,par3)+log(u*v)*d2A_dudv(u,v,par,par2,par3)) -// } - - -// Ableitung von C nach v (fuer h-function) -// derivative of PDF with respect to v (for h-func) -void dC_dv(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) -{ - int i=0, T=1; - double w, A, C, dA; - for(i=0; i<*n;i++) - { - w=log(v[i])/log(u[i]*v[i]); - Tawn2(&w, &T, par, par2, par3, &A); //!! - TawnC(&u[i], &v[i], &T, par, par2, par3, &C); //!! - dA_dv(&u[i], &v[i], &T, par, par2, par3, &dA); - out[i]=C * (1.0 / v[i] * A + log(u[i]*v[i])*dA); - } +#include "include/vine.h" +#include "include/evCopula.h" +#include + +#define UMAX 1-1e-10 + +#define UMIN 1e-10 + +#define XEPS 1e-4 + +// Some function for the Tawn copula +// (theory based on the extreme value copulas) +// Reference: See help (some master thesis) + +// for the calculation of the density as well as for the h-function we need some help functions +// the naming of the functions is due to the notation of the master thesis (and also references therein) + +// CDF + +/////////////////////////////////// +// +// Input: +// t t-vector +// n number of observations +// par first parameter +// par2 second parameter +// par3 third parameter +// +// Output: +// out ta +////////////////////////////// + +void ta(double* t, int* n, double* par, double* par2, double* par3, double* out) //for CDF +{ + int i=0; + double t1,t2; + for(i=0; i<*n;i++) + { + t1=pow(*par2*t[i],*par); + t2=pow(*par3*(1.0-t[i]),*par); + out[i]=t1+t2; + } +} + +//ta<-function(t,par,par2,par3) {(par2*t)^par+(par3*(1-t))^par} + +//////////////////////////////////////////////// +// Pickands A for the Tawn copula +// Input: +// t t-vector +// n number of observations +// par first parameter +// par2 second parameter +// par3 third parameter +// +// Output: +// out Pickands A for the Tawn copula +////////////////////////////// + +void Tawn(double* t, int* n, double* par, double* par2, double* par3, double* out) //f?r CDF +{ + int i=0, T=1; + double t1,t2,t3,t4; + for(i=0; i<*n;i++) + { + t1=(1.0-*par3)*(1.0-t[i]); + t2=(1.0-*par2)*t[i]; + ta(t, &T, par, par2, par3, &t3); + t4=pow(t3,1.0/(*par)); + out[i]=t1+t2+t4; + } +} + +//Tawn<-function(t,par,par2,par3) {(1-par3)*(1-t)+(1-par2)*t+ta(t,par,par2,par3)^(1/par)} + +//////////////////////////////////////////////////// +// CDF of Tawn +// Input: +// t t-vector +// n number of observations +// par first parameter +// par2 second parameter +// par3 third parameter +// +// Output: +// out CDF +///////////////////////////////////////////////////// + + +void TawnCDF(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) // CDF-function +{ + int i=0, T=1; + double w, A; + for(i=0; i<*n;i++) + { + w=log(v[i])/log(u[i]*v[i]); // w vector + Tawn(&w, &T, par, par2, par3, &A); //Pickands A + out[i]=pow(u[i]*v[i],A); // CDF + } +} + + +////////////////////////////////////////////////////////////////// +// PDF + +// some more help function for the PDF +// see reference for details + +void ta2(double* t, int* n, double* par, double* par2, double* par3, double* out) //f?r PDF +{ + int i=0; + double t1,t2; + for(i=0; i<*n;i++) + { + t1=pow(*par3*t[i],*par); + t2=pow(*par2*(1.0-t[i]),*par); + out[i]=t1+t2; + } +} + + +// something like the first derivative of the ta function + +void d1ta(double* t, int* n, double* par, double* par2, double* par3, double* out) //f?r PDF +{ + int i=0; + double t1,t2; + for(i=0; i<*n;i++) + { + t1=*par3 * pow((*par3*t[i]),*par-1.0); + t2=*par2 * pow(*par2*(1.0-t[i]),*par-1.0); + out[i]=*par*(t1-t2); + } +} + +//d1ta<-function(t,par,par2,par3) {par*(par3*(par3*t)^(par-1)-par2*(par2*(1-t))^(par-1))} + +void d2ta(double* t, int* n, double* par, double* par2, double* par3, double* out) //f?r PDF +{ + int i=0; + double t1,t2; + for(i=0; i<*n;i++) + { + t1=pow(*par3,2) * pow(*par3*t[i],*par-2.0); + t2=pow(*par2,2) * pow(*par2*(1.0-t[i]),*par-2.0); + out[i]=*par*(*par-1) * (t1 + t2); + } +} + +//d2ta<-function(t,par,par2,par3) {par*(par-1)*(par3^2*(par3*t)^(par-2)+par2^2*(par2*(1-t))^(par-2))} + +// I guess this was some kind of derivative of A (I don't remember, see master thesis) +// looks like a change in parameters: par2 <-> par3, a parallel version to the definition +// of Tawn above, as for all ...2 versions +void Tawn2(double* t, int* n, double* par, double* par2, double* par3, double* out) //for PDF +{ + int i=0, T=1; + double t1,t2,t3,t4; + for(i=0; i<*n;i++) + { + t1=(1.0-*par2)*(1.0-t[i]); + t2=(1.0-*par3)*t[i]; + ta2(&t[i], &T, par, par2, par3, &t3); //!!! + t4=pow(t3,1.0/(*par)); + out[i]=t1+t2+t4; + } +} + +//Tawn<-function(t,par,par2,par3) {(1-par2)*(1-t)+(1-par3)*t+ta(t,par,par2,par3)^(1/par)} + +void d1Tawn(double* t, int* n, double* par, double* par2, double* par3, double* out) //for PDF +{ + int i=0, T=1; + double t2,t1; + for(i=0; i<*n;i++) + { + ta2(&t[i], &T, par, par2, par3, &t1); //!! + d1ta(&t[i], &T, par, par2, par3, &t2); + out[i]=*par2-*par3+1.0/(*par) * pow(t1,(1.0/(*par)-1.0)) * t2; + } +} + +//d1Tawn<-function(t,par,par2,par3) {par2-par3+1/par*ta(t,par,par2,par3)^(1/par-1)*d1ta(t,par,par2,par3)} Wie in Afunc2Deriv + +void d2Tawn(double* t, int* n, double* par, double* par2, double* par3, double* out) //f?r PDF +{ + int i=0, T=1; + double t2,t1,t3; + for(i=0; i<*n;i++) + { + ta2(&t[i], &T, par, par2, par3, &t1); //!! + d1ta(&t[i], &T, par, par2, par3, &t2); + d2ta(&t[i], &T, par, par2, par3, &t3); + out[i] = 1.0/(*par) * ( (1.0/(*par)-1.0) * pow(t1,(1.0/(*par)-2)) * pow(t2,2) + pow(t1,(1.0/(*par)-1)) * t3 ); + } +} + +//d2Tawn<-function(t,par,par2,par3) {1/par*((1/par-1)*ta(t,par,par2,par3)^(1/par-2)*d1ta(t,par,par2,par3)^2+ta(t,par,par2,par3)^(1/par-1)*d2ta(t,par,par2,par3))} + +// Ableitung von A nach u +// derivative of A with respect to u (first argument) +// needed for the derivative of c with respect to u +void dA_du(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) +{ + int i=0, T=1; + double dA, dw, w; + for(i=0; i<*n;i++) + { + w=log(v[i]) / log(u[i]*v[i]); + dw=-log(v[i]) / (u[i]*pow(log(u[i]*v[i]),2.0)); + d1Tawn(&w, &T, par, par2, par3, &dA); + out[i]=dA*dw; + } +} + +//dA_du<-function(u,v,par,par2,par3) {evcBiCopAfuncDeriv(w(u,v),fam,par,par2,par3)*dw_du(u,v)} + +// derivative of A with respect to v + +void dA_dv(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) +{ + int i=0, T=1; + double dA, dw, w; + for(i=0; i<*n;i++) + { + w=log(v[i])/log(u[i]*v[i]); + dw=1.0 / (v[i]*log(u[i]*v[i])) - log(v[i]) / (v[i]*pow(log(u[i]*v[i]),2)); + d1Tawn(&w, &T, par, par2, par3, &dA); + out[i]=dA*dw; + } +} + +// second derivative with respect to u and v + +void dA_dudv(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) +{ + int i=0, T=1; + double dA, dw_dv, dw_du, w, d2w_dudv, d2A; + for(i=0; i<*n;i++) + { + w=log(v[i])/log(u[i]*v[i]); + dw_du=-log(v[i])/(u[i]*pow(log(u[i]*v[i]),2)); + dw_dv=1.0 / (v[i]*log(u[i]*v[i])) - log(v[i]) / (v[i]*pow(log(u[i]*v[i]),2)); + d2w_dudv = 2*log(v[i]) / (v[i]*u[i]*pow(log(u[i]*v[i]),3)) - 1.0 / (v[i]*u[i]*pow(log(u[i]*v[i]),2)); + d1Tawn(&w, &T, par, par2, par3, &dA); + d2Tawn(&w, &T, par, par2, par3, &d2A); + out[i]=d2A*dw_dv*dw_du + dA*d2w_dudv; + } +} + +//d2A_dudv<-function(u,v,par,par2,par3) {evcBiCopAfunc2Deriv(w(u,v),fam,par,par2,par3)*dw_dv(u,v)*dw_du(u,v)+evcBiCopAfuncDeriv(w(u,v),fam,par,par2,par3)*d2w_dudv(u,v)} + + +void TawnC(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) // CDF for PDF +{ + int i=0, T=1; + double w, A; + for(i=0; i<*n;i++) + { + w=log(v[i])/log(u[i]*v[i]); + Tawn2(&w, &T, par, par2, par3, &A); //!!! + out[i]=pow(u[i]*v[i],A); + } +} + +// Ableitung von C nach u +// derivative of PDF with respect to u +void dC_du(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) +{ + int i=0, T=1; + double w, A, C, dA; + for(i=0; i<*n;i++) + { + w=log(v[i])/log(u[i]*v[i]); + Tawn2(&w, &T, par, par2, par3, &A); //!! + TawnC(&u[i], &v[i], &T, par, par2, par3, &C); //!! + dA_du(&u[i], &v[i], &T, par, par2, par3, &dA); + out[i]=C * (1.0 / u[i] * A + log(u[i]*v[i])*dA); + } +} + +//dC_du<-function(u,v,par,par2,par3) {C(u,v,par,par2,par3) * (1/u*evcBiCopAfunc(w(u,v),fam,par,par2,par3)+log(u*v) * dA_du(u,v,par,par2,par3))} + +void TawnPDF(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) +{ + int i=0, T=1; + double w, A, dC, t3, t4, t1, C, t5, t2; + for(i=0; i<*n;i++) + { + w=log(v[i])/log(u[i]*v[i]); + Tawn2(&w, n, par, par2, par3, &A); + dC_du(&u[i], &v[i], &T, par, par2, par3, &dC); + dA_du(&u[i], &v[i], &T, par, par2, par3, &t3); + dA_dv(&u[i], &v[i], &T, par, par2, par3, &t4); + t1=dC * (1.0/v[i] * A + log(u[i]*v[i]) * t4); + TawnC(&u[i], &v[i], &T, par, par2, par3, &C); + dA_dudv(&u[i], &v[i], &T, par, par2, par3, &t5); + t2=C * (1.0/u[i]*t4 + 1.0/v[i]*t3 + log(u[i]*v[i])*t5); + out[i]=t1+t2; + } +} + + +// d2C_dvdu<-function(u,v,par,par2,par3) +// { +// dC_du(u,v,par,par2,par3)*(1/v*evcBiCopAfunc(w(u,v),fam,par,par2,par3) + log(u*v)*dA_dv(u,v,par,par2,par3))+ +// C(u,v,par,par2,par3)* +// (1/u*dA_dv(u,v,par,par2,par3) + 1/v*dA_du(u,v,par,par2,par3)+log(u*v)*d2A_dudv(u,v,par,par2,par3)) +// } + + +// Ableitung von C nach v (fuer h-function) +// derivative of PDF with respect to v (for h-func) +void dC_dv(double* u, double* v, int* n, double* par, double* par2, double* par3, double* out) +{ + int i=0, T=1; + double w, A, C, dA; + for(i=0; i<*n;i++) + { + w=log(v[i])/log(u[i]*v[i]); + Tawn2(&w, &T, par, par2, par3, &A); //!! + TawnC(&u[i], &v[i], &T, par, par2, par3, &C); //!! + dA_dv(&u[i], &v[i], &T, par, par2, par3, &dA); + out[i]=C * (1.0 / v[i] * A + log(u[i]*v[i])*dA); + } } \ No newline at end of file From noreply at r-forge.r-project.org Thu Jul 30 15:09:52 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 30 Jul 2015 15:09:52 +0200 (CEST) Subject: [Vinecopula-commits] r106 - in pkg: R inst man tests tests/Examples Message-ID: <20150730130952.3EE521813D4@r-forge.r-project.org> Author: etobi Date: 2015-07-30 15:09:51 +0200 (Thu, 30 Jul 2015) New Revision: 106 Modified: pkg/R/RVineCopSelect.r pkg/R/TauMatrix.r pkg/inst/ChangeLog pkg/man/RVineCopSelect.Rd pkg/man/VineCopula-package.Rd pkg/tests/Examples/VineCopula-Ex.Rout.save pkg/tests/additonalExampleRuns.R pkg/tests/additonalExampleRuns.Rout.save Log: * TauMatrix: restriction for input data to be in [0,1] removed * RVineCopSelect: no printing of family-Matrix Modified: pkg/R/RVineCopSelect.r =================================================================== --- pkg/R/RVineCopSelect.r 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/R/RVineCopSelect.r 2015-07-30 13:09:51 UTC (rev 106) @@ -123,7 +123,6 @@ } ## return results - print(Types) RVM <- RVineMatrix(Mold, family = Types, par = Params, Modified: pkg/R/TauMatrix.r =================================================================== --- pkg/R/TauMatrix.r 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/R/TauMatrix.r 2015-07-30 13:09:51 UTC (rev 106) @@ -15,8 +15,8 @@ TauMatrix <- function(data, weights = NA) { data <- as.matrix(data) if (any(is.na(weights))) { - if (any(data > 1) || any(data < 0)) - stop("Data has be in the interval [0,1].") + # if (any(data > 1) || any(data < 0)) + # stop("Data has be in the interval [0,1].") d <- dim(data)[2] N <- dim(data)[1] Modified: pkg/inst/ChangeLog =================================================================== --- pkg/inst/ChangeLog 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/inst/ChangeLog 2015-07-30 13:09:51 UTC (rev 106) @@ -7,6 +7,8 @@ Version 1.7 (July 30, 2015) - Bug fix: * The S4-class objets of the Tawn copulas pointed to Archimedean CDFs, now corrected to true CDFs based on c-code + * TauMatrix: restriction for input data to be in [0,1] removed + * RVineCopSelect: no printing of family-Matrix Version 1.6 (July 16, 2015) Modified: pkg/man/RVineCopSelect.Rd =================================================================== --- pkg/man/RVineCopSelect.Rd 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/man/RVineCopSelect.Rd 2015-07-30 13:09:51 UTC (rev 106) @@ -135,6 +135,7 @@ # determine the pair-copula families and parameters RVM1 <- RVineCopSelect(simdata, familyset = c(1, 3, 4, 5 ,6), Matrix) - +RVM1$family +round(RVM1$par, 2) } Modified: pkg/man/VineCopula-package.Rd =================================================================== --- pkg/man/VineCopula-package.Rd 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/man/VineCopula-package.Rd 2015-07-30 13:09:51 UTC (rev 106) @@ -79,8 +79,8 @@ \tabular{ll}{ Package: \tab VineCopula\cr Type: \tab Package\cr -Version: \tab 1.6\cr -Date: \tab 2015-07-16\cr +Version: \tab 1.7\cr +Date: \tab 2015-07-30\cr License: \tab GPL (>=2)\cr Depends: \tab R (\eqn{\geq 2.11.0}{>= 2.11.0})\cr Imports: \tab graphics, grDevices, stats, utils, MASS, mvtnorm, igraph (>= 1.0.0), methods, copula, ADGofTest, lattice\cr Modified: pkg/tests/Examples/VineCopula-Ex.Rout.save =================================================================== --- pkg/tests/Examples/VineCopula-Ex.Rout.save 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/tests/Examples/VineCopula-Ex.Rout.save 2015-07-30 13:09:51 UTC (rev 106) @@ -1,5 +1,5 @@ -R Under development (unstable) (2015-06-01 r68455) -- "Unsuffered Consequences" +R Under development (unstable) (2015-07-14 r68652) -- "Unsuffered Consequences" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) @@ -20,6 +20,7 @@ > pkgname <- "VineCopula" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) +> options(pager = "console") > library('VineCopula') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') @@ -1059,7 +1060,7 @@ [1,] 0.001776255 > -> # perform Kendall's goodness-of-fit test for the Frank copula +> # perform White's goodness-of-fit test for the Frank copula > BiCopGofTest(u1, u2, family = 5) $p.value [,1] @@ -2659,6 +2660,17 @@ Loading required package: mvtnorm Loading required package: igraph +Attaching package: 'igraph' + +The following objects are masked from 'package:stats': + + decompose, spectrum + +The following object is masked from 'package:base': + + union + + Attaching package: 'CDVine' The following objects are masked from 'package:VineCopula': @@ -2716,6 +2728,17 @@ Loading required package: mvtnorm Loading required package: igraph +Attaching package: 'igraph' + +The following objects are masked from 'package:stats': + + decompose, spectrum + +The following object is masked from 'package:base': + + union + + Attaching package: 'CDVine' The following objects are masked from 'package:VineCopula': @@ -3525,10 +3548,10 @@ > plot(pit[,1], pit[,2]) # i.i.d. data > > cor(pit, method = "kendall") - [,1] [,2] [,3] -[1,] 1.0000000000 0.0005717246 0.012654071 -[2,] 0.0005717246 1.0000000000 0.004443927 -[3,] 0.0126540708 0.0044439270 1.000000000 + [,1] [,2] [,3] +[1,] 1.000000000 0.010346274 0.002073435 +[2,] 0.010346274 1.000000000 -0.002745174 +[3,] 0.002073435 -0.002745174 1.000000000 > > > @@ -3882,9 +3905,9 @@ > # using only the first 4 variables and the first 750 observations > # we allow for the copula families: Gauss, t, Clayton, Gumbel, Frank and Joe > RVM <- RVineStructureSelect(daxreturns[1:750,1:4], c(1:6), progress = TRUE) -ALV.DE + BAYN.DE --> ALV.DE,BAYN.DE | BAS.DE -BAS.DE + BMW.DE --> BAS.DE,BMW.DE | ALV.DE -BAYN.DE + BMW.DE --> BAYN.DE,BMW.DE | ALV.DE,BAS.DE +ALV.DE + BAYN.DE --> ALV.DE,BAYN.DE ; BAS.DE +BAS.DE + BMW.DE --> BAS.DE,BMW.DE ; ALV.DE +BAYN.DE + BMW.DE --> BAYN.DE,BMW.DE ; ALV.DE,BAS.DE > > ## Not run: > ##D # specify a C-vine copula model with only Clayton, Gumbel and Frank copulas (time-consuming) @@ -4476,7 +4499,7 @@ U else 1 - U } - + > > ## simulate data from a multivariate normal distribution @@ -4885,7 +4908,7 @@ > ### > options(digits = 7L) > base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n") -Time elapsed: 29.64 0.22 30.2 NA NA +Time elapsed: 30.02 0.31 30.61 NA NA > grDevices::dev.off() null device 1 Modified: pkg/tests/additonalExampleRuns.R =================================================================== --- pkg/tests/additonalExampleRuns.R 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/tests/additonalExampleRuns.R 2015-07-30 13:09:51 UTC (rev 106) @@ -1,5 +1,5 @@ ## switch for testing the following (time consuming) examples -docheck <- TRUE +docheck <- FALSE if(docheck){ Modified: pkg/tests/additonalExampleRuns.Rout.save =================================================================== --- pkg/tests/additonalExampleRuns.Rout.save 2015-07-30 09:06:24 UTC (rev 105) +++ pkg/tests/additonalExampleRuns.Rout.save 2015-07-30 13:09:51 UTC (rev 106) @@ -1,5 +1,5 @@ -R Under development (unstable) (2015-06-01 r68455) -- "Unsuffered Consequences" +R Under development (unstable) (2015-07-14 r68652) -- "Unsuffered Consequences" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) @@ -16,7 +16,7 @@ Type 'q()' to quit R. > ## switch for testing the following (time consuming) examples -> docheck <- TRUE +> docheck <- FALSE > > if(docheck){ + @@ -180,526 +180,7 @@ + # End(Not run) + + } -iter 10 value -1200.442272 -iter 20 value -1200.472686 -iter 30 value -1200.633714 -iter 40 value -1200.636616 -iter 50 value -1200.646056 -iter 60 value -1200.657357 -iter 70 value -1200.668755 -iter 80 value -1200.696709 -iter 90 value -1200.720665 -final value -1200.721005 -converged - -Attaching package: 'copula' - -The following object is masked from 'package:VineCopula': - - fitCopula - - [,1] [,2] [,3] [,4] - [1,] 0.287577520 0.7883051354 0.408976922 0.883017404 - [2,] 0.940467284 0.0455564994 0.528105488 0.892419044 - [3,] 0.551435014 0.4566147353 0.956833345 0.453334156 - [4,] 0.677570635 0.5726334020 0.102924683 0.899824970 - [5,] 0.246087734 0.0420595335 0.327920719 0.954503649 - [6,] 0.889539316 0.6928034062 0.640506814 0.994269777 - [7,] 0.655705799 0.7085304682 0.544066025 0.594142020 - [8,] 0.289159737 0.1471136473 0.963024233 0.902299045 - [9,] 0.690705278 0.7954674177 0.024613685 0.477795971 - [10,] 0.758459538 0.2164079358 0.318181008 0.231625785 - [11,] 0.142800022 0.4145463358 0.413724326 0.368845451 - [12,] 0.152444748 0.1388060634 0.233034099 0.465962450 - [13,] 0.265972640 0.8578277153 0.045831167 0.442200074 - [14,] 0.798924846 0.1218992600 0.560947984 0.206531390 - [15,] 0.127531650 0.7533078643 0.895045359 0.374462776 - [16,] 0.665115195 0.0948406609 0.383969638 0.274383645 - [17,] 0.814640039 0.4485163414 0.810064353 0.812389510 - [18,] 0.794342321 0.4398316876 0.754475159 0.629221132 - [19,] 0.710182401 0.0006247733 0.475316574 0.220118885 - [20,] 0.379816538 0.6127710033 0.351797909 0.111135424 - [21,] 0.243619473 0.6680555874 0.417646780 0.788195834 - [22,] 0.102864644 0.4348927415 0.984956980 0.893051114 - [23,] 0.886469061 0.1750526503 0.130695692 0.653101925 - [24,] 0.343516472 0.6567581280 0.320373242 0.187691119 - [25,] 0.782294301 0.0935949867 0.466779042 0.511505460 - [26,] 0.599988959 0.3328235403 0.488613034 0.954473827 - [27,] 0.482902397 0.8903502221 0.914438187 0.608734982 - [28,] 0.410689777 0.1470946909 0.935299803 0.301228900 - [29,] 0.060720572 0.9477269400 0.720596273 0.142294296 - [30,] 0.549284656 0.9540912386 0.585483353 0.404510282 - [31,] 0.647893479 0.3198206171 0.307720011 0.219767631 - [32,] 0.369488866 0.9842192035 0.154202301 0.091044000 - [33,] 0.141906908 0.6900071015 0.619256483 0.891394117 - [34,] 0.672999093 0.7370777379 0.521135726 0.659838450 - [35,] 0.821805460 0.7862815517 0.979821917 0.439431536 - [36,] 0.311702202 0.4094749526 0.010467112 0.183849524 - [37,] 0.842729319 0.2311617821 0.239099956 0.076691165 - [38,] 0.245723678 0.7321352055 0.847453165 0.497527267 - [39,] 0.387909030 0.2464489941 0.111096461 0.389994435 - [40,] 0.571935314 0.2168927628 0.444768002 0.217990669 - [41,] 0.502299563 0.3539045718 0.649985159 0.374713957 - [42,] 0.355445381 0.5336879455 0.740334360 0.221102938 - [43,] 0.412746119 0.2656866868 0.629973053 0.183828491 - [44,] 0.863644111 0.7465680041 0.668284650 0.618017873 - [45,] 0.372238060 0.5298356859 0.874682343 0.581750100 - [46,] 0.839767765 0.3124481649 0.708290322 0.265017806 - [47,] 0.594343194 0.4812898005 0.265032731 0.564590435 - [48,] 0.913188223 0.9018743895 0.274166622 0.321482756 - [49,] 0.985640884 0.6199933102 0.937314089 0.466532702 - [50,] 0.406832593 0.6592303242 0.152346617 0.572867058 - [51,] 0.238726027 0.9623589364 0.601365726 0.515029727 - [52,] 0.402573342 0.8802465412 0.364091865 0.288239281 - [53,] 0.170645235 0.1721717464 0.482042606 0.252964929 - [54,] 0.216254790 0.6743763881 0.047663627 0.700853087 - [55,] 0.351888638 0.4089439979 0.820951324 0.918857348 - [56,] 0.282528330 0.9611047937 0.728394428 0.686375082 - [57,] 0.052843943 0.3952201346 0.477845380 0.560253264 - [58,] 0.698261595 0.9156835384 0.618351227 0.428421509 - [59,] 0.542080367 0.0584784886 0.260856857 0.397151953 - [60,] 0.197744737 0.8319275628 0.152887223 0.803418542 - [61,] 0.546826157 0.6623176420 0.171698494 0.633055360 - [62,] 0.311869747 0.7245543464 0.398939825 0.969356411 - [63,] 0.967398371 0.7267025390 0.257216746 0.221787935 - [64,] 0.593045652 0.2675214321 0.531070399 0.785291671 - [65,] 0.168060811 0.4043991810 0.471576278 0.868106807 - [66,] 0.925707956 0.8819775593 0.674186843 0.950166979 - [67,] 0.516444894 0.5765190213 0.336331206 0.347324631 - [68,] 0.020024301 0.5028130456 0.871043414 0.006300784 - [69,] 0.072057124 0.1642112250 0.770334074 0.735184306 - [70,] 0.971875636 0.4664723768 0.074384513 0.648818124 - [71,] 0.758593170 0.1371060810 0.396584595 0.224985329 - [72,] 0.057958561 0.3958926883 0.064928300 0.225886433 - [73,] 0.054629109 0.6702820396 0.297741783 0.100721582 - [74,] 0.071904097 0.8804405688 0.754247402 0.816605888 - [75,] 0.982140374 0.1035996450 0.099041829 0.798831611 - [76,] 0.784575267 0.0094299051 0.779065883 0.729390652 - [77,] 0.630131853 0.4809108300 0.156636851 0.008215520 - [78,] 0.452458394 0.4922933287 0.389587112 0.464665942 - [79,] 0.713279001 0.0553019263 0.354783098 0.802812273 - [80,] 0.835708837 0.2377494050 0.353986103 0.856885420 - [81,] 0.853763374 0.2958954554 0.147048325 0.703992061 - [82,] 0.103806688 0.0337277730 0.999404528 0.034874804 - [83,] 0.338391284 0.9150637616 0.617235270 0.286285349 - [84,] 0.737797403 0.8340543092 0.314270780 0.492566548 - [85,] 0.697373766 0.6414623540 0.643922915 0.977853405 - [86,] 0.414735334 0.1194047800 0.526029660 0.225073351 - [87,] 0.486411764 0.3702147985 0.983350181 0.388319115 - [88,] 0.229244840 0.6232975463 0.136540197 0.967469494 - [89,] 0.515071808 0.1630703292 0.621902295 0.985954165 - [90,] 0.668771517 0.4189158969 0.323344993 0.835255320 - [91,] 0.143817044 0.1928159469 0.896738683 0.308119554 - [92,] 0.363300544 0.7839464787 0.193378680 0.017765812 - [93,] 0.406607866 0.4831676693 0.421844950 0.342808802 - [94,] 0.866483315 0.4551080510 0.533764874 0.963843332 - [95,] 0.774591542 0.2088763486 0.308786833 0.971342450 - [96,] 0.584900093 0.7608236254 0.372709394 0.769193911 - [97,] 0.537677183 0.9139954497 0.185296442 0.282218417 - [98,] 0.094962413 0.2104870791 0.977098996 0.296302175 - [99,] 0.725983027 0.7856878343 0.105417746 0.239594629 -[100,] 0.270544872 0.1010584941 0.117913841 0.991236556 -[101,] 0.986054297 0.1370674714 0.905309582 0.576301838 -[102,] 0.395448859 0.4498024841 0.706501901 0.082502746 -[103,] 0.339312580 0.6807875512 0.316949248 0.831568598 -[104,] 0.215172083 0.4979489362 0.276049673 0.192023319 -[105,] 0.950621264 0.3217255378 0.478456384 0.027992572 -[106,] 0.547459468 0.6442402205 0.596263545 0.321937376 -[107,] 0.891114312 0.6262569474 0.302904915 0.388204664 -[108,] 0.160475092 0.8625518975 0.953101214 0.563644683 -[109,] 0.329547413 0.9966172187 0.234819676 0.612671965 -[110,] 0.108178529 0.4870325699 0.099445823 0.161165763 -[111,] 0.282992871 0.5838723360 0.731707659 0.165520911 -[112,] 0.866467763 0.7085741372 0.760399536 0.147084109 -[113,] 0.358056963 0.6733324814 0.523822602 0.349801793 -[114,] 0.240530702 0.0581917963 0.236619742 0.890077913 -[115,] 0.811827416 0.7475163222 0.154911726 0.124742089 -[116,] 0.974725808 0.4361299961 0.464016627 0.165298081 -[117,] 0.584936557 0.2707780194 0.230096920 0.691207831 -[118,] 0.282852400 0.8103980662 0.093916607 0.822030071 -[119,] 0.427428281 0.7558872597 0.662385507 0.444527397 -[120,] 0.627146184 0.0004653491 0.217243514 0.704872246 -[121,] 0.215166488 0.8139337213 0.307763874 0.687742686 -[122,] 0.932681079 0.1157796648 0.127705688 0.678223857 -[123,] 0.428948596 0.8344009779 0.971438067 0.070488978 -[124,] 0.459785193 0.7015851184 0.086940168 0.992944016 -[125,] 0.253098994 0.0495384356 0.686324947 0.786927353 -[126,] 0.353606076 0.3664414450 0.287100131 0.079972912 -[127,] 0.365454270 0.1780138146 0.536053721 0.503948712 -[128,] 0.945035103 0.3413212840 0.464713774 0.082531182 -[129,] 0.860106846 0.3956606400 0.735899350 0.171743406 -[130,] 0.454761631 0.7702047594 0.062649998 0.815081495 -[131,] 0.301142524 0.3646710280 0.312112792 0.037369965 -[132,] 0.518804923 0.6790134157 0.903233560 0.025526698 -[133,] 0.989078271 0.3028876246 0.939138401 0.687607582 -[134,] 0.447036995 0.8164781388 0.039499198 0.739031686 -[135,] 0.348719494 0.8292508235 0.535541392 0.274545364 -[136,] 0.800948212 0.0916446948 0.832107774 0.276855072 -[137,] 0.753110100 0.9641525701 0.081466560 0.854364746 -[138,] 0.802238217 0.3851736046 0.327597399 0.204938703 -[139,] 0.569382663 0.8880551904 0.529714091 0.586958657 -[140,] 0.665735143 0.5298924586 0.509842899 0.016160481 -[141,] 0.047709985 0.9293506825 0.769285539 0.201080616 -[142,] 0.650261500 0.6537666824 0.395253761 0.812304829 -[143,] 0.547023418 0.8851326515 0.553313988 0.906048112 -[144,] 0.587461367 0.4234636510 0.949585323 0.709037903 -[145,] 0.413305408 0.0183640837 0.566734083 0.490063453 -[146,] 0.878674021 0.8128526879 0.854099978 0.367895948 -[147,] 0.873949913 0.1513381714 0.281811670 0.666705158 -[148,] 0.977383577 0.5827397367 0.526590080 0.060782225 -[149,] 0.969038864 0.1202371286 0.088363301 0.880764115 -[150,] 0.508370630 0.3374949973 0.894334625 0.031971628 -[151,] 0.237229697 0.6864903511 0.225818423 0.318494588 -[152,] 0.173983817 0.8014295837 0.146282058 0.822717392 -[153,] 0.330997829 0.3741693879 0.629745424 0.096633743 -[154,] 0.021993715 0.9930447803 0.583938846 0.781823065 -[155,] 0.891896123 0.7548654536 0.979203730 0.044147068 -[156,] 0.903400885 0.8655008140 0.775407591 0.376816417 -[157,] 0.042108049 0.3644110817 0.273751270 0.850467481 -[158,] 0.362401712 0.3044777906 0.759135339 0.844834624 -[159,] 0.457921561 0.7296316645 0.104078636 0.219983178 -[160,] 0.953951248 0.7520375412 0.818955383 0.417777102 -[161,] 0.593838493 0.7988235578 0.888408650 0.385191593 -[162,] 0.090322084 0.6257436371 0.745636217 0.085378457 -[163,] 0.300517611 0.6145621573 0.752932058 0.917057133 -[164,] 0.475750506 0.5671194661 0.736620346 0.857447424 -[165,] 0.909146504 0.0563822254 0.502908304 0.350544773 -[166,] 0.845556123 0.8064351638 0.117331227 0.712686555 -[167,] 0.235268858 0.0749567512 0.935646147 0.157167825 -[168,] 0.647057350 0.1735177462 0.020074009 0.521313846 -[169,] 0.086277893 0.2830023461 0.420434901 0.587278124 -[170,] 0.806694430 0.2019952089 0.459424672 0.448143114 -[171,] 0.733747758 0.7147548106 0.831221979 0.886566121 -[172,] 0.952644574 0.5506167219 0.522335766 0.170698255 -[173,] 0.479271560 0.2538207965 0.039780637 0.634800510 -[174,] 0.539560914 0.1401035499 0.283711777 0.583030595 -[175,] 0.165025892 0.0963011107 0.428613091 0.355761566 -[176,] 0.844933540 0.2601324737 0.023144492 0.862399540 -[177,] 0.334587961 0.6317888717 0.546426259 0.376444493 -[178,] 0.185873015 0.4289405912 0.630773599 0.520842351 -[179,] 0.659621337 0.7293609313 0.486822873 0.384456616 -[180,] 0.006833509 0.0036842276 0.994936440 0.107886880 -[181,] 0.418669158 0.7178845466 0.742539132 0.871998824 -[182,] 0.607867961 0.7562033513 0.847241298 0.612779649 -[183,] 0.793224168 0.0228546835 0.416914550 0.874882387 -[184,] 0.647347016 0.9244789868 0.172225096 0.315812789 -[185,] 0.804256279 0.9889634112 0.322385552 0.001191628 -[186,] 0.992170619 0.1483523918 0.049364297 0.597353483 -[187,] 0.321328443 0.5279290003 0.795422020 0.068932597 -[188,] 0.695020697 0.9486315073 0.277769317 0.249406585 -[189,] 0.159435480 0.0716300560 0.557437583 0.489837052 -[190,] 0.494292362 0.8883715852 0.036704360 0.203743814 -[191,] 0.513781139 0.2363398890 0.575435670 0.482257911 -[192,] 0.569352689 0.1441523151 0.145708763 0.412283113 -[193,] 0.683010282 0.6534278204 0.915986333 0.813113132 -[194,] 0.675890001 0.8074991093 0.128064420 0.250778534 -[195,] 0.331546992 0.4072692899 0.635367577 0.808612045 -[196,] 0.258801201 0.8194671399 0.015477669 0.654400767 -[197,] 0.811719584 0.4613689268 0.203417102 0.018768217 -[198,] 0.283132697 0.9152726256 0.933696521 0.542531614 -[199,] 0.219422546 0.4894278040 0.801148736 0.407630658 -[200,] 0.103711567 0.2805651748 0.361466221 0.259244841 -[201,] 0.470681834 0.3658454733 0.121272054 0.046993681 -[202,] 0.262796304 0.9686411680 0.488495482 0.477822030 -[203,] 0.748792881 0.6676402313 0.049415597 0.695105244 -[204,] 0.363261567 0.8841336074 0.775297230 0.139203641 -[205,] 0.295009271 0.1260827854 0.589901624 0.561675609 -[206,] 0.688721120 0.3112708090 0.605586841 0.991034319 -[207,] 0.743204915 0.0758571303 0.451168906 0.053536935 -[208,] 0.339555514 0.7339521488 0.004106940 0.771909482 -[209,] 0.462975211 0.7208403500 0.666505717 0.572073721 -[210,] 0.703812950 0.6572210605 0.289352145 0.097239456 -[211,] 0.962421321 0.7363340291 0.612723469 0.119928881 -[212,] 0.550259046 0.2627562778 0.898360831 0.009179946 -[213,] 0.236234936 0.1300445953 0.326233147 0.726398888 -[214,] 0.991745235 0.7151335278 0.504439811 0.436047672 -[215,] 0.948825251 0.1201814876 0.075145177 0.889021493 -[216,] 0.424452095 0.0423606788 0.647442144 0.468619162 -[217,] 0.617926123 0.2708154325 0.157295287 0.114254270 -[218,] 0.507682863 0.5480322875 0.140646189 0.169769050 -[219,] 0.761985323 0.5273949406 0.860989358 0.673554988 -[220,] 0.013041030 0.6931989014 0.891713732 0.631850175 -[221,] 0.107294655 0.9210652038 0.675362381 0.148593713 -[222,] 0.745341842 0.9425988619 0.420783376 0.297723078 -[223,] 0.259426670 0.2228813169 0.565654343 0.756650133 -[224,] 0.669603546 0.5465227943 0.811463658 0.759166802 -[225,] 0.020068466 0.3809037001 0.050880114 0.797902937 -[226,] 0.923699213 0.5425983705 0.852364600 0.583562863 -[227,] 0.668323644 0.5113145965 0.762750589 0.903362288 -[228,] 0.820474512 0.0714318496 0.003896343 0.052198616 -[229,] 0.866560180 0.5762451689 0.313842572 0.959465784 -[230,] 0.591193757 0.5314093358 0.383936672 0.319553229 -[231,] 0.808386255 0.0419194985 0.363742695 0.856596967 -[232,] 0.697946578 0.6844864730 0.348015053 0.554681829 -[233,] 0.137243618 0.7849315563 0.886862572 0.204095883 -[234,] 0.770622961 0.5963629608 0.957669742 0.158688398 -[235,] 0.525974274 0.8731513675 0.869706070 0.023688643 -[236,] 0.975889693 0.4902241982 0.389170323 0.417554960 -[237,] 0.092925820 0.1618092102 0.405416495 0.341814444 -[238,] 0.415257453 0.3040524691 0.560280537 0.155874151 -[239,] 0.956579764 0.0439666254 0.372157743 0.962615341 -[240,] 0.645427516 0.0612626143 0.409945928 0.425905134 -[241,] 0.508158085 0.4495999108 0.623261384 0.139977931 -[242,] 0.907946401 0.5694432748 0.548280574 0.116827623 -[243,] 0.762028332 0.4783694467 0.781968915 0.046026549 -[244,] 0.819844668 0.2694084474 0.282850415 0.643221559 -[245,] 0.948118838 0.0069984545 0.351617672 0.419045725 -[246,] 0.457876797 0.7116925793 0.919848058 0.627110701 -[247,] 0.902181778 0.7573291592 0.137858366 0.153254878 -[248,] 0.191312187 0.4331851406 0.087219302 0.223780001 -[249,] 0.572148680 0.4001691784 0.565465381 0.829623879 -[250,] 0.642113819 0.3914987517 0.709579855 0.108824073 -[251,] 0.273622734 0.5938669327 0.160184813 0.853430239 -[252,] 0.847739158 0.4778868125 0.773692122 0.295400081 -[253,] 0.065628112 0.4405331248 0.462098858 0.340934370 -[254,] 0.185140319 0.5069977269 0.019191031 0.773686039 -[255,] 0.559665079 0.6414626392 0.468432119 0.279223811 -[256,] 0.461216570 0.7927383417 0.585565576 0.394758986 -[257,] 0.811237350 0.3185630939 0.581447338 0.455488958 -[258,] 0.268803450 0.5551772048 0.231230884 0.543232898 -[259,] 0.447570141 0.1302881369 0.621725983 0.547994283 -[260,] 0.149244214 0.5595458692 0.426885576 0.447730098 -[261,] 0.833294772 0.7195872827 0.456886756 0.521264263 -[262,] 0.242457078 0.0758608347 0.391295091 0.013108216 -[263,] 0.867499469 0.9926156737 0.708855388 0.826715490 -[264,] 0.891896270 0.5394107327 0.555313592 0.276439884 -[265,] 0.659197926 0.2434352424 0.288266205 0.715780959 -[266,] 0.727533633 0.1730430387 0.306311259 0.369907277 -[267,] 0.077721554 0.7131501888 0.550922729 0.135865396 -[268,] 0.974163694 0.5619631589 0.788409382 0.848914084 -[269,] 0.878041775 0.8004763739 0.640148486 0.628927761 -[270,] 0.271409005 0.0299398254 0.419864215 0.355434671 -[271,] 0.392331254 0.1719368324 0.319642119 0.413555064 -[272,] 0.759335697 0.2718902051 0.115582457 0.029336615 -[273,] 0.806855298 0.4801264366 0.806247940 0.079005682 -[274,] 0.115337410 0.1294162895 0.738748542 0.757098533 -[275,] 0.992455309 0.6245529873 0.288690109 0.199911774 -[276,] 0.800917849 0.7277627103 0.217047975 0.744238505 -[277,] 0.866653708 0.5294057564 0.598638547 0.937632332 -[278,] 0.950724098 0.6605323013 0.072286581 0.826331579 -[279,] 0.479544078 0.3912287834 0.299122776 0.244308250 -[280,] 0.421810132 0.9377701769 0.264485117 0.568568754 -[281,] 0.202184568 0.1928056269 0.718611745 0.313517896 -[282,] 0.138390127 0.0580306977 0.931099641 0.568338012 -[283,] 0.117770361 0.5647944815 0.540256183 0.819682518 -[284,] 0.702979504 0.5677483736 0.721309266 0.752444213 -[285,] 0.381422597 0.2880102813 0.531683327 0.259646071 -[286,] 0.831790318 0.4053638848 0.072631926 0.953758625 -[287,] 0.217183783 0.4056252667 0.625668315 0.628404804 -[288,] 0.328238664 0.1389094919 0.914657170 0.599115967 -[289,] 0.749607096 0.9189547452 0.528765396 0.371978746 -[290,] 0.065808321 0.8543699237 0.510411301 0.209998059 -[291,] 0.375843437 0.2073654998 0.459240817 0.241502250 -[292,] 0.118690322 0.0724691497 0.690989850 0.286957619 -[293,] 0.149412496 0.9724320092 0.410514390 0.401813854 -[294,] 0.648556349 0.9163057397 0.216662139 0.547998872 -[295,] 0.720050458 0.3972460052 0.094001393 0.634896405 -[296,] 0.002478810 0.2105232398 0.679022809 0.866189130 -[297,] 0.799697116 0.1349963984 0.387498258 0.788471929 -[298,] 0.692913667 0.5942729714 0.123857651 0.555078103 -[299,] 0.449411388 0.7661665287 0.026097722 0.195171432 -[300,] 0.881234565 0.1098015935 0.968550928 0.385198593 -[301,] 0.858591407 0.8873847546 0.489091499 0.718091809 -[302,] 0.486705573 0.9887088609 0.064751130 0.157662778 -[303,] 0.785348618 0.5421882898 0.416547345 0.998882649 -[304,] 0.255673117 0.5078756711 0.078971178 0.813668364 -[305,] 0.382179160 0.8021827079 0.197923637 0.946399770 -[306,] 0.345672474 0.5220502473 0.111688006 0.885974851 -[307,] 0.954254973 0.0403807631 0.493616189 0.226063705 -[308,] 0.858800339 0.5309357338 0.004638151 0.277560080 -[309,] 0.325203143 0.5887062766 0.249684701 0.043117281 -[310,] 0.110678788 0.7037538120 0.939021239 0.311169018 -[311,] 0.078492930 0.3217440913 0.624905537 0.440241850 -[312,] 0.801345301 0.2792838051 0.570713193 0.042128012 -[313,] 0.190717455 0.7270864707 0.826690050 0.510721075 -[314,] 0.567726166 0.0011558197 0.143778103 0.865967083 -[315,] 0.082561061 0.2445706821 0.981543157 0.577581279 -[316,] 0.248726364 0.6149539538 0.031757321 0.146423544 -[317,] 0.703072974 0.0655607085 0.621807062 0.937327365 -[318,] 0.087894615 0.9728035093 0.026010711 0.725227952 -[319,] 0.453706392 0.5661824050 0.872731046 0.554563180 -[320,] 0.737652207 0.6231291620 0.311028406 0.392196485 -[321,] 0.202087455 0.8527803896 0.606830151 0.756098014 -[322,] 0.562516809 0.2758990128 0.735558404 0.549279794 -[323,] 0.346127044 0.5149656348 0.815767948 0.526272569 -[324,] 0.203040050 0.8481076804 0.370494215 0.303325171 -[325,] 0.770597047 0.7334485550 0.838905998 0.569048842 -[326,] 0.026280838 0.4861272282 0.542681033 0.836660117 -[327,] 0.728664538 0.5551138069 0.073414397 0.136502299 -[328,] 0.684608696 0.0996219362 0.203785905 0.365980138 -[329,] 0.846195758 0.2368725955 0.704877851 0.107608831 -[330,] 0.779068869 0.2551056833 0.548043326 0.033901521 -[331,] 0.806109476 0.3377528072 0.916285858 0.357106418 -[332,] 0.975365013 0.3843785226 0.488673535 0.490776231 -[333,] 0.012254624 0.6414732006 0.512574972 0.320352118 -[334,] 0.581433158 0.6173444083 0.438274538 0.170368981 -[335,] 0.715080497 0.7477865487 0.843914708 0.534759047 -[336,] 0.302235262 0.4565181821 0.384342534 0.249046855 -[337,] 0.654626745 0.9553237017 0.291082957 0.650189087 -[338,] 0.536359931 0.5974518666 0.024898269 0.004841740 -[339,] 0.131378254 0.0248171038 0.092129452 0.475558224 -[340,] 0.196656761 0.8146739486 0.244059228 0.488807638 -[341,] 0.648882480 0.1587164700 0.836977911 0.436596530 -[342,] 0.233495525 0.2988559920 0.159421337 0.585567104 -[343,] 0.148777977 0.1790595597 0.339221505 0.183901939 -[344,] 0.405541522 0.6135596184 0.685671334 0.823525600 -[345,] 0.373982114 0.9528410046 0.018832159 0.612374972 -[346,] 0.463573764 0.3547296205 0.882423029 0.075802858 -[347,] 0.883291192 0.1882218358 0.215066747 0.869532292 -[348,] 0.060838056 0.2348996007 0.993015513 0.678197728 -[349,] 0.435486801 0.3773099419 0.461184024 0.801851872 -[350,] 0.662966975 0.4660036641 0.053259437 0.237197918 -[351,] 0.233239738 0.2306536008 0.061726274 0.497118609 -[352,] 0.244125089 0.7581855389 0.547302678 0.948066896 -[353,] 0.086172192 0.9478825850 0.722398868 0.922004605 -[354,] 0.613840944 0.1609665013 0.182940692 0.730183562 -[355,] 0.589525650 0.3124823626 0.772794399 0.336298202 -[356,] 0.855676691 0.5805284935 0.415722651 0.932572785 -[357,] 0.462698841 0.0993463299 0.465449363 0.984083858 -[358,] 0.925272866 0.4353987635 0.869720716 0.300354172 -[359,] 0.797972631 0.8005107120 0.386925696 0.381589695 -[360,] 0.645515614 0.8616674542 0.656632671 0.516326074 -[361,] 0.148781583 0.6127659029 0.041966819 0.498358993 -[362,] 0.739508222 0.7538997794 0.063093741 0.442481933 -[363,] 0.500671699 0.2702431004 0.598802149 0.735837626 -[364,] 0.713577812 0.1164929369 0.575120618 0.798131987 -[365,] 0.231823797 0.7248558255 0.838023198 0.118838571 -[366,] 0.958950397 0.7477645844 0.810889479 0.189917723 -[367,] 0.025968777 0.8637822922 0.919179865 0.137627988 -[368,] 0.477648622 0.4629615003 0.700178611 0.065574901 -[369,] 0.733039993 0.3959315903 0.461487845 0.725299363 -[370,] 0.470002647 0.9995239775 0.845935792 0.828207304 -[371,] 0.761644344 0.1121064918 0.838977019 0.813850524 -[372,] 0.991412194 0.0483145248 0.746787912 0.419313522 -[373,] 0.582143897 0.8307340622 0.013530627 0.011521763 -[374,] 0.996445707 0.7656896671 0.314662611 0.812011744 -[375,] 0.991219217 0.2007595929 0.646037220 0.437550729 -[376,] 0.938028262 0.9880033054 0.456319561 0.230614943 -[377,] 0.695489269 0.5566323446 0.584710089 0.433631247 -[378,] 0.426175053 0.5968543955 0.452085585 0.956608659 -[379,] 0.844430350 0.2227686027 0.420170177 0.419982936 -[380,] 0.020790849 0.3804479695 0.422348428 0.191426063 -[381,] 0.705329282 0.0135204752 0.731203106 0.432724098 -[382,] 0.731240093 0.0139415525 0.045313308 0.418414376 -[383,] 0.643840002 0.2197937856 0.833442653 0.694767314 -[384,] 0.899124485 0.4142402853 0.411004703 0.250014989 -[385,] 0.373767039 0.2318927327 0.931603165 0.476344755 -[386,] 0.047665003 0.7735310560 0.331117329 0.552876471 -[387,] 0.676330529 0.2773343709 0.052855678 0.425758584 -[388,] 0.610118482 0.9760460351 0.969800120 0.088484557 -[389,] 0.498380037 0.3956893678 0.390331929 0.318499491 -[390,] 0.682575054 0.2846149076 0.390094714 0.990168560 -[391,] 0.792005731 0.3124051515 0.817117730 0.220909772 -[392,] 0.501073820 0.1669722963 0.119659194 0.897609968 -[393,] 0.093714879 0.8650585567 0.276591464 0.027283693 -[394,] 0.787384963 0.3586602998 0.025102966 0.746093598 -[395,] 0.029625577 0.4338648310 0.256626833 0.498015221 -[396,] 0.653355231 0.0836568857 0.180472462 0.104462502 -[397,] 0.812392984 0.6275024416 0.630572486 0.390889850 -[398,] 0.432253574 0.3486340023 0.793557759 0.886936112 -[399,] 0.651127087 0.5928632643 0.327822094 0.075689368 -[400,] 0.591387242 0.1783367635 0.741350124 0.293876208 -[401,] 0.639185811 0.1248223973 0.255265784 0.820574687 -[402,] 0.803780393 0.0458346307 0.875531722 0.128009090 -[403,] 0.608831404 0.4695668733 0.557291086 0.730392785 -[404,] 0.469858689 0.9886100590 0.984668385 0.393284681 -[405,] 0.608847138 0.3454837301 0.437112562 0.229131963 -[406,] 0.006072248 0.0238768882 0.058758428 0.764575645 -[407,] 0.469044005 0.8508318802 0.581719391 0.186888262 -[408,] 0.609060979 0.8933417331 0.794321166 0.504092834 -[409,] 0.423028274 0.6543812877 0.887738514 0.892016471 -[410,] 0.178390538 0.2575024248 0.113438505 0.797158959 -[411,] 0.109538489 0.8290716948 0.771046297 0.943689405 -[412,] 0.466957594 0.9398556475 0.785182942 0.874607875 -[413,] 0.394462653 0.0996991608 0.276961420 0.722222051 -[414,] 0.356305179 0.3827118834 0.031968651 0.521445287 -[415,] 0.121077910 0.8851841765 0.074646299 0.784227947 -[416,] 0.854132303 0.0371781706 0.275143509 0.642069949 -[417,] 0.785078360 0.4000627119 0.935302330 0.390516971 -[418,] 0.423959307 0.2864217011 0.611748409 0.558812739 -[419,] 0.039967135 0.7452819468 0.206487421 0.656495965 -[420,] 0.522414671 0.6334365848 0.617563134 0.284895547 -[421,] 0.223807222 0.5390193553 0.996371977 0.328916537 -[422,] 0.323336088 0.0353235179 0.525611853 0.596806915 -[423,] 0.742086659 0.9528371296 0.489621238 0.083287345 -[424,] 0.259927999 0.8748466256 0.852059136 0.842904665 -[425,] 0.946903675 0.6526816348 0.488155565 0.187756701 -[426,] 0.713033061 0.0850699707 0.461199406 0.935907307 -[427,] 0.845293668 0.7161867169 0.123806348 0.594827461 -[428,] 0.989852801 0.6154084879 0.273077667 0.063706843 -[429,] 0.072303276 0.8735112140 0.362824997 0.945622149 -[430,] 0.558318940 0.5126611509 0.947771664 0.109801596 -[431,] 0.818907551 0.3773421068 0.556641048 0.313871187 -[432,] 0.082342880 0.7799375423 0.193234728 0.655585468 -[433,] 0.435147053 0.1971483266 0.994660422 0.446742866 -[434,] 0.031426664 0.9370165581 0.870983954 0.601246283 -[435,] 0.299015456 0.8093462752 0.952142385 0.852053971 -[436,] 0.127309736 0.9688823498 0.557101009 0.005364447 -[437,] 0.135763920 0.0058471016 0.816874062 0.782163588 -[438,] 0.931066286 0.3686898823 0.974454874 0.823743682 -[439,] 0.787448863 0.6228258347 0.967354929 0.499918491 -[440,] 0.893695600 0.4010432470 0.447541610 0.935779082 -[441,] 0.683332197 0.0181631302 0.165526718 0.495834499 -[442,] 0.426535228 0.9920531206 0.888950124 0.345755371 -[443,] 0.705844125 0.9087246871 0.676292887 0.639100271 -[444,] 0.149604527 0.6011253900 0.272751236 0.457853371 -[445,] 0.222253093 0.2549215169 0.653687727 0.471993161 -[446,] 0.160963036 0.2720803346 0.712956093 0.613353652 -[447,] 0.132121966 0.0700072532 0.966265013 0.368270278 -[448,] 0.677454085 0.8459517304 0.241650385 0.035150991 -[449,] 0.595240237 0.8361911280 0.362249210 0.332188533 -[450,] 0.644736331 0.9586151368 0.596203628 0.510280018 -[451,] 0.155264136 0.8458510055 0.214380426 0.669873245 -[452,] 0.617756451 0.0499997770 0.949398776 0.582552032 [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/vinecopula -r 106