From noreply at r-forge.r-project.org Mon Feb 3 14:01:53 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 3 Feb 2014 14:01:53 +0100 (CET) Subject: [Vinecopula-commits] r51 - pkg/inst Message-ID: <20140203130153.F04B6186E47@r-forge.r-project.org> Author: ulf Date: 2014-02-03 14:01:52 +0100 (Mon, 03 Feb 2014) New Revision: 51 Modified: pkg/inst/ChangeLog Log: Wir haben eine Funktion vergessen zu erwaehnen in?\194?\180m ChangeLog. Das was die RVinePcor2cor and vise versa. Modified: pkg/inst/ChangeLog =================================================================== --- pkg/inst/ChangeLog 2014-01-27 16:40:00 UTC (rev 50) +++ pkg/inst/ChangeLog 2014-02-03 13:01:52 UTC (rev 51) @@ -24,6 +24,8 @@ * BetaMatrix Matrix of empirical Blomqvist's beta values * BiCopPar2Beta Blomqvist's beta value of a bivariate copula * RVinePar2Beta Blomqvist's beta values of an R-vine copula model + * RVineCor2pcor correlations to partial correlations for R-vines + * RVinePcor2cor partial correlations to correlations for R-vines * New copula familes for most of the BiCop as well as for the RVine-functions: As an asymmetric extension of the Gumbel copula, the Tawn copula with three parameters is now also included in the package. Both the Gumbel and the Tawn copula are extreme-value copulas, which can be defined in terms of their corresponding Pickands dependence functions. For simplicity, we implemented two versions of the Tawn copula with two parameters each. @@ -52,7 +54,7 @@ In our functions it is "family=41", and 51, 61, and 71 for the rotated versions. So far only implemented in some bivariate functions (not documented so far; experimental) -- New author: Benedikt Gr?ler +- New author: Benedikt Graeler - Bug fix: * New (correct) examples for the Clarke and Vuong test From noreply at r-forge.r-project.org Thu Feb 6 17:53:03 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 6 Feb 2014 17:53:03 +0100 (CET) Subject: [Vinecopula-commits] r52 - in pkg: . R man Message-ID: <20140206165303.D2E6E1865F4@r-forge.r-project.org> Author: ben_graeler Date: 2014-02-06 17:53:02 +0100 (Thu, 06 Feb 2014) New Revision: 52 Added: pkg/R/0_prep_object.R pkg/R/BB1copula.R pkg/R/BB6copula.R pkg/R/BB7copula.R pkg/R/BB8copula.R pkg/R/ClaytonGumbelCopula.R pkg/R/joeBiCopula.R pkg/R/tawnCopula.R pkg/R/vineCopulas.R pkg/man/BB1Copula-class.Rd pkg/man/BB1Copula.Rd pkg/man/BB6Copula-class.Rd pkg/man/BB6Copula.Rd pkg/man/BB7Copula-class.Rd pkg/man/BB7Copula.Rd pkg/man/BB8Copula-class.Rd pkg/man/BB8Copula.Rd pkg/man/dduCopula.Rd pkg/man/joeBiCopula-class.Rd pkg/man/joeBiCopula.Rd pkg/man/surClaytonCopula-class.Rd pkg/man/surClaytonCopula.Rd pkg/man/surGumbelCopula-class.Rd pkg/man/surGumbelCopula.Rd pkg/man/tawnT1Copula-class.Rd pkg/man/tawnT1Copula.Rd pkg/man/tawnT2Copula-class.Rd pkg/man/tawnT2Copula.Rd pkg/man/vineCopula-class.Rd pkg/man/vineCopula.Rd Modified: pkg/DESCRIPTION pkg/NAMESPACE Log: - included wrapper for copula-package compatibility and documentation Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2014-02-03 13:01:52 UTC (rev 51) +++ pkg/DESCRIPTION 2014-02-06 16:53:02 UTC (rev 52) @@ -2,10 +2,11 @@ Type: Package Title: Statistical inference of vine copulas Version: 1.2-1 -Date: 2014-01-27 +Date: 2014-02-06 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler Maintainer: Ulf Schepsmeier -Depends: R (>= 2.11.0), MASS, mvtnorm, igraph +Depends: R (>= 2.11.0) +Imports: MASS, mvtnorm, igraph, copula, methods Suggests: CDVine, TSP, ADGofTest Description: This package provides functions for statistical inference of vine copulas. It contains tools for bivariate exploratory data analysis, bivariate copula selection and (vine) tree construction. Models can be estimated either sequentially or by joint maximum likelihood estimation. Sampling algorithms and plotting methods are also 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 2014-02-03 13:01:52 UTC (rev 51) +++ pkg/NAMESPACE 2014-02-06 16:53:02 UTC (rev 52) @@ -1,6 +1,8 @@ import(MASS) import(mvtnorm) import(igraph) +import(copula) +import(methods) export(BiCopEst) export(BiCopMetaContour) @@ -55,6 +57,31 @@ export(RVinePar2Beta) export(BetaMatrix) +# compatibility to copula +export(fitCopula) +export(dduCopula,ddvCopula) + +export(BB1Copula, surBB1Copula, r90BB1Copula, r270BB1Copula) +export(BB6Copula, surBB6Copula, r90BB6Copula, r270BB6Copula) +export(BB7Copula, surBB7Copula, r90BB7Copula, r270BB7Copula) +export(BB8Copula, surBB8Copula, r90BB8Copula, r270BB8Copula) +export(joeBiCopula, surJoeBiCopula, r90JoeBiCopula, r270JoeBiCopula) +export(surClaytonCopula, r90ClaytonCopula, r270ClaytonCopula) +export(surGumbelCopula, r90GumbelCopula, r270GumbelCopula) +export(tawnT1Copula, surTawnT1Copula, r90TawnT1Copula, r270TawnT1Copula) +export(tawnT2Copula, surTawnT2Copula, r90TawnT2Copula, r270TawnT2Copula) +export(vineCopula) + +exportClasses(BB1Copula, surBB1Copula, r90BB1Copula, r270BB1Copula) +exportClasses(BB6Copula, surBB6Copula, r90BB6Copula, r270BB6Copula) +exportClasses(BB7Copula, surBB7Copula, r90BB7Copula, r270BB7Copula) +exportClasses(BB8Copula, surBB8Copula, r90BB8Copula, r270BB8Copula) +exportClasses(joeBiCopula, surJoeBiCopula, r90JoeBiCopula, r270JoeBiCopula) +exportClasses(surClaytonCopula, r90ClaytonCopula, r270ClaytonCopula) +exportClasses(surGumbelCopula, r90GumbelCopula, r270GumbelCopula) +exportClasses(tawnT1Copula, surTawnT1Copula, r90TawnT1Copula, r270TawnT1Copula) +exportClasses(tawnT2Copula, surTawnT2Copula, r90TawnT2Copula, r270TawnT2Copula) +exportClasses(vineCopula) S3method(print, RVineMatrix) useDynLib("VineCopula") \ No newline at end of file Added: pkg/R/0_prep_object.R =================================================================== --- pkg/R/0_prep_object.R (rev 0) +++ pkg/R/0_prep_object.R 2014-02-06 16:53:02 UTC (rev 52) @@ -0,0 +1,190 @@ +copulaFromFamilyIndex <- function(family, par, par2=0) { + constr <- switch(paste("fam",family,sep=""), + fam0 = function(par) indepCopula(), + fam1 = function(par) normalCopula(par[1]), + fam2 = function(par) tCopula(par[1],df=par[2]), + fam3 = function(par) claytonCopula(par[1]), + fam4 = function(par) gumbelCopula(par[1]), + fam5 = function(par) frankCopula(par[1]), + fam6 = function(par) joeBiCopula(par[1]), + fam7 = BB1Copula, + fam8 = BB6Copula, + fam9 = BB7Copula, + fam10 = BB8Copula, + fam13 = function(par) surClaytonCopula(par[1]), + fam14 = function(par) surGumbelCopula(par[1]), + fam16 = function(par) surJoeBiCopula(par[1]), + fam17 = surBB1Copula, + fam18 = surBB6Copula, + fam19 = surBB7Copula, + fam20 = surBB8Copula, + fam23 = function(par) r90ClaytonCopula(par[1]), + fam24 = function(par) r90GumbelCopula(par[1]), + fam26 = function(par) r90JoeBiCopula(par[1]), + fam27 = r90BB1Copula, + fam28 = r90BB6Copula, + fam29 = r90BB7Copula, + fam30 = r90BB8Copula, + fam33 = function(par) r270ClaytonCopula(par[1]), + fam34 = function(par) r270GumbelCopula(par[1]), + fam36 = function(par) r270JoeBiCopula(par[1]), + fam37 = r270BB1Copula, + fam38 = r270BB6Copula, + fam39 = r270BB7Copula, + fam40 = r270BB8Copula, + fam104 = tawnT1Copula, + fam114 = surTawnT1Copula, + fam124 = r90TawnT1Copula, + fam134 = r270TawnT1Copula, + fam204 = tawnT2Copula, + fam214 = surTawnT2Copula, + fam224 = r90TawnT2Copula, + fam234 = r270TawnT2Copula) + constr(c(par,par2)) +} + +######################################################### +## generic wrapper functions to the VineCopula package ## +######################################################### + +# density from BiCopPDF +linkVineCop.PDF <- function (u, copula, log=FALSE) { + param <- copula at parameters + + if(length(param)==1) + param <- c(param,0) + n <- nrow(u) + fam <- copula at family + +# coplik = RLL_mod_separate(fam, n, u, param)[[7]] + coplik = .C("LL_mod_seperate", as.integer(fam), as.integer(n), as.double(u[,1]), + as.double(u[,2]), as.double(param[1]), as.double(param[2]), + as.double(rep(0, n)), PACKAGE = "VineCopula")[[7]] + if(log) + return(coplik) + else + return(exp(coplik)) +} + +# cdf from BiCopCDF + +# for "standard" copulas: family %in% c(3:10) +linkVineCop.CDF <- function (u, copula) { + param <- copula at parameters + if (!is.matrix(u)) u <- matrix(u, ncol = 2) + n <- nrow(u) + fam <- copula at family + +# res <- RarchCDF(fam, n, u, param)[[6]] + res <- .C("archCDF", as.double(u[,1]), as.double(u[,2]), as.integer(n), as.double(param), + as.integer(fam), as.double(rep(0, n)), PACKAGE = "VineCopula")[[6]] + return(res) +} + +# for survival copulas: family %in% c(13, 14, 16:20) +linkVineCop.surCDF <- 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 + +# res <- u1 + u2 - 1 + RarchCDF(fam-10, n, cbind(1-u1,1-u2), param)[[6]] + res <- u1 + u2 - 1 + .C("archCDF", as.double(1 - u1), as.double(1 - u2), as.integer(n), + as.double(param), as.integer(fam - 10), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[6]] + return(res) +} + +# for 90 deg rotated copulas: family %in% c(23, 24, 26:30) +linkVineCop.r90CDF <- 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 + +# res <- u2 - RarchCDF(fam - 20, n, cbind(1-u1,u2), -param)[[6]] + u2 - .C("archCDF", as.double(1 - u1), as.double(u2), as.integer(n), + as.double(-param), as.integer(fam - 20), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[6]] +} + +# for 270 deg rotated copulas: family %in% c(33, 34, 36:40) +linkVineCop.r270CDF <- 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 + +# u1 - RarchCDF(fam-30, n, cbind(u1,1-u2), -param)[[6]] + u1 - .C("archCDF", as.double(u1), as.double(1 - u2), as.integer(n), + as.double(-param), as.integer(fam - 30), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[6]] +} + +## derivtives/h-function from BiCopHfunc +# ddu +linkVineCop.ddu <- function (u, copula) { + param <- copula at parameters + u <- matrix(u, ncol = 2) + n <- nrow(u) + fam <- copula at family + +# RHfunc1(fam, n, u, param)[[7]] + .C("Hfunc1", as.integer(fam), as.integer(n), as.double(u[,2]), as.double(u[,1]), + as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] +} + +# ddv +linkVineCop.ddv <- function (u, copula) { + param <- copula at parameters + u <- matrix(u, ncol = 2) + n <- nrow(u) + fam <- copula at family + +# RHfunc2(fam, n, u, param)[[7]] + .C("Hfunc2", as.integer(fam), as.integer(n), as.double(u[,1]), as.double(u[,2]), + as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] +} + + +## random numbers from VineCopulaSim +linkVineCop.r <- function (n, copula){ + param <- copula at parameters + fam <- copula at family + if(is.na(param[2])) param <- c(param,0) + +# tmp <- Rpcc(fam, n, param)[[7]] + res <- .C("pcc", as.integer(n), as.integer(2), as.integer(fam), as.integer(1), + as.double(param[1]), as.double(param[2]), as.double(rep(0, n * 2)), + PACKAGE = "VineCopula")[[7]] + + return(matrix(res, ncol = 2)) +} + +## Kendall's tau +linkVineCop.tau <- function(copula) { + par <- copula at parameters + BiCopPar2Tau(copula at family, par[1], par[2]) +} + +## get parameter from Kendall's tau (only for one parameter families) +linkVineCop.iTau <- function(copula, tau) { + BiCopTau2Par(copula at family, tau) +} + +## tailIndex +linkVineCop.tailIndex <- function(copula) { + par <- copula at parameters + unlist(BiCopPar2TailDep(copula at family,par[1],par[2])) +} + +setGeneric("dduCopula", function(u, copula, ...) standardGeneric("dduCopula")) +setGeneric("ddvCopula", function(u, copula, ...) standardGeneric("ddvCopula")) \ No newline at end of file Added: pkg/R/BB1copula.R =================================================================== --- pkg/R/BB1copula.R (rev 0) +++ pkg/R/BB1copula.R 2014-02-06 16:53:02 UTC (rev 52) @@ -0,0 +1,245 @@ +##################### +## ## +## the BB1 copulas ## +## ## +##################### +# Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall. + +validBB1Copula = function(object) { + if (object at dimension != 2) + return("Only BB1 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") + else return (TRUE) +} + +setClass("BB1Copula", + representation = representation("copula", family="numeric"), + validity = validBB1Copula, + contains = list("copula") +) + +# constructor +BB1Copula <- function (param=c(1,1)) { + if (any(is.na(param) | param >= c(Inf,Inf) | param[1] <= 0 | param[2] < 1)) + stop(paste("Parameter values out of bounds: theta: (0,Inf), delta: [1,Inf).")) + new("BB1Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(0, 1), param.upbnd = c(Inf, Inf), + family=7, fullname = "BB1 copula family. Number 7 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","BB1Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","BB1Copula"), + function(u, copula, log) linkVineCop.PDF(u, copula, log)) + +## jcdf ## +setMethod("pCopula", signature("numeric","BB1Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","BB1Copula"), linkVineCop.CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","BB1Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","BB1Copula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","BB1Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","BB1Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","BB1Copula"), linkVineCop.r) + +setMethod("tau",signature("BB1Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("BB1Copula"),linkVineCop.tailIndex) + +######################### +## BB1 survival copula ## +######################### + +setClass("surBB1Copula", + representation = representation("copula", family="numeric"), + validity = validBB1Copula, + contains = list("copula") +) + +# constructor +surBB1Copula <- function (param=c(1,1)) { + if (any(is.na(param) | param >= c(Inf,Inf) | param[1] <= 0 | param[2] < 1)) + stop(paste("Parameter values out of bounds: theta: (0,Inf), delta: [1,Inf).")) + new("surBB1Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(0, 1), param.upbnd = c(Inf, Inf), + family=17, fullname = "Survival BB1 copula family. Number 17 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","surBB1Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","surBB1Copula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","surBB1Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","surBB1Copula"), linkVineCop.surCDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","surBB1Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","surBB1Copula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","surBB1Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","surBB1Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","surBB1Copula"), linkVineCop.r) + +setMethod("tau",signature("surBB1Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("surBB1Copula"),linkVineCop.tailIndex) + +####################### +## BB1 copula 90 deg ## +####################### + +validRotBB1Copula = function(object) { + if (object at dimension != 2) + return("Only BB1 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") + else return (TRUE) +} + +setClass("r90BB1Copula", + representation = representation("copula", family="numeric"), + validity = validRotBB1Copula, + contains = list("copula") +) + +# constructor +r90BB1Copula <- function (param=c(-1,-1)) { + if (any(is.na(param) | param[1] >= 0 | param[2] > -1 | param <= c(-Inf,-Inf))) + stop(paste("Parameter values out of bounds: theta: (-Inf,0), delta: (-Inf,-1].")) + new("r90BB1Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(0, -1), + family=27, fullname = "90 deg rotated BB1 copula family. Number 27 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r90BB1Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","r90BB1Copula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r90BB1Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r90BB1Copula"), linkVineCop.r90CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r90BB1Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r90BB1Copula"), linkVineCop.ddu) + +## ddv +setMethod("ddvCopula", signature("numeric","r90BB1Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r90BB1Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r90BB1Copula"), linkVineCop.r) + +setMethod("tau",signature("r90BB1Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("r90BB1Copula"),linkVineCop.tailIndex) + +######################## +## BB1 copula 270 deg ## +######################## + +setClass("r270BB1Copula", + representation = representation("copula", family="numeric"), + validity = validRotBB1Copula, + contains = list("copula") +) + +# constructor +r270BB1Copula <- function (param=c(-1,-1)) { + if (any(is.na(param) | param[1] >= 0 | param[2] > -1 | param <= c(-Inf,-Inf))) + stop(paste("Parameter values out of bounds: theta: (-Inf,0), delta: (-Inf,-1].")) + new("r270BB1Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(0, -1), + family=37, fullname = "270 deg rotated BB1 copula family. Number 37 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r270BB1Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","r270BB1Copula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r270BB1Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r270BB1Copula"), linkVineCop.r270CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r270BB1Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r270BB1Copula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","r270BB1Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r270BB1Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r270BB1Copula"), linkVineCop.r) + +setMethod("tau",signature("r270BB1Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("r270BB1Copula"),linkVineCop.tailIndex) \ No newline at end of file Added: pkg/R/BB6copula.R =================================================================== --- pkg/R/BB6copula.R (rev 0) +++ pkg/R/BB6copula.R 2014-02-06 16:53:02 UTC (rev 52) @@ -0,0 +1,246 @@ +##################### +## ## +## the BB6 copulas ## +## ## +##################### +# Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall. + +validBB6Copula = function(object) { + if (object at dimension != 2) + return("Only BB6 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("BB6Copula", + representation = representation("copula", family="numeric"), + validity = validBB6Copula, + contains = list("copula") +) + +# constructor +BB6Copula <- function (param=c(1,1)) { + if (any(is.na(param) | param >= c(Inf, Inf) | param < c(1,1))) + stop("Parameter value(s) out of bound(s): theta: [1,Inf), delta: [1,Inf).") + new("BB6Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(1, 1), param.upbnd = c(Inf, Inf), + family=8, fullname = "BB6 copula family. Number 8 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","BB6Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","BB6Copula"), function(u, copula, log) linkVineCop.PDF(u, copula, log)) + +## jcdf ## +setMethod("pCopula", signature("numeric","BB6Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","BB6Copula"), linkVineCop.CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","BB6Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","BB6Copula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","BB6Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","BB6Copula"), linkVineCop.ddv) + +## random number generater ?? +setMethod("rCopula", signature("numeric","BB6Copula"), linkVineCop.r) + +setMethod("tau",signature("BB6Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("BB6Copula"),linkVineCop.tailIndex) + +######################### +## BB6 survival copula ## +######################### + +setClass("surBB6Copula", + representation = representation("copula", family="numeric"), + validity = validBB6Copula, + contains = list("copula") +) + +# constructor +surBB6Copula <- function (param=c(1,1)) { + if (any(is.na(param) | param >= c(Inf, Inf) | param < c(1,1))) + stop("Parameter value(s) out of bound(s): theta: [1,Inf), delta: [1,Inf).") + new("surBB6Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(1, 1), param.upbnd = c(Inf, Inf), + family=18, fullname = "Survival BB6 copula family. Number 18 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","surBB6Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","surBB6Copula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","surBB6Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","surBB6Copula"), linkVineCop.surCDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","surBB6Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","surBB6Copula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","surBB6Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","surBB6Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","surBB6Copula"), linkVineCop.r) + +setMethod("tau",signature("surBB6Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("surBB6Copula"),linkVineCop.tailIndex) + +####################### +## BB6 copula 90 deg ## +####################### + +validRotBB6Copula = function(object) { + if (object at dimension != 2) + return("Only BB6 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") + else return (TRUE) +} + +setClass("r90BB6Copula", + representation = representation("copula", family="numeric"), + validity = validRotBB6Copula, + contains = list("copula") +) + +# constructor +r90BB6Copula <- function (param=c(-1,-1)) { + if (any(is.na(param) | param > c(-1,-1) | param <= c(-Inf,-Inf))) + stop("Parameter value out of bound: theta: (-Inf,1], delta: (-Inf,1].") + new("r90BB6Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(-1, -1), + family=28, fullname = "90 deg rotated BB6 copula family. Number 28 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r90BB6Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula,log) + }) +setMethod("dCopula", signature("matrix","r90BB6Copula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r90BB6Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r90BB6Copula"), linkVineCop.r90CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r90BB6Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r90BB6Copula"), linkVineCop.ddu) + +## ddv +setMethod("ddvCopula", signature("numeric","r90BB6Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r90BB6Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r90BB6Copula"), linkVineCop.r) + +setMethod("tau",signature("r90BB6Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("r90BB6Copula"),linkVineCop.tailIndex) + +########################### +## BB6 copula 270 degree ## +########################### + +setClass("r270BB6Copula", + representation = representation("copula", family="numeric"), + validity = validRotBB6Copula, + contains = list("copula") +) + +# constructor +r270BB6Copula <- function (param=c(-1,-1)) { + if (any(is.na(param) | param > c(-1,-1) | param <= c(-Inf,-Inf))) + stop("Parameter value out of bound: theta: (-Inf,1], delta: (-Inf,1].") + new("r270BB6Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(-Inf, -Inf), param.upbnd = c(-1, -1), + family=38, fullname = "270 deg rotated BB6 copula family. Number 38 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","r270BB6Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension, log),copula) + }) +setMethod("dCopula", signature("matrix","r270BB6Copula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","r270BB6Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","r270BB6Copula"), linkVineCop.r270CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","r270BB6Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","r270BB6Copula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","r270BB6Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","r270BB6Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","r270BB6Copula"), linkVineCop.r) + +setMethod("tau",signature("r270BB6Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("r270BB6Copula"),linkVineCop.tailIndex) \ No newline at end of file Added: pkg/R/BB7copula.R =================================================================== --- pkg/R/BB7copula.R (rev 0) +++ pkg/R/BB7copula.R 2014-02-06 16:53:02 UTC (rev 52) @@ -0,0 +1,247 @@ +##################### +## ## +## the BB7 copulas ## +## ## +##################### +# Joe, H., (1997). Multivariate Models and Dependence Concepts. Monogra. Stat. Appl. Probab. 73, London: Chapman and Hall. + +validBB7Copula = function(object) { + if (object at dimension != 2) + return("Only BB7 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") + else return (TRUE) +} + +setClass("BB7Copula", + representation = representation("copula", family="numeric"), + validity = validBB7Copula, + contains = list("copula") +) + +# constructor +BB7Copula <- function (param=c(1,1)) { + if (any(is.na(param) | param >= c(Inf, Inf) | param[1] < 1 | param[2] <= 0)) + stop(paste("Parameter values out of bounds: theta: [1,Inf), delta: (0,Inf).")) + new("BB7Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, Inf), + family=9, fullname = "BB7 copula family. Number 9 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","BB7Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension),copula, log) + }) +setMethod("dCopula", signature("matrix","BB7Copula"), function(u, copula, log) linkVineCop.PDF(u, copula, log)) + +## jcdf ## +setMethod("pCopula", signature("numeric","BB7Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","BB7Copula"), linkVineCop.CDF) + +## partial derivatives ## +# ddu +setMethod("dduCopula", signature("numeric","BB7Copula"), + function(u, copula, ...) { + linkVineCop.ddu(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("dduCopula", signature("matrix","BB7Copula"), linkVineCop.ddu) + +# ddv +setMethod("ddvCopula", signature("numeric","BB7Copula"), + function(u, copula, ...) { + linkVineCop.ddv(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("ddvCopula", signature("matrix","BB7Copula"), linkVineCop.ddv) + +## random number generator +setMethod("rCopula", signature("numeric","BB7Copula"), linkVineCop.r) + +setMethod("tau",signature("BB7Copula"),linkVineCop.tau) +setMethod("tailIndex",signature("BB7Copula"),linkVineCop.tailIndex) + + +######################### +## BB7 survival copula ## +######################### + +setClass("surBB7Copula", + representation = representation("copula", family="numeric"), + validity = validBB7Copula, + contains = list("copula") +) + +# constructor +surBB7Copula <- function (param=c(1,1)) { + if (any(is.na(param) | param >= c(Inf, Inf) | param[1] < 1 | param[2] <= 0)) + stop(paste("Parameter values out of bounds: theta: [1,Inf), delta: (0,Inf).")) + new("surBB7Copula", dimension = as.integer(2), parameters = param, + param.names = c("theta", "delta"), param.lowbnd = c(1, 0), param.upbnd = c(Inf, Inf), + family= 19, fullname = "Survival BB7 copula family. Number 19 in VineCopula.") +} + +## density ## +setMethod("dCopula", signature("numeric","surBB7Copula"), + function(u, copula, log) { + linkVineCop.PDF(matrix(u,ncol=copula at dimension,),copula,log=log) + }) +setMethod("dCopula", signature("matrix","surBB7Copula"), linkVineCop.PDF) + +## jcdf ## +setMethod("pCopula", signature("numeric","surBB7Copula"), + function(u, copula, ...) { + linkVineCop.CDF(matrix(u,ncol=copula at dimension),copula) + }) +setMethod("pCopula", signature("matrix","surBB7Copula"), linkVineCop.surCDF) + [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/vinecopula -r 52 From noreply at r-forge.r-project.org Fri Feb 7 11:15:19 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 7 Feb 2014 11:15:19 +0100 (CET) Subject: [Vinecopula-commits] r53 - in pkg: . R man Message-ID: <20140207101519.AB2ED1851CD@r-forge.r-project.org> Author: ben_graeler Date: 2014-02-07 11:15:19 +0100 (Fri, 07 Feb 2014) New Revision: 53 Modified: pkg/DESCRIPTION pkg/NAMESPACE pkg/R/tawnCopula.R pkg/R/vineCopulas.R pkg/man/vineCopula-class.Rd Log: - forgot to set fitCopula "generic" - copy-paste error in fullname of rotated tawn copulas Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2014-02-06 16:53:02 UTC (rev 52) +++ pkg/DESCRIPTION 2014-02-07 10:15:19 UTC (rev 53) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference of vine copulas Version: 1.2-1 -Date: 2014-02-06 +Date: 2014-02-07 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler Maintainer: Ulf Schepsmeier Depends: R (>= 2.11.0) Modified: pkg/NAMESPACE =================================================================== --- pkg/NAMESPACE 2014-02-06 16:53:02 UTC (rev 52) +++ pkg/NAMESPACE 2014-02-07 10:15:19 UTC (rev 53) @@ -71,6 +71,7 @@ export(tawnT1Copula, surTawnT1Copula, r90TawnT1Copula, r270TawnT1Copula) export(tawnT2Copula, surTawnT2Copula, r90TawnT2Copula, r270TawnT2Copula) export(vineCopula) +export(copulaFromFamilyIndex) exportClasses(BB1Copula, surBB1Copula, r90BB1Copula, r270BB1Copula) exportClasses(BB6Copula, surBB6Copula, r90BB6Copula, r270BB6Copula) @@ -82,6 +83,8 @@ exportClasses(tawnT1Copula, surTawnT1Copula, r90TawnT1Copula, r270TawnT1Copula) exportClasses(tawnT2Copula, surTawnT2Copula, r90TawnT2Copula, r270TawnT2Copula) exportClasses(vineCopula) + + S3method(print, RVineMatrix) useDynLib("VineCopula") \ No newline at end of file Modified: pkg/R/tawnCopula.R =================================================================== --- pkg/R/tawnCopula.R 2014-02-06 16:53:02 UTC (rev 52) +++ pkg/R/tawnCopula.R 2014-02-07 10:15:19 UTC (rev 53) @@ -139,7 +139,7 @@ stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1].")) new("r90TawnT1Copula", dimension = as.integer(2), parameters = param, param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1), - family=124, fullname = "Survival Tawn type 1 copula family. Number 124 in VineCopula.") + family=124, fullname = "90 deg rotated Tawn type 1 copula family. Number 124 in VineCopula.") } ## density ## @@ -194,7 +194,7 @@ stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1].")) new("r270TawnT1Copula", dimension = as.integer(2), parameters = param, param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1), - family=134, fullname = "Survival Tawn type 1 copula family. Number 134 in VineCopula.") + family=134, fullname = "270 deg rotated Tawn type 1 copula family. Number 134 in VineCopula.") } ## density ## @@ -361,7 +361,7 @@ stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1].")) new("r90TawnT2Copula", dimension = as.integer(2), parameters = param, param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1), - family=224, fullname = "Survival Tawn type 2 copula family. Number 224 in VineCopula.") + family=224, fullname = "90 deg rotated Tawn type 2 copula family. Number 224 in VineCopula.") } ## density ## @@ -416,7 +416,7 @@ stop(paste("Parameter values out of bounds: param1: [1,Inf), param2: [0,1].")) new("r270TawnT2Copula", dimension = as.integer(2), parameters = param, param.names = c("param1", "param2"), param.lowbnd = c(-Inf, 0), param.upbnd = c(-1, 1), - family=234, fullname = "Survival Tawn type 2 copula family. Number 234 in VineCopula.") + family=234, fullname = "270 deg rotated Tawn type 2 copula family. Number 234 in VineCopula.") } ## density ## Modified: pkg/R/vineCopulas.R =================================================================== --- pkg/R/vineCopulas.R 2014-02-06 16:53:02 UTC (rev 52) +++ pkg/R/vineCopulas.R 2014-02-07 10:15:19 UTC (rev 53) @@ -90,21 +90,32 @@ setMethod("rCopula", signature("numeric","vineCopula"), rRVine) +## make fitCopula from copula generic +setGeneric("fitCopula",fitCopula) + # fitting using RVine -fitVineCop <- function(copula, data, method) { +fitVineCop <- function(copula, data, + method=list(StructureSelect=FALSE, indeptest=FALSE)) { stopifnot(copula at dimension==ncol(data)) - if(!is.null(method[["familyset"]])) + if("familyset" %in% names(method)) familyset <- method[["familyset"]] else familyset <- NA - if("StructureSelect" %in% method) - vineCop <- vineCopula(RVineStructureSelect(data, familyset, indeptest="indeptest" %in% method)) + if("indeptest" %in% names(method)) + indept <- method[["indeptest"]] else - vineCop <- vineCopula(RVineCopSelect(data, familyset, copula at RVM$Matrix, - indeptest="indeptest" %in% method)) + indept <- FALSE + if("StructureSelect" %in% names(method)) { + if(method[["StructureSelect"]]) + vineCop <- vineCopula(RVineStructureSelect(data, familyset, indeptest=indept)) + else + vineCop <- vineCopula(RVineCopSelect(data, familyset, copula at RVM$Matrix, indeptest=indept)) + } else { + vineCop <- vineCopula(RVineCopSelect(data, familyset, copula at RVM$Matrix, indeptest=indept)) + } return(new("fitCopula", estimate = vineCop at parameters, var.est = matrix(NA), - method = sapply(method,paste,collapse=", "), + method = paste(names(method), method, sep="=", collapse=", "), loglik = RVineLogLik(data, vineCop at RVM)$loglik, fitting.stats=list(convergence = as.integer(NA)), nsample = nrow(data), copula=vineCop)) Modified: pkg/man/vineCopula-class.Rd =================================================================== --- pkg/man/vineCopula-class.Rd 2014-02-06 16:53:02 UTC (rev 52) +++ pkg/man/vineCopula-class.Rd 2014-02-07 10:15:19 UTC (rev 53) @@ -28,7 +28,7 @@ Class \code{"\linkS4class{Copula}"}, by class "copula", distance 2. } \section{Methods}{ -No additional methods yet, but uses e.g. \code{\link{dCopula}}, \code{\link{pCopula}}, \code{\link{rCopula}} and \code{\link{rCopula}} as any other copula. Via the \code{method} argument in \code{fitCopula}, control over the fit of the RVine can be taken via entries \code{"StructureSelect"}, \code{"indeptest"} and \code{"familyset"}. See \code{\link{RVineCopSelect}} and \code{\link{RVineStructureSelect}} for further details on the underlying functions. +No additional methods yet, but uses e.g. \code{\link{dCopula}}, \code{\link{pCopula}}, \code{\link{rCopula}} and \code{\link{rCopula}} as any other copula. Via the \code{method} argument in \code{fitCopula}, control over the fit of the RVine can be taken via entries \code{StructureSelect}, \code{indeptest} and \code{familyset}. See \code{\link{RVineCopSelect}} and \code{\link{RVineStructureSelect}} for further details on the underlying functions. Missing entries are treated as default values, i.e. \code{StructureSelect=FALSE}, \code{indeptest=FALSE} and \code{familyset=NA} } \references{ From noreply at r-forge.r-project.org Fri Feb 7 11:55:38 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 7 Feb 2014 11:55:38 +0100 (CET) Subject: [Vinecopula-commits] r54 - / pkg/man Message-ID: <20140207105538.C2A13186976@r-forge.r-project.org> Author: ulf Date: 2014-02-07 11:55:37 +0100 (Fri, 07 Feb 2014) New Revision: 54 Added: VineCopula_1.2.tar.gz Modified: pkg.pdf pkg/man/BiCopGofTest.Rd pkg/man/RVineGofTest.Rd Log: Wanling Huang hat mich daruaf aufmerksam gemacht, dass ich seinen Vor und Nachmnamen vertauscht habe. Added: VineCopula_1.2.tar.gz =================================================================== (Binary files differ) Property changes on: VineCopula_1.2.tar.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: pkg/man/BiCopGofTest.Rd =================================================================== --- pkg/man/BiCopGofTest.Rd 2014-02-07 10:15:19 UTC (rev 53) +++ pkg/man/BiCopGofTest.Rd 2014-02-07 10:55:37 UTC (rev 54) @@ -5,7 +5,7 @@ \description{ This function performs a goodness-of-fit test for bivariate copulas, -either based on White's information matrix equality (White 1982) as introduced by Wanling and Prokhorov (2011) +either based on White's information matrix equality (White 1982) as introduced by Huang and Prokhorov (2011) or based on Kendall's process. It computes the test statistics and p-values. } @@ -75,7 +75,7 @@ \details{ \code{method="white"}:\cr -This goodness-of fit test uses the information matrix equality of White (1982) and was investigated by Wanling and Prokhorov (2011). +This goodness-of fit test uses the information matrix equality of White (1982) and was investigated by Huang and Prokhorov (2011). The main contribution is that under correct model specification the Fisher Information can be equivalently calculated as minus the expected Hessian matrix or as the expected outer product of the score function. The null hypothesis is \deqn{ @@ -88,7 +88,7 @@ where \eqn{\boldsymbol{H}(\theta)} is the expected Hessian matrix and \eqn{\boldsymbol{C}(\theta)} is the expected outer product of the score function. For the calculation of the test statistic we use the consistent maximum likelihood estimator \eqn{\hat{\theta}} and the sample counter parts of \eqn{\boldsymbol{H}(\theta)} and \eqn{\boldsymbol{C}(\theta)}. The correction of the covariance-matrix in the test statistic for the uncertainty in the margins is skipped. The implemented tests assumes that where is no uncertainty in the margins. -The correction can be found in Wanling and Prokhorov (2011). It involves two-dimensional integrals.\cr +The correction can be found in Huang and Prokhorov (2011). It involves two-dimensional integrals.\cr WARNING: For the t-copula the test may be instable. The results for the t-copula therefore have to treated carefully.\cr \cr \code{method = "kendall"}:\cr @@ -96,13 +96,17 @@ For rotated copulas the input arguments are transformed and the goodness-of-fit procedure for the corresponding non-rotated copula is used. } -\author{Ulf Schepsmeier, Huang Wanling, Jiying Luo, Eike Brechmann} +\author{Ulf Schepsmeier, Wanling Huang, Jiying Luo, Eike Brechmann} \references{ Genest, C. and L.-P. Rivest (1993). Statistical inference procedures for bivariate Archimedean copulas. Journal of the American Statistical Association, 88 (423), 1034-1043. +Huang, w. and A. Prokhorov (2011). +A goodness-of-fit test for copulas. +to appear in Econometric Reviews + Luo J. (2011). Stepwise estimation of D-vines with arbitrary specified copula pairs and EDA tools. Diploma thesis, Technische Universitaet Muenchen.\cr @@ -112,10 +116,6 @@ Model selection and semiparametric inference for bivariate failure-time data. Journal of the American Statistical Association, 95 (449), 62-72. -Wanling, H. and A. Prokhorov (2011). -A goodness-of-fit test for copulas. -Submitted for publication. - White, H. (1982) Maximum likelihood estimation of misspecified models, Econometrica, 50, 1-26. Modified: pkg/man/RVineGofTest.Rd =================================================================== --- pkg/man/RVineGofTest.Rd 2014-02-07 10:15:19 UTC (rev 53) +++ pkg/man/RVineGofTest.Rd 2014-02-07 10:55:37 UTC (rev 54) @@ -72,7 +72,7 @@ \details{ \code{method="White"}: \cr -This goodness-of fit test uses the information matrix equality of White (1982) and was original investigated by Wanling and Prokhorov (2011) for copulas. \cr +This goodness-of fit test uses the information matrix equality of White (1982) and was original investigated by Huang and Prokhorov (2011) for copulas. \cr Schepsmeier (2012) enhanced their approach to the vine copula case. \cr The main contribution is that under correct model specification the Fisher Information can be equivalently calculated as minus the expected Hessian matrix or as the expected outer product of the score function. The null hypothesis is @@ -85,7 +85,7 @@ } where \eqn{\boldsymbol{H}(\theta)} is the expected Hessian matrix and \eqn{\boldsymbol{C}(\theta)} is the expected outer product of the score function. \cr For the calculation of the test statistic we use the consistent maximum likelihood estimator \eqn{\hat{\theta}} and the sample counter parts of \eqn{\boldsymbol{H}(\theta)} and \eqn{\boldsymbol{C}(\theta)}. \cr -The correction of the Covariance-Matrix in the test statistic for the uncertainty in the margins is skipped. The implemented test assumes that there is no uncertainty in the margins. The correction can be found in Wanling and Prokhorov (2011) for bivariate copulas and in Schepsmeier (2013) for vine copulas. It involves multi-dimensional integrals. \cr +The correction of the Covariance-Matrix in the test statistic for the uncertainty in the margins is skipped. The implemented test assumes that there is no uncertainty in the margins. The correction can be found in Huang and Prokhorov (2011) for bivariate copulas and in Schepsmeier (2013) for vine copulas. It involves multi-dimensional integrals. \cr \code{method="IR"}: \cr As the White test the information matrix ratio test is based on the expected Hessian matrix \eqn{\boldsymbol{H}(\theta)} and the expected outer product of the score function \eqn{\boldsymbol{C}(\theta)}. \cr @@ -144,6 +144,10 @@ Goodness-of-fit tests for copulas: a review and power study. Insur. Math. Econ. 44, 199-213. +Huang, w. and A. Prokhorov (2011). +A goodness-of-fit test for copulas. +to appear in Econometric Reviews + Schepsmeier, U. (2013) A goodness-of-fit test for regular vine copula models. Preprint @@ -153,10 +157,6 @@ Efficient goodness-of-fit tests in multi-dimensional vine copula models. \url{http://arxiv.org/abs/1309.5808} -Wanling, H. and A. Prokhorov (2011). -A Goodness-of-fit Test for Copulas. -Submitted for publication. - White, H. (1982) Maximum likelihood estimation of misspecified models, Econometrica, 50, 1-26. Modified: pkg.pdf =================================================================== --- pkg.pdf 2014-02-07 10:15:19 UTC (rev 53) +++ pkg.pdf 2014-02-07 10:55:37 UTC (rev 54) @@ -7,8963 +7,15216 @@ (VineCopula-package) endobj 5 0 obj -<< /S /GoTo /D (Rfn.BetaMatrix.1) >> +<< /S /GoTo /D (Rfn.BB1Copula.1) >> endobj 8 0 obj -(BetaMatrix) +(BB1Copula) endobj 9 0 obj -<< /S /GoTo /D (Rfn.BiCopCDF.1) >> +<< /S /GoTo /D (Rfn.BB1Copula.Rdash.class.1) >> endobj 12 0 obj -(BiCopCDF) +(BB1Copula-class) endobj 13 0 obj -<< /S /GoTo /D (Rfn.BiCopChiPlot.1) >> +<< /S /GoTo /D (Rfn.BB6Copula.1) >> endobj 16 0 obj -(BiCopChiPlot) +(BB6Copula) endobj 17 0 obj -<< /S /GoTo /D (Rfn.BiCopDeriv.1) >> +<< /S /GoTo /D (Rfn.BB6Copula.Rdash.class.1) >> endobj 20 0 obj -(BiCopDeriv) +(BB6Copula-class) endobj 21 0 obj -<< /S /GoTo /D (Rfn.BiCopDeriv2.1) >> +<< /S /GoTo /D (Rfn.BB7Copula.1) >> endobj 24 0 obj -(BiCopDeriv2) +(BB7Copula) endobj 25 0 obj -<< /S /GoTo /D (Rfn.BiCopEst.1) >> +<< /S /GoTo /D (Rfn.BB7Copula.Rdash.class.1) >> endobj 28 0 obj -(BiCopEst) +(BB7Copula-class) endobj 29 0 obj -<< /S /GoTo /D (Rfn.BiCopGofTest.1) >> +<< /S /GoTo /D (Rfn.BB8Copula.1) >> endobj 32 0 obj -(BiCopGofTest) +(BB8Copula) endobj 33 0 obj -<< /S /GoTo /D (Rfn.BiCopHfunc.1) >> +<< /S /GoTo /D (Rfn.BB8Copula.Rdash.class.1) >> endobj 36 0 obj -(BiCopHfunc) +(BB8Copula-class) endobj 37 0 obj -<< /S /GoTo /D (Rfn.BiCopHfuncDeriv.1) >> +<< /S /GoTo /D (Rfn.BetaMatrix.1) >> endobj 40 0 obj -(BiCopHfuncDeriv) +(BetaMatrix) endobj 41 0 obj -<< /S /GoTo /D (Rfn.BiCopHfuncDeriv2.1) >> +<< /S /GoTo /D (Rfn.BiCopCDF.1) >> endobj 44 0 obj -(BiCopHfuncDeriv2) +(BiCopCDF) endobj 45 0 obj -<< /S /GoTo /D (Rfn.BiCopIndTest.1) >> +<< /S /GoTo /D (Rfn.BiCopChiPlot.1) >> endobj 48 0 obj -(BiCopIndTest) +(BiCopChiPlot) endobj 49 0 obj -<< /S /GoTo /D (Rfn.BiCopKPlot.1) >> +<< /S /GoTo /D (Rfn.BiCopDeriv.1) >> endobj 52 0 obj -(BiCopKPlot) +(BiCopDeriv) endobj 53 0 obj -<< /S /GoTo /D (Rfn.BiCopLambda.1) >> +<< /S /GoTo /D (Rfn.BiCopDeriv2.1) >> endobj 56 0 obj -(BiCopLambda) +(BiCopDeriv2) endobj 57 0 obj -<< /S /GoTo /D (Rfn.BiCopMetaContour.1) >> +<< /S /GoTo /D (Rfn.BiCopEst.1) >> endobj 60 0 obj -(BiCopMetaContour) +(BiCopEst) endobj 61 0 obj -<< /S /GoTo /D (Rfn.BiCopName.1) >> +<< /S /GoTo /D (Rfn.BiCopGofTest.1) >> endobj 64 0 obj -(BiCopName) +(BiCopGofTest) endobj 65 0 obj -<< /S /GoTo /D (Rfn.BiCopPar2Beta.1) >> +<< /S /GoTo /D (Rfn.BiCopHfunc.1) >> endobj 68 0 obj -(BiCopPar2Beta) +(BiCopHfunc) endobj 69 0 obj -<< /S /GoTo /D (Rfn.BiCopPar2TailDep.1) >> +<< /S /GoTo /D (Rfn.BiCopHfuncDeriv.1) >> endobj 72 0 obj -(BiCopPar2TailDep) +(BiCopHfuncDeriv) endobj 73 0 obj -<< /S /GoTo /D (Rfn.BiCopPar2Tau.1) >> +<< /S /GoTo /D (Rfn.BiCopHfuncDeriv2.1) >> endobj 76 0 obj -(BiCopPar2Tau) +(BiCopHfuncDeriv2) endobj 77 0 obj -<< /S /GoTo /D (Rfn.BiCopPDF.1) >> +<< /S /GoTo /D (Rfn.BiCopIndTest.1) >> endobj 80 0 obj -(BiCopPDF) +(BiCopIndTest) endobj 81 0 obj -<< /S /GoTo /D (Rfn.BiCopSelect.1) >> +<< /S /GoTo /D (Rfn.BiCopKPlot.1) >> endobj 84 0 obj -(BiCopSelect) +(BiCopKPlot) endobj 85 0 obj -<< /S /GoTo /D (Rfn.BiCopSim.1) >> +<< /S /GoTo /D (Rfn.BiCopLambda.1) >> endobj 88 0 obj -(BiCopSim) +(BiCopLambda) endobj 89 0 obj -<< /S /GoTo /D (Rfn.BiCopTau2Par.1) >> +<< /S /GoTo /D (Rfn.BiCopMetaContour.1) >> endobj 92 0 obj -(BiCopTau2Par) +(BiCopMetaContour) endobj 93 0 obj -<< /S /GoTo /D (Rfn.BiCopVuongClarke.1) >> +<< /S /GoTo /D (Rfn.BiCopName.1) >> endobj 96 0 obj -(BiCopVuongClarke) +(BiCopName) endobj 97 0 obj -<< /S /GoTo /D (Rfn.C2RVine.1) >> +<< /S /GoTo /D (Rfn.BiCopPar2Beta.1) >> endobj 100 0 obj -(C2RVine) +(BiCopPar2Beta) endobj 101 0 obj -<< /S /GoTo /D (Rfn.D2RVine.1) >> +<< /S /GoTo /D (Rfn.BiCopPar2TailDep.1) >> endobj 104 0 obj -(D2RVine) +(BiCopPar2TailDep) endobj 105 0 obj -<< /S /GoTo /D (Rfn.daxreturns.1) >> +<< /S /GoTo /D (Rfn.BiCopPar2Tau.1) >> endobj 108 0 obj -(daxreturns) +(BiCopPar2Tau) endobj 109 0 obj -<< /S /GoTo /D (Rfn.RVineAIC/BIC.1) >> +<< /S /GoTo /D (Rfn.BiCopPDF.1) >> endobj 112 0 obj -(RVineAIC/BIC) +(BiCopPDF) endobj 113 0 obj -<< /S /GoTo /D (Rfn.RVineClarkeTest.1) >> +<< /S /GoTo /D (Rfn.BiCopSelect.1) >> endobj 116 0 obj -(RVineClarkeTest) +(BiCopSelect) endobj 117 0 obj -<< /S /GoTo /D (Rfn.RVineCopSelect.1) >> +<< /S /GoTo /D (Rfn.BiCopSim.1) >> endobj 120 0 obj -(RVineCopSelect) +(BiCopSim) endobj 121 0 obj -<< /S /GoTo /D (Rfn.RVineCor2pcor.1) >> +<< /S /GoTo /D (Rfn.BiCopTau2Par.1) >> endobj 124 0 obj -(RVineCor2pcor) +(BiCopTau2Par) endobj 125 0 obj -<< /S /GoTo /D (Rfn.RVineGofTest.1) >> +<< /S /GoTo /D (Rfn.BiCopVuongClarke.1) >> endobj 128 0 obj -(RVineGofTest) +(BiCopVuongClarke) endobj 129 0 obj -<< /S /GoTo /D (Rfn.RVineGrad.1) >> +<< /S /GoTo /D (Rfn.C2RVine.1) >> endobj 132 0 obj -(RVineGrad) +(C2RVine) endobj 133 0 obj -<< /S /GoTo /D (Rfn.RVineHessian.1) >> +<< /S /GoTo /D (Rfn.D2RVine.1) >> endobj 136 0 obj -(RVineHessian) +(D2RVine) endobj 137 0 obj -<< /S /GoTo /D (Rfn.RVineLogLik.1) >> +<< /S /GoTo /D (Rfn.daxreturns.1) >> endobj 140 0 obj -(RVineLogLik) +(daxreturns) endobj 141 0 obj -<< /S /GoTo /D (Rfn.RVineMatrix.1) >> +<< /S /GoTo /D (Rfn.dduCopula.1) >> endobj 144 0 obj -(RVineMatrix) +(dduCopula) endobj 145 0 obj -<< /S /GoTo /D (Rfn.RVineMatrixCheck.1) >> +<< /S /GoTo /D (Rfn.joeBiCopula.1) >> endobj 148 0 obj -(RVineMatrixCheck) +(joeBiCopula) endobj 149 0 obj -<< /S /GoTo /D (Rfn.RVineMatrixNormalize.1) >> +<< /S /GoTo /D (Rfn.joeBiCopula.Rdash.class.1) >> endobj 152 0 obj -(RVineMatrixNormalize) +(joeBiCopula-class) endobj 153 0 obj -<< /S /GoTo /D (Rfn.RVineMLE.1) >> +<< /S /GoTo /D (Rfn.RVineAIC/BIC.1) >> endobj 156 0 obj -(RVineMLE) +(RVineAIC/BIC) endobj 157 0 obj -<< /S /GoTo /D (Rfn.RVinePar2Beta.1) >> +<< /S /GoTo /D (Rfn.RVineClarkeTest.1) >> endobj 160 0 obj -(RVinePar2Beta) +(RVineClarkeTest) endobj 161 0 obj -<< /S /GoTo /D (Rfn.RVinePar2Tau.1) >> +<< /S /GoTo /D (Rfn.RVineCopSelect.1) >> endobj 164 0 obj -(RVinePar2Tau) +(RVineCopSelect) endobj 165 0 obj -<< /S /GoTo /D (Rfn.RVinePIT.1) >> +<< /S /GoTo /D (Rfn.RVineCor2pcor.1) >> endobj 168 0 obj -(RVinePIT) +(RVineCor2pcor) endobj 169 0 obj -<< /S /GoTo /D (Rfn.RVineSeqEst.1) >> +<< /S /GoTo /D (Rfn.RVineGofTest.1) >> endobj 172 0 obj -(RVineSeqEst) +(RVineGofTest) endobj 173 0 obj -<< /S /GoTo /D (Rfn.RVineSim.1) >> +<< /S /GoTo /D (Rfn.RVineGrad.1) >> endobj 176 0 obj -(RVineSim) +(RVineGrad) endobj 177 0 obj -<< /S /GoTo /D (Rfn.RVineStdError.1) >> +<< /S /GoTo /D (Rfn.RVineHessian.1) >> endobj 180 0 obj -(RVineStdError) +(RVineHessian) endobj 181 0 obj -<< /S /GoTo /D (Rfn.RVineStructureSelect.1) >> +<< /S /GoTo /D (Rfn.RVineLogLik.1) >> endobj 184 0 obj -(RVineStructureSelect) +(RVineLogLik) endobj 185 0 obj -<< /S /GoTo /D (Rfn.RVineTreePlot.1) >> +<< /S /GoTo /D (Rfn.RVineMatrix.1) >> endobj 188 0 obj -(RVineTreePlot) +(RVineMatrix) endobj 189 0 obj -<< /S /GoTo /D (Rfn.RVineVuongTest.1) >> +<< /S /GoTo /D (Rfn.RVineMatrixCheck.1) >> endobj 192 0 obj -(RVineVuongTest) +(RVineMatrixCheck) endobj 193 0 obj -<< /S /GoTo /D (Rfn.TauMatrix.1) >> +<< /S /GoTo /D (Rfn.RVineMatrixNormalize.1) >> endobj 196 0 obj -(TauMatrix) +(RVineMatrixNormalize) endobj 197 0 obj -<< /S /GoTo /D (index.0) >> +<< /S /GoTo /D (Rfn.RVineMLE.1) >> endobj 200 0 obj -(Index) +(RVineMLE) endobj 201 0 obj -<< /S /GoTo /D [202 0 R /Fit] >> +<< /S /GoTo /D (Rfn.RVinePar2Beta.1) >> endobj -221 0 obj << -/Length 1264 +204 0 obj +(RVinePar2Beta) +endobj +205 0 obj +<< /S /GoTo /D (Rfn.RVinePar2Tau.1) >> +endobj +208 0 obj +(RVinePar2Tau) +endobj +209 0 obj +<< /S /GoTo /D (Rfn.RVinePIT.1) >> +endobj +212 0 obj +(RVinePIT) +endobj +213 0 obj +<< /S /GoTo /D (Rfn.RVineSeqEst.1) >> +endobj +216 0 obj +(RVineSeqEst) +endobj +217 0 obj +<< /S /GoTo /D (Rfn.RVineSim.1) >> +endobj +220 0 obj +(RVineSim) +endobj +221 0 obj +<< /S /GoTo /D (Rfn.RVineStdError.1) >> +endobj +224 0 obj +(RVineStdError) +endobj +225 0 obj +<< /S /GoTo /D (Rfn.RVineStructureSelect.1) >> +endobj +228 0 obj +(RVineStructureSelect) +endobj +229 0 obj +<< /S /GoTo /D (Rfn.RVineTreePlot.1) >> +endobj +232 0 obj +(RVineTreePlot) +endobj +233 0 obj +<< /S /GoTo /D (Rfn.RVineVuongTest.1) >> +endobj +236 0 obj +(RVineVuongTest) +endobj +237 0 obj +<< /S /GoTo /D (Rfn.surClaytonCopula.1) >> +endobj +240 0 obj +(surClaytonCopula) +endobj +241 0 obj +<< /S /GoTo /D (Rfn.surClaytonCopula.Rdash.class.1) >> +endobj +244 0 obj +(surClaytonCopula-class) +endobj +245 0 obj +<< /S /GoTo /D (Rfn.surGumbelCopula.1) >> +endobj +248 0 obj +(surGumbelCopula) +endobj +249 0 obj +<< /S /GoTo /D (Rfn.surGumbelCopula.Rdash.class.1) >> +endobj +252 0 obj +(surGumbelCopula-class) +endobj +253 0 obj +<< /S /GoTo /D (Rfn.TauMatrix.1) >> +endobj +256 0 obj +(TauMatrix) +endobj +257 0 obj +<< /S /GoTo /D (Rfn.tawnT1Copula.1) >> +endobj +260 0 obj +(tawnT1Copula) +endobj +261 0 obj +<< /S /GoTo /D (Rfn.tawnT1Copula.Rdash.class.1) >> +endobj +264 0 obj +(tawnT1Copula-class) +endobj +265 0 obj +<< /S /GoTo /D (Rfn.tawnT2Copula.1) >> +endobj +268 0 obj +(tawnT2Copula) +endobj +269 0 obj +<< /S /GoTo /D (Rfn.tawnT2Copula.Rdash.class.1) >> +endobj +272 0 obj +(tawnT2Copula-class) +endobj +273 0 obj +<< /S /GoTo /D (Rfn.vineCopula.1) >> +endobj +276 0 obj +(vineCopula) +endobj +277 0 obj +<< /S /GoTo /D (Rfn.vineCopula.Rdash.class.1) >> +endobj +280 0 obj +(vineCopula-class) +endobj +281 0 obj +<< /S /GoTo /D (index.0) >> +endobj +284 0 obj +(Index) +endobj +285 0 obj +<< /S /GoTo /D [286 0 R /Fit] >> +endobj +303 0 obj << +/Length 1223 /Filter /FlateDecode >> stream -xYr6+4x|tLc+qSOfv0 KIB!!ݯ/@4h! 88` `pzz8 - 1 -W$q"8"8a5[i)aJ\oJ;m'ء1H4q2[CJ^A c )Ycc)Dq0QJ4&wk;3'> -sf( %J'B"Ļ+DDJx܁(Fh[yf;a>p›Vz,>-fL=e -aBXBfҖWSFd3Qһtx_q{Ǯ -$C'ƬmbuZixɛqm[uD􇏦G @g8(~jS/6g| 6B}oCR'W@kw|ՍeSX6lyuY.ylA]<)M/jv*hnjpzڼkHIvh ӚhmiF=Թq)klw;:JrӥMv: nX+m#^t㸉v]ʆ)ٛS̶XʻV/U33#6H..woIͅ~~ݪfMs4Jp3ѸV:$ Z?mxţ,]=Lԅ8nEltTŖXZ^_FGT;hV\Kk4[lK^n -^8dz~ +wcS jJ͞L1<@le9\zOCEv11p;BÉY_ۡnܶ>5F#-:-di/ghjG6qcd7LbT(Sh֝ED1gG^H:")[BIC@<7#%8+&'oe}oPCӣcьkEx;g֌~C'7wrs{<{<}%.>}t9dO'74><ʧ|}ܟ;RX{W>$AT;pd!'@tM`%$9$1|"χ+M{m] y L ;M Fȟ/83V]L 8:[G1` tkѿWZ +xY[S6~WZ|w)a6l;SaDŶRYf`},)u,)9Ks.Ox-N~"Pe'G()&$'K:uțe$VsnK';,|e'JP}Q-OJN?}BUR؏%!Jl$Ҷ${b~k${ipn3AUEњ^ݥ bG kj ?t4(@8c +8C8άͳAPAߏ7`tM 6Yy1`>x8팝\5r}!?t>7dEevl)zng b%m؜Ϧm@ƬNg0C5M.ZsFϋktq\VPsnIEڙvaKmOUAf:s*~{(u立[i015<;q0NchH'{")D:9R̀OwFtzFzϻ8H+Nȇ!π {p +pqO6q_K#y8Bto퟈?K(= endstream endobj -202 0 obj << +286 0 obj << /Type /Page -/Contents 221 0 R -/Resources 220 0 R +/Contents 303 0 R +/Resources 302 0 R /MediaBox [0 0 595.276 841.89] -/Parent 230 0 R -/Annots [ 203 0 R 204 0 R 205 0 R 206 0 R 207 0 R 208 0 R 209 0 R 210 0 R 211 0 R 212 0 R 213 0 R 214 0 R 215 0 R 216 0 R ] +/Parent 312 0 R +/Annots [ 287 0 R 288 0 R 289 0 R 290 0 R 291 0 R 292 0 R 293 0 R 294 0 R 295 0 R 296 0 R 297 0 R 298 0 R ] >> endobj -203 0 obj << +287 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 267.172 513.085 275.919] -/A << /S /GoTo /D (page.2) >> +/Rect [506.111 243.413 513.085 252.259] +/A << /S /GoTo /D (page.3) >> >> endobj -204 0 obj << +288 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 255.117 513.085 263.964] -/A << /S /GoTo /D (page.5) >> +/Rect [506.111 231.435 513.085 240.281] +/A << /S /GoTo /D (page.6) >> >> endobj -205 0 obj << +289 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 243.162 513.085 252.008] -/A << /S /GoTo /D (page.6) >> +/Rect [506.111 219.457 513.085 228.034] +/A << /S /GoTo /D (page.7) >> >> endobj -206 0 obj << +290 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [506.111 231.207 513.085 240.053] +/Rect [506.111 207.479 513.085 216.325] /A << /S /GoTo /D (page.8) >> >> endobj -207 0 obj << +291 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 219.251 513.085 228.098] -/A << /S /GoTo /D (page.10) >> +/Rect [506.111 195.381 513.085 204.347] +/A << /S /GoTo /D (page.9) >> >> endobj -208 0 obj << +292 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 207.396 513.085 216.143] -/A << /S /GoTo /D (page.11) >> +/Rect [501.13 183.523 513.085 192.369] +/A << /S /GoTo /D (page.10) >> >> endobj -209 0 obj << +293 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 195.341 513.085 204.188] -/A << /S /GoTo /D (page.13) >> +/Rect [501.13 171.644 513.085 180.391] +/A << /S /GoTo /D (page.11) >> >> endobj -210 0 obj << +294 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 183.386 513.085 192.233] -/A << /S /GoTo /D (page.15) >> +/Rect [501.13 159.666 513.085 168.413] +/A << /S /GoTo /D (page.12) >> >> endobj -211 0 obj << +295 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 171.431 513.085 180.277] -/A << /S /GoTo /D (page.18) >> +/Rect [501.13 147.589 513.085 156.435] +/A << /S /GoTo /D (page.13) >> >> endobj -212 0 obj << +296 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 159.476 513.085 168.322] -/A << /S /GoTo /D (page.20) >> +/Rect [501.13 135.71 513.085 144.458] +/A << /S /GoTo /D (page.14) >> >> endobj -213 0 obj << +297 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 147.62 513.085 156.367] -/A << /S /GoTo /D (page.22) >> +/Rect [501.13 123.633 513.085 132.48] +/A << /S /GoTo /D (page.15) >> >> endobj -214 0 obj << +298 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 135.565 513.085 144.412] -/A << /S /GoTo /D (page.23) >> ->> endobj -215 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 123.71 513.085 132.457] -/A << /S /GoTo /D (page.24) >> ->> endobj -216 0 obj << -/Type /Annot -/Subtype /Link -/Border[0 0 0]/H/I/C[1 0 0] /Rect [501.13 111.655 513.085 120.502] -/A << /S /GoTo /D (page.26) >> +/A << /S /GoTo /D (page.16) >> >> endobj -222 0 obj << -/D [202 0 R /XYZ 99.346 773.487 null] +304 0 obj << +/D [286 0 R /XYZ 99.346 773.487 null] >> endobj -223 0 obj << -/D [202 0 R /XYZ 100.346 742.532 null] +305 0 obj << +/D [286 0 R /XYZ 100.346 742.532 null] >> endobj -224 0 obj << -/D [202 0 R /XYZ 100.346 742.532 null] +306 0 obj << +/D [286 0 R /XYZ 100.346 742.532 null] >> endobj -228 0 obj << -/D [202 0 R /XYZ 100.346 308.367 null] +310 0 obj << +/D [286 0 R /XYZ 100.346 284.748 null] >> endobj -220 0 obj << -/Font << /F35 225 0 R /F36 226 0 R /F22 227 0 R /F39 229 0 R >> +302 0 obj << +/Font << /F35 307 0 R /F36 308 0 R /F22 309 0 R /F39 311 0 R >> /ProcSet [ /PDF /Text ] >> endobj -280 0 obj << -/Length 1371 +377 0 obj << +/Length 1025 /Filter /FlateDecode >> stream -xKw6,Bx,;I3g2g:t -( i_+$;6HHHB߽\] Yf% KBZ;G#AhE!(*pv =L"{"[|^nۜ[>{.͐nMK.N(H$U=j -ESRDmOA@ yU[r51A60gػr"0HoG 3 -cGcWxGqؓ_wbCT,88!=׵`a?|laM%\w"Dhk>oHS?ՆnM# 81ixḱ4MbMFx2{Abl1θc~ڧ$Gze<ɉ0¯\Njn  ƅ7bǏ&*cs$#r}~ٌ"\Ɯ0On!Nqoq? pu tSsr1 O3sys=K`A7&[BrnsJM8d'mh )౹]4]?^(ӍsgsUjO!mvj\knP(06d[r%(b-z4,>"ד(rl8 +˺9wQ1ֆ + +dBǯB1$ssW˱% lZL>%uʧ{?~fCpڛyS(E)e)kf3s|9CPXr, `иwͷO),k8^`#kACuJr@cVf-xٔkmA^%kjd3SWiuq#Vۑw;q.[v*sF=Ogb ?)^ UV9 Fuk1ht~ao?gY}=C9ayj/W( +q +\>jBv}VeSl WFLAaj{bC(BB1 'W'JL̡Aj}B_ +~Pg;''"w""4TRnZ#5$?L d]S>!ҜMڇ& vLYgNw]ϰ 6vplvLKccf};gCfl-S[OoU endstream endobj -279 0 obj << +376 0 obj << /Type /Page -/Contents 280 0 R -/Resources 278 0 R +/Contents 377 0 R +/Resources 375 0 R /MediaBox [0 0 595.276 841.89] -/Parent 230 0 R -/Annots [ 217 0 R 218 0 R 219 0 R 245 0 R 246 0 R 247 0 R 248 0 R 249 0 R 250 0 R 251 0 R 252 0 R 253 0 R 254 0 R 255 0 R 256 0 R 257 0 R 258 0 R 259 0 R 260 0 R 261 0 R 262 0 R 263 0 R 264 0 R 265 0 R 266 0 R 267 0 R 268 0 R 269 0 R 270 0 R 271 0 R 272 0 R 273 0 R 274 0 R 275 0 R 276 0 R 277 0 R ] +/Parent 312 0 R +/Annots [ 299 0 R 300 0 R 301 0 R 325 0 R 326 0 R 327 0 R 328 0 R 329 0 R 330 0 R 331 0 R 332 0 R 333 0 R 334 0 R 335 0 R 336 0 R 337 0 R 338 0 R 339 0 R 340 0 R 341 0 R 342 0 R 343 0 R 344 0 R 345 0 R 346 0 R 347 0 R 348 0 R 349 0 R 350 0 R 351 0 R 352 0 R 353 0 R 354 0 R 355 0 R 356 0 R 357 0 R 358 0 R 359 0 R 360 0 R 361 0 R 362 0 R 363 0 R 364 0 R 365 0 R 366 0 R 367 0 R 368 0 R 369 0 R 370 0 R 371 0 R 372 0 R 373 0 R ] >> endobj -217 0 obj << +299 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] /Rect [501.13 731.474 513.085 740.321] -/A << /S /GoTo /D (page.28) >> +/A << /S /GoTo /D (page.18) >> >> endobj -218 0 obj << +300 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 719.519 513.085 728.365] -/A << /S /GoTo /D (page.31) >> +/Rect [501.13 719.321 513.085 728.167] +/A << /S /GoTo /D (page.20) >> >> endobj -219 0 obj << +301 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 707.564 513.085 716.41] -/A << /S /GoTo /D (page.33) >> +/Rect [501.13 707.267 513.085 716.014] +/A << /S /GoTo /D (page.21) >> >> endobj -245 0 obj << +325 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 695.608 513.085 704.455] -/A << /S /GoTo /D (page.34) >> +/Rect [501.13 695.113 513.085 703.861] +/A << /S /GoTo /D (page.24) >> >> endobj -246 0 obj << +326 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 683.653 513.085 692.5] -/A << /S /GoTo /D (page.37) >> +/Rect [501.13 682.861 513.085 691.707] +/A << /S /GoTo /D (page.27) >> >> endobj -247 0 obj << +327 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 671.578 513.085 680.545] -/A << /S /GoTo /D (page.39) >> +/Rect [501.13 670.588 513.085 679.554] +/A << /S /GoTo /D (page.29) >> >> endobj -248 0 obj << +328 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 659.842 513.085 668.59] -/A << /S /GoTo /D (page.41) >> +/Rect [501.13 658.554 513.085 667.401] +/A << /S /GoTo /D (page.30) >> >> endobj -249 0 obj << +329 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 647.887 513.085 656.634] -/A << /S /GoTo /D (page.44) >> +/Rect [501.13 646.401 513.085 655.247] +/A << /S /GoTo /D (page.32) >> >> endobj -250 0 obj << +330 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 635.833 513.085 644.679] -/A << /S /GoTo /D (page.45) >> +/Rect [501.13 634.247 513.085 643.094] +/A << /S /GoTo /D (page.33) >> >> endobj -251 0 obj << +331 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 623.877 513.085 632.724] -/A << /S /GoTo /D (page.47) >> +/Rect [501.13 622.094 513.085 630.941] +/A << /S /GoTo /D (page.35) >> >> endobj -252 0 obj << +332 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 611.803 513.085 620.769] -/A << /S /GoTo /D (page.49) >> +/Rect [501.13 609.941 513.085 618.787] +/A << /S /GoTo /D (page.37) >> >> endobj -253 0 obj << +333 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 599.967 513.085 608.814] -/A << /S /GoTo /D (page.51) >> +/Rect [501.13 597.787 513.085 606.634] +/A << /S /GoTo /D (page.40) >> >> endobj -254 0 obj << +334 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 588.012 513.085 596.859] +/Rect [501.13 585.734 513.085 594.481] +/A << /S /GoTo /D (page.42) >> +>> endobj +335 0 obj << +/Type /Annot +/Subtype /Link +/Border[0 0 0]/H/I/C[1 0 0] +/Rect [501.13 573.481 513.085 582.327] +/A << /S /GoTo /D (page.43) >> +>> endobj +336 0 obj << +/Type /Annot +/Subtype /Link +/Border[0 0 0]/H/I/C[1 0 0] +/Rect [501.13 561.328 513.085 570.174] +/A << /S /GoTo /D (page.46) >> +>> endobj +337 0 obj << +/Type /Annot +/Subtype /Link +/Border[0 0 0]/H/I/C[1 0 0] +/Rect [501.13 549.174 513.085 558.021] +/A << /S /GoTo /D (page.48) >> +>> endobj +338 0 obj << +/Type /Annot +/Subtype /Link +/Border[0 0 0]/H/I/C[1 0 0] +/Rect [501.13 537.021 513.085 545.868] +/A << /S /GoTo /D (page.50) >> +>> endobj +339 0 obj << +/Type /Annot +/Subtype /Link +/Border[0 0 0]/H/I/C[1 0 0] +/Rect [501.13 524.868 513.085 533.714] /A << /S /GoTo /D (page.53) >> >> endobj -255 0 obj << +340 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 576.057 513.085 584.903] +/Rect [501.13 512.714 513.085 521.561] /A << /S /GoTo /D (page.54) >> >> endobj -256 0 obj << +341 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 564.102 513.085 572.948] -/A << /S /GoTo /D (page.55) >> +/Rect [501.13 500.561 513.085 509.408] +/A << /S /GoTo /D (page.56) >> >> endobj -257 0 obj << +342 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 552.146 513.085 560.993] -/A << /S /GoTo /D (page.57) >> +/Rect [501.13 488.408 513.085 497.254] +/A << /S /GoTo /D (page.58) >> >> endobj -258 0 obj << +343 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 540.072 513.085 549.038] -/A << /S /GoTo /D (page.59) >> +/Rect [501.13 476.254 513.085 485.101] +/A << /S /GoTo /D (page.60) >> >> endobj -259 0 obj << +344 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 528.236 513.085 537.083] -/A << /S /GoTo /D (page.61) >> +/Rect [501.13 464.101 513.085 472.948] +/A << /S /GoTo /D (page.62) >> >> endobj -260 0 obj << +345 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 516.281 513.085 525.128] -/A << /S /GoTo /D (page.65) >> +/Rect [501.13 451.948 513.085 460.794] +/A << /S /GoTo /D (page.63) >> >> endobj -261 0 obj << +346 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 504.326 513.085 513.172] -/A << /S /GoTo /D (page.67) >> +/Rect [501.13 439.794 513.085 448.641] +/A << /S /GoTo /D (page.64) >> >> endobj -262 0 obj << +347 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 492.251 513.085 501.217] -/A << /S /GoTo /D (page.69) >> +/Rect [501.13 427.641 513.085 436.488] +/A << /S /GoTo /D (page.65) >> >> endobj -263 0 obj << +348 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 480.415 513.085 489.262] -/A << /S /GoTo /D (page.70) >> +/Rect [501.13 415.488 513.085 424.334] +/A << /S /GoTo /D (page.66) >> >> endobj -264 0 obj << +349 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 468.46 513.085 477.307] -/A << /S /GoTo /D (page.73) >> +/Rect [501.13 403.334 513.085 412.181] +/A << /S /GoTo /D (page.67) >> >> endobj -265 0 obj << +350 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 456.505 513.085 465.352] -/A << /S /GoTo /D (page.74) >> +/Rect [501.13 391.062 513.085 400.028] +/A << /S /GoTo /D (page.69) >> >> endobj -266 0 obj << +351 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 444.55 513.085 453.397] -/A << /S /GoTo /D (page.75) >> +/Rect [501.13 379.028 513.085 387.874] +/A << /S /GoTo /D (page.71) >> >> endobj -267 0 obj << +352 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 432.595 513.085 441.172] -/A << /S /GoTo /D (page.77) >> +/Rect [501.13 366.874 513.085 375.721] +/A << /S /GoTo /D (page.73) >> >> endobj -268 0 obj << +353 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 420.64 513.085 429.486] -/A << /S /GoTo /D (page.78) >> +/Rect [501.13 354.721 513.085 363.299] +/A << /S /GoTo /D (page.77) >> >> endobj -269 0 obj << +354 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] -/Rect [501.13 408.565 513.085 417.531] +/Rect [501.13 342.448 513.085 351.415] /A << /S /GoTo /D (page.79) >> >> endobj -270 0 obj << +355 0 obj << /Type /Annot /Subtype /Link /Border[0 0 0]/H/I/C[1 0 0] [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/vinecopula -r 54 From noreply at r-forge.r-project.org Fri Feb 7 13:23:34 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 7 Feb 2014 13:23:34 +0100 (CET) Subject: [Vinecopula-commits] r55 - pkg/man Message-ID: <20140207122334.AA071186CA6@r-forge.r-project.org> Author: ben_graeler Date: 2014-02-07 13:23:34 +0100 (Fri, 07 Feb 2014) New Revision: 55 Added: pkg/man/copulaFromFamilyIndex.Rd Log: - forgot to add the documentation file to the svn Added: pkg/man/copulaFromFamilyIndex.Rd =================================================================== --- pkg/man/copulaFromFamilyIndex.Rd (rev 0) +++ pkg/man/copulaFromFamilyIndex.Rd 2014-02-07 12:23:34 UTC (rev 55) @@ -0,0 +1,33 @@ +\name{copulaFromFamilyIndex} +\alias{copulaFromFamilyIndex} + +\title{ +Construction of a copula object from a VineCopula family index +} +\description{ +A VineCopula family index along with its parameters is used to construct a corresponding \code{\linkS4class{copula}} object. +} +\usage{ +copulaFromFamilyIndex(family, par, par2 = 0) +} + +\arguments{ + \item{family}{a family inde aS DEFINED IN \code{\link{VineCopula-package}}} + \item{par}{its first parameter value} + \item{par2}{if present, its second parameter} +} +\value{An object inherting \code{\linkS4class{copula}} corresponding to the specific family.} + +\author{Benedikt Graeler} + +\examples{ +# normalCopula with parameter 0.5 +copulaFromFamilyIndex(1,0.5) + +# rotated Tawn T2 copula with parameters +copulaFromFamilyIndex(224, -2, 0.5) +} +% Add one or more standard keywords, see file 'KEYWORDS' in the +% R documentation directory. +\keyword{ ~kwd1 } +\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line From noreply at r-forge.r-project.org Fri Feb 7 16:44:48 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 7 Feb 2014 16:44:48 +0100 (CET) Subject: [Vinecopula-commits] r56 - in pkg: . R Message-ID: <20140207154448.58B861862D9@r-forge.r-project.org> Author: ben_graeler Date: 2014-02-07 16:44:47 +0100 (Fri, 07 Feb 2014) New Revision: 56 Removed: pkg/R/wrappingCFunctions.r Modified: pkg/DESCRIPTION pkg/R/0_prep_object.R pkg/R/BB8copula.R pkg/R/vineCopulas.R Log: - copula needs to be in depends as otherwise the order of loading packages matters Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2014-02-07 12:23:34 UTC (rev 55) +++ pkg/DESCRIPTION 2014-02-07 15:44:47 UTC (rev 56) @@ -5,8 +5,8 @@ Date: 2014-02-07 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler Maintainer: Ulf Schepsmeier -Depends: R (>= 2.11.0) -Imports: MASS, mvtnorm, igraph, copula, methods +Depends: R (>= 2.11.0), copula +Imports: MASS, mvtnorm, igraph, methods Suggests: CDVine, TSP, ADGofTest Description: This package provides functions for statistical inference of vine copulas. It contains tools for bivariate exploratory data analysis, bivariate copula selection and (vine) tree construction. Models can be estimated either sequentially or by joint maximum likelihood estimation. Sampling algorithms and plotting methods are also 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/R/0_prep_object.R =================================================================== --- pkg/R/0_prep_object.R 2014-02-07 12:23:34 UTC (rev 55) +++ pkg/R/0_prep_object.R 2014-02-07 15:44:47 UTC (rev 56) @@ -43,6 +43,10 @@ constr(c(par,par2)) } +# generic fitting +## make fitCopula from copula generic +setGeneric("fitCopula", fitCopula) + ######################################################### ## generic wrapper functions to the VineCopula package ## ######################################################### Modified: pkg/R/BB8copula.R =================================================================== --- pkg/R/BB8copula.R 2014-02-07 12:23:34 UTC (rev 55) +++ pkg/R/BB8copula.R 2014-02-07 15:44:47 UTC (rev 56) @@ -242,7 +242,7 @@ setMethod("tau",signature("r270BB8Copula"),linkVineCop.tau) setMethod("tailIndex",signature("r270BB8Copula"),linkVineCop.tailIndex) -### et union +### set union setClassUnion("twoParamBiCop",c("BB1Copula","BB6Copula","BB7Copula","BB8Copula", "surBB1Copula","surBB6Copula","surBB7Copula","surBB8Copula", @@ -262,7 +262,7 @@ copFit <- copulaFromFamilyIndex(copula at family, fit$par, fit$par2) new("fitCopula", estimate = c(fit$par, fit$par2), var.est = cbind(fit$se, fit$se2), - method = "estimation based on 'maximum pseudo-likelihood' via BiCopEst", + method = "maximum pseudo-likelihood via BiCopEst", loglik = sum(dCopula(data, copFit, log=T)), fitting.stats=list(convergence = as.integer(NA)), nsample = nrow(data), copula=copFit) Modified: pkg/R/vineCopulas.R =================================================================== --- pkg/R/vineCopulas.R 2014-02-07 12:23:34 UTC (rev 55) +++ pkg/R/vineCopulas.R 2014-02-07 15:44:47 UTC (rev 56) @@ -90,9 +90,6 @@ setMethod("rCopula", signature("numeric","vineCopula"), rRVine) -## make fitCopula from copula generic -setGeneric("fitCopula",fitCopula) - # fitting using RVine fitVineCop <- function(copula, data, method=list(StructureSelect=FALSE, indeptest=FALSE)) { Deleted: pkg/R/wrappingCFunctions.r =================================================================== --- pkg/R/wrappingCFunctions.r 2014-02-07 12:23:34 UTC (rev 55) +++ pkg/R/wrappingCFunctions.r 2014-02-07 15:44:47 UTC (rev 56) @@ -1,30 +0,0 @@ -# wrapping C functions to be used in spcopula - -RHfunc1 <- function(fam, n, u, param) { - .C("Hfunc1", as.integer(fam), as.integer(n), as.double(u[,2]), as.double(u[,1]), - as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), - PACKAGE = "VineCopula") -} - -RHfunc2 <- function(fam, n, u, param) { - .C("Hfunc2", as.integer(fam), as.integer(n), as.double(u[,1]), as.double(u[,2]), - as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), - PACKAGE = "VineCopula") -} - -RLL_mod_separate <- function(fam, n, u, param) { - .C("LL_mod_seperate", as.integer(fam), as.integer(n), as.double(u[,1]), - as.double(u[,2]), as.double(param[1]), as.double(param[2]), - as.double(rep(0, n)), PACKAGE = "VineCopula") -} - -RarchCDF <- function(fam, n, u, param) { - .C("archCDF", as.double(u[,1]), as.double(u[,2]), as.integer(n), as.double(param), - as.integer(fam), as.double(rep(0, n)), PACKAGE = "VineCopula") -} - -Rpcc <- function(fam, n, param) { - .C("pcc", as.integer(n), as.integer(2), as.integer(fam), as.integer(1), - as.double(param[1]), as.double(param[2]), as.double(rep(0, n * 2)), - PACKAGE = "VineCopula") -} \ No newline at end of file From noreply at r-forge.r-project.org Thu Feb 13 14:48:20 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 13 Feb 2014 14:48:20 +0100 (CET) Subject: [Vinecopula-commits] r57 - in pkg: . R Message-ID: <20140213134820.58CEB18675F@r-forge.r-project.org> Author: ben_graeler Date: 2014-02-13 14:48:19 +0100 (Thu, 13 Feb 2014) New Revision: 57 Modified: pkg/DESCRIPTION pkg/R/0_prep_object.R Log: - check for numeber of copula parameters in links to RVine Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2014-02-07 15:44:47 UTC (rev 56) +++ pkg/DESCRIPTION 2014-02-13 13:48:19 UTC (rev 57) @@ -2,7 +2,7 @@ Type: Package Title: Statistical inference of vine copulas Version: 1.2-1 -Date: 2014-02-07 +Date: 2014-02-13 Author: Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann, Benedikt Graeler Maintainer: Ulf Schepsmeier Depends: R (>= 2.11.0), copula Modified: pkg/R/0_prep_object.R =================================================================== --- pkg/R/0_prep_object.R 2014-02-07 15:44:47 UTC (rev 56) +++ pkg/R/0_prep_object.R 2014-02-13 13:48:19 UTC (rev 57) @@ -79,7 +79,6 @@ n <- nrow(u) fam <- copula at family -# res <- RarchCDF(fam, n, u, param)[[6]] res <- .C("archCDF", as.double(u[,1]), as.double(u[,2]), as.integer(n), as.double(param), as.integer(fam), as.double(rep(0, n)), PACKAGE = "VineCopula")[[6]] return(res) @@ -94,7 +93,6 @@ n <- nrow(u) fam <- copula at family -# res <- u1 + u2 - 1 + RarchCDF(fam-10, n, cbind(1-u1,1-u2), param)[[6]] res <- u1 + u2 - 1 + .C("archCDF", as.double(1 - u1), as.double(1 - u2), as.integer(n), as.double(param), as.integer(fam - 10), as.double(rep(0, n)), PACKAGE = "VineCopula")[[6]] @@ -110,10 +108,9 @@ n <- nrow(u) fam <- copula at family -# res <- u2 - RarchCDF(fam - 20, n, cbind(1-u1,u2), -param)[[6]] u2 - .C("archCDF", as.double(1 - u1), as.double(u2), as.integer(n), - as.double(-param), as.integer(fam - 20), as.double(rep(0, n)), - PACKAGE = "VineCopula")[[6]] + as.double(-param), as.integer(fam - 20), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[6]] } # for 270 deg rotated copulas: family %in% c(33, 34, 36:40) @@ -125,47 +122,55 @@ n <- nrow(u) fam <- copula at family -# u1 - RarchCDF(fam-30, n, cbind(u1,1-u2), -param)[[6]] u1 - .C("archCDF", as.double(u1), as.double(1 - u2), as.integer(n), - as.double(-param), as.integer(fam - 30), as.double(rep(0, n)), - PACKAGE = "VineCopula")[[6]] + as.double(-param), as.integer(fam - 30), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[6]] } ## derivtives/h-function from BiCopHfunc # ddu linkVineCop.ddu <- function (u, copula) { param <- copula at parameters + + if(length(param)==1) + param <- c(param,0) + u <- matrix(u, ncol = 2) n <- nrow(u) fam <- copula at family -# RHfunc1(fam, n, u, param)[[7]] - .C("Hfunc1", as.integer(fam), as.integer(n), as.double(u[,2]), as.double(u[,1]), - as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), - PACKAGE = "VineCopula")[[7]] + .C("Hfunc1", as.integer(fam), as.integer(n), as.double(u[,2]), as.double(u[,1]), + as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] } # ddv linkVineCop.ddv <- function (u, copula) { param <- copula at parameters + + if(length(param)==1) + param <- c(param,0) + u <- matrix(u, ncol = 2) n <- nrow(u) fam <- copula at family -# RHfunc2(fam, n, u, param)[[7]] .C("Hfunc2", as.integer(fam), as.integer(n), as.double(u[,1]), as.double(u[,2]), - as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), - PACKAGE = "VineCopula")[[7]] + as.double(param[1]), as.double(param[2]), as.double(rep(0, n)), + PACKAGE = "VineCopula")[[7]] } ## random numbers from VineCopulaSim linkVineCop.r <- function (n, copula){ param <- copula at parameters + + if(length(param)==1) + param <- c(param,0) + fam <- copula at family if(is.na(param[2])) param <- c(param,0) -# tmp <- Rpcc(fam, n, param)[[7]] res <- .C("pcc", as.integer(n), as.integer(2), as.integer(fam), as.integer(1), as.double(param[1]), as.double(param[2]), as.double(rep(0, n * 2)), PACKAGE = "VineCopula")[[7]] @@ -175,8 +180,11 @@ ## Kendall's tau linkVineCop.tau <- function(copula) { - par <- copula at parameters - BiCopPar2Tau(copula at family, par[1], par[2]) + param <- copula at parameters + if(length(param)==1) + param <- c(param,0) + + BiCopPar2Tau(copula at family, param[1], param[2]) } ## get parameter from Kendall's tau (only for one parameter families) @@ -186,8 +194,11 @@ ## tailIndex linkVineCop.tailIndex <- function(copula) { - par <- copula at parameters - unlist(BiCopPar2TailDep(copula at family,par[1],par[2])) + param <- copula at parameters + if(length(param)==1) + param <- c(param,0) + + unlist(BiCopPar2TailDep(copula at family, param[1], param[2])) } setGeneric("dduCopula", function(u, copula, ...) standardGeneric("dduCopula")) From noreply at r-forge.r-project.org Mon Feb 17 16:52:13 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 17 Feb 2014 16:52:13 +0100 (CET) Subject: [Vinecopula-commits] r58 - in pkg: R inst Message-ID: <20140217155213.64BBF1868F8@r-forge.r-project.org> Author: ulf Date: 2014-02-17 16:52:12 +0100 (Mon, 17 Feb 2014) New Revision: 58 Modified: pkg/R/RVineMatrix.R pkg/R/RVineStructureSelect.r pkg/inst/ChangeLog Log: Problem mit der neuen igraph version in RVineStructureSelect.r geloest. Muss noch schauen, ob es sonst noch Einfluss hat. Modified: pkg/R/RVineMatrix.R =================================================================== --- pkg/R/RVineMatrix.R 2014-02-13 13:48:19 UTC (rev 57) +++ pkg/R/RVineMatrix.R 2014-02-17 15:52:12 UTC (rev 58) @@ -237,12 +237,14 @@ n = length(RVine$Tree)+1 con = list() - names = V(RVine$Tree[[1]])$name + nam = V(RVine$Tree[[1]])$name conditionedSets = NULL corresppondingParams = list() corresppondingTypes = list() + print(is.list(E(RVine$Tree[[n-1]])$conditionedSet)) + conditionedSets[[n-1]][[1]] = (E(RVine$Tree[[n-1]])$conditionedSet) for(k in 1:(n-2)){ conditionedSets[[k]] = E(RVine$Tree[[k]])$conditionedSet @@ -299,7 +301,7 @@ M[is.na(M)]=0 Type[is.na(Type)]=0 - return(RVineMatrix(M, family = Type, par = Param, par2 = Params2, names = names)) + return(RVineMatrix(M, family = Type, par = Param, par2 = Params2, names = nam)) } Modified: pkg/R/RVineStructureSelect.r =================================================================== --- pkg/R/RVineStructureSelect.r 2014-02-13 13:48:19 UTC (rev 57) +++ pkg/R/RVineStructureSelect.r 2014-02-17 15:52:12 UTC (rev 58) @@ -196,17 +196,30 @@ zr2 = E(oldVineGraph)[con[2]]$Copula.CondData.1 n2 = E(oldVineGraph)[con[2]]$Copula.CondName.1 } - if(progress == TRUE) message(n1," + ",n2," --> ", E(mst)[i]$name) + if(is.list(zr1)){ + zr1a=as.vector(zr1[[1]]) + zr2a=as.vector(zr2[[1]]) + n1a=as.vector(n1[[1]]) + n2a=as.vector(n2[[1]]) + } + else{ + zr1a=zr1 + zr2a=zr2 + n1a=n1 + n2a=n2 + } - parameterForACopula[[i]]$zr1 = zr1 - parameterForACopula[[i]]$zr2 = zr2 + if(progress == TRUE) message(n1a," + ",n2a," --> ", E(mst)[i]$name) + + parameterForACopula[[i]]$zr1 = zr1a + parameterForACopula[[i]]$zr2 = zr2a - E(mst)[i]$Copula.Data.1 = list(zr1) - E(mst)[i]$Copula.Data.2 = list(zr2) + E(mst)[i]$Copula.Data.1 = list(zr1a) + E(mst)[i]$Copula.Data.2 = list(zr2a) - E(mst)[i]$Copula.CondName.2 = n1 - E(mst)[i]$Copula.CondName.1 = n2 + E(mst)[i]$Copula.CondName.2 = n1a + E(mst)[i]$Copula.CondName.1 = n2a } outForACopula = lapply(X = parameterForACopula, FUN=wrapper_fit.ACopula, type,copulaSelectionBy,testForIndependence,testForIndependence.level,weights) @@ -270,10 +283,20 @@ }else{ zr2 = E(oldVineGraph)[con[2]]$Copula.CondData.1 } - - keine_nas = !(is.na(zr1) | is.na(zr2)) + #print(is.list(zr1)) + if(is.list(zr1)){ + zr1a=as.vector(zr1[[1]]) + zr2a=as.vector(zr2[[1]]) + } + else{ + zr1a=zr1 + zr2a=zr2 + } + 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(zr1[keine_nas],zr2[keine_nas],weights) + E(g)[i]$weight = fasttau(zr1a[keine_nas],zr2a[keine_nas],weights) name.node1 = strsplit( V(g)[con[1]]$name,split=" *[,|] *")[[1]] name.node2 = strsplit( V(g)[con[2]]$name,split=" *[,|] *")[[1]] @@ -311,9 +334,16 @@ paste(schnitt, collapse= ","), sep= " | ") - l1 = c(V(g)[con[1]]$conditionedSet,V(g)[con[1]]$conditioningSet) - l2 = c(V(g)[con[2]]$conditionedSet,V(g)[con[2]]$conditioningSet) - + if(is.list(V(g)[con[1]]$conditionedSet)) + { + l1 = c(as.vector(V(g)[con[1]]$conditionedSet[[1]]),as.vector(V(g)[con[1]]$conditioningSet[[1]])) + l2 = c(as.vector(V(g)[con[2]]$conditionedSet[[1]]),as.vector(V(g)[con[2]]$conditioningSet[[1]])) + } + else + { + l1 = c(V(g)[con[1]]$conditionedSet,V(g)[con[1]]$conditioningSet) + l2 = c(V(g)[con[2]]$conditionedSet,V(g)[con[2]]$conditioningSet) + } out = intern_SchnittDifferenz(l1,l2) suppressWarnings({E(g)$conditionedSet[i] = list(out$differenz)}) @@ -390,21 +420,39 @@ n = length(RVine$Tree)+1 con = list() - names = V(RVine$Tree[[1]])$name + nam = V(RVine$Tree[[1]])$name conditionedSets = NULL corresppondingParams = list() corresppondingTypes = list() - conditionedSets[[n-1]][[1]] = (E(RVine$Tree[[n-1]])$conditionedSet) - for(k in 1:(n-2)){ - conditionedSets[[k]] = E(RVine$Tree[[k]])$conditionedSet - corresppondingParams[[k]] = as.list(E(RVine$Tree[[k]])$Copula.param) - corresppondingTypes[[k]] = as.list(E(RVine$Tree[[k]])$Copula.type) + if(is.list(E(RVine$Tree[[n-1]])$conditionedSet)) + { + conditionedSets[[n-1]][[1]] = (E(RVine$Tree[[n-1]])$conditionedSet[[1]]) + for(k in 1:(n-2)){ + #conditionedSets[[k]] = E(RVine$Tree[[k]])$conditionedSet[[1]] + conditionedSets[[k]] = E(RVine$Tree[[k]])$conditionedSet + corresppondingParams[[k]] = as.list(E(RVine$Tree[[k]])$Copula.param) + corresppondingTypes[[k]] = as.list(E(RVine$Tree[[k]])$Copula.type) + } + + corresppondingParams[[n-1]] = list() + corresppondingParams[[n-1]] = as.list(E(RVine$Tree[[n-1]])$Copula.param) + corresppondingTypes[[n-1]] = as.list(E(RVine$Tree[[n-1]])$Copula.type) + #print(corresppondingParams) } - corresppondingParams[[n-1]] = list() - corresppondingParams[[n-1]][[1]] = (E(RVine$Tree[[n-1]])$Copula.param) - corresppondingTypes[[n-1]] = as.list(E(RVine$Tree[[n-1]])$Copula.type) + else{ + conditionedSets[[n-1]][[1]] = (E(RVine$Tree[[n-1]])$conditionedSet) + for(k in 1:(n-2)){ + conditionedSets[[k]] = E(RVine$Tree[[k]])$conditionedSet + corresppondingParams[[k]] = as.list(E(RVine$Tree[[k]])$Copula.param) + corresppondingTypes[[k]] = as.list(E(RVine$Tree[[k]])$Copula.type) + } + #print(conditionedSets) + corresppondingParams[[n-1]] = list() + corresppondingParams[[n-1]] = as.list(E(RVine$Tree[[n-1]])$Copula.param) + corresppondingTypes[[n-1]] = as.list(E(RVine$Tree[[n-1]])$Copula.type) + } Param = array(dim=c(n,n)) Params2 = array(0,dim=c(n,n)) @@ -457,6 +505,6 @@ M[is.na(M)]=0 Type[is.na(Type)]=0 - return(RVineMatrix(M, family = Type, par = Param, par2 = Params2, names = names)) + return(RVineMatrix(M, family = Type, par = Param, par2 = Params2, names = nam)) } Modified: pkg/inst/ChangeLog =================================================================== --- pkg/inst/ChangeLog 2014-02-13 13:48:19 UTC (rev 57) +++ pkg/inst/ChangeLog 2014-02-17 15:52:12 UTC (rev 58) @@ -1,7 +1,7 @@ Changes for R-package VineCopula Current authors: Ulf Schepsmeier, Tobias Erhardt and Benedikt Graeler -Former authors: Eike Brechmann and Jakob Stber +Former authors: Eike Brechmann and Jakob Stoeber Version 1.2-1 (January 25, 2014) @@ -13,6 +13,7 @@ * RVineMLE: the optim argument "parscale" was not correctly defined for all cases. * RVineAIC/BIC: Instead of the function arguments "par" and "par2" the calculation was based on RVM$par and RVM$par2. This is corrected now. (reported by Marcel Duellmann; thanks) + * RVineStructureSelect: The new igraph version returned a different variable type causing an error in the second and higher order tree selection. Version 1.2 (October 09, 2013) From noreply at r-forge.r-project.org Mon Feb 17 21:35:25 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 17 Feb 2014 21:35:25 +0100 (CET) Subject: [Vinecopula-commits] r59 - pkg/R Message-ID: <20140217203525.609F5186D66@r-forge.r-project.org> Author: ulf Date: 2014-02-17 21:35:24 +0100 (Mon, 17 Feb 2014) New Revision: 59 Modified: pkg/R/RVineAIC.r pkg/R/RVineClarkeTest.R pkg/R/RVineGofTest3.r pkg/R/RVineMLE.R pkg/R/RVinePIT.r pkg/R/RVinePar2Beta.r pkg/R/RVineTreePlot.r pkg/R/RVineVuongTest.R Log: Die Einf?\195?\188hrung einer VineCopula-Klasse hat dazu gef?\195?\188hrt, dass is(RVM) zwei Elemente zur?\195?\188ckgeliefert hat. Das hat bei einigen Funktionen zu Warningsgef?\195?\188hrt, die diese Abfrage drin hatten. Modified: pkg/R/RVineAIC.r =================================================================== --- pkg/R/RVineAIC.r 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVineAIC.r 2014-02-17 20:35:24 UTC (rev 59) @@ -89,7 +89,7 @@ n<-d N<-T if(n != dim(RVM)) stop("Dimensions of 'data' and 'RVM' do not match.") - if(is(RVM) != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") + if(is(RVM)[1] != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") par[is.na(par)]=0 par[upper.tri(par,diag=T)]=0 Modified: pkg/R/RVineClarkeTest.R =================================================================== --- pkg/R/RVineClarkeTest.R 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVineClarkeTest.R 2014-02-17 20:35:24 UTC (rev 59) @@ -5,8 +5,8 @@ if(dim(data)[2]<2) stop("Dimension has to be at least 2.") if(N<2) stop("Number of observations has to be at least 2.") if(any(data>1) || any(data<0)) stop("Data has be in the interval [0,1].") - if(is(RVM1) != "RVineMatrix") stop("'RVM1' has to be an RVineMatrix object.") - if(is(RVM2) != "RVineMatrix") stop("'RVM2' has to be an RVineMatrix object.") + if(is(RVM1)[1] != "RVineMatrix") stop("'RVM1' has to be an RVineMatrix object.") + if(is(RVM2)[1] != "RVineMatrix") stop("'RVM2' has to be an RVineMatrix object.") Model1.ll = RVineLogLik(data,RVM1,separate=TRUE)$loglik Model2.ll = RVineLogLik(data,RVM2,separate=TRUE)$loglik Modified: pkg/R/RVineGofTest3.r =================================================================== --- pkg/R/RVineGofTest3.r 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVineGofTest3.r 2014-02-17 20:35:24 UTC (rev 59) @@ -13,7 +13,7 @@ d=dim(data)[2] if(d != dim(RVM)) stop("Dimensions of 'data' and 'RVM' do not match.") - if(is(RVM) != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") + if(is(RVM)[1] != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") if(statistic=="Cramer-von Mises") statistic="CvM" else if(statistic=="Kolmogorov-Smirnov") statistic="KS" Modified: pkg/R/RVineMLE.R =================================================================== --- pkg/R/RVineMLE.R 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVineMLE.R 2014-02-17 20:35:24 UTC (rev 59) @@ -1,6 +1,6 @@ RVineMLE <- function(data, RVM, start=RVM$par, start2=RVM$par2, maxit=200, max.df=30, max.BB=list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)), grad=FALSE, hessian=FALSE, se=FALSE, ...) { - if(is(RVM) != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") + if(is(RVM)[1] != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") if(maxit<=0) stop("'maxit' has to be greater than zero.") if(max.df<=2) stop("The upper bound for the degrees of freedom parameter has to be larger than 2.") Modified: pkg/R/RVinePIT.r =================================================================== --- pkg/R/RVinePIT.r 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVinePIT.r 2014-02-17 20:35:24 UTC (rev 59) @@ -13,7 +13,7 @@ d=dim(data)[2] if(d != dim(RVM)) stop("Dimensions of 'data' and 'RVM' do not match.") - if(is(RVM) != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") + if(is(RVM)[1] != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") #if(type=="CVine") type=1 #else if(type=="DVine") type=2 Modified: pkg/R/RVinePar2Beta.r =================================================================== --- pkg/R/RVinePar2Beta.r 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVinePar2Beta.r 2014-02-17 20:35:24 UTC (rev 59) @@ -1,17 +1,17 @@ -RVinePar2Beta = function(RVM){ - - if(is(RVM) != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") - - taus = RVM$par - n = dim(RVM) - - for(i in 2:n) - { - for(j in 1:(i-1)) - { - taus[i,j] = BiCopPar2Beta(RVM$family[i,j],RVM$par[i,j],RVM$par2[i,j]) - } - } - - return(taus) -} +RVinePar2Beta = function(RVM){ + + if(is(RVM)[1] != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") + + taus = RVM$par + n = dim(RVM) + + for(i in 2:n) + { + for(j in 1:(i-1)) + { + taus[i,j] = BiCopPar2Beta(RVM$family[i,j],RVM$par[i,j],RVM$par2[i,j]) + } + } + + return(taus) +} Modified: pkg/R/RVineTreePlot.r =================================================================== --- pkg/R/RVineTreePlot.r 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVineTreePlot.r 2014-02-17 20:35:24 UTC (rev 59) @@ -1,6 +1,6 @@ RVineTreePlot = function(data=NULL, RVM, method="mle", max.df=30, max.BB=list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)), tree="ALL", edge.labels=c("family"), P=NULL){ - if(is(RVM) != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") + if(is(RVM)[1] != "RVineMatrix") stop("'RVM' has to be an RVineMatrix object.") if(edge.labels[1] != FALSE & !all(edge.labels %in% c("family","par","par2","theotau","emptau","pair"))) stop("Edge label not implemented.") if(is.null(data) & any(edge.labels == "emptau")) stop("Empirical Kendall's tau values cannot be obtained if no data is provided.") Modified: pkg/R/RVineVuongTest.R =================================================================== --- pkg/R/RVineVuongTest.R 2014-02-17 15:52:12 UTC (rev 58) +++ pkg/R/RVineVuongTest.R 2014-02-17 20:35:24 UTC (rev 59) @@ -5,8 +5,8 @@ if(dim(data)[2]<2) stop("Dimension has to be at least 2.") if(N<2) stop("Number of observations has to be at least 2.") if(any(data>1) || any(data<0)) stop("Data has be in the interval [0,1].") - if(is(RVM1) != "RVineMatrix") stop("'RVM1' has to be an RVineMatrix object.") - if(is(RVM2) != "RVineMatrix") stop("'RVM2' has to be an RVineMatrix object.") + if(is(RVM1)[1] != "RVineMatrix") stop("'RVM1' has to be an RVineMatrix object.") + if(is(RVM2)[1] != "RVineMatrix") stop("'RVM2' has to be an RVineMatrix object.") Model1.ll = RVineLogLik(data,RVM1,separate=TRUE)$loglik Model2.ll = RVineLogLik(data,RVM2,separate=TRUE)$loglik