Running ‘Stirling-etc.R’ [11s/15s]
  Running ‘copula-play.R’ [25s/39s]
  Running ‘dC-dc-ex.R’ [4s/6s]
  Running ‘estim-ex.R’ [7s/10s]
  Running ‘explicitCop-ex.R’ [17s/25s]
  Running ‘fitting-ex.R’ [11s/15s]
  Running ‘fixedPar-ex.R’ [8s/11s]
  Running ‘ggraph-tst.R’ [2s/4s]
  Running ‘khoudraji-ex.R’ [18s/28s]
  Running ‘misc.R’ [2s/4s]
  Running ‘mixCop-tst.R’ [3s/4s]
  Running ‘moments.R’ [3s/4s]
  Running ‘nac-experi.R’ [13s/19s]
  Running ‘retstable-ex.R’ [4s/6s]
  Running ‘rstable-ex.R’ [5s/8s]
  Running ‘tail-pcopula.R’ [2s/3s]
  Comparing ‘tail-pcopula.Rout’ to ‘tail-pcopula.Rout.save’ ... OK
Running the tests in ‘tests/ggraph-tst.R’ failed.
Complete output:
  > require(copula)
  Loading required package: copula
  > doX <- FALSE # no "doExtras" -- be fast
  > 
  > demo(gof_graph)
  
  
  	demo(gof_graph)
  	---- ~~~~~~~~~
  
  > ## Copyright (C) 2012 Marius Hofert and Martin Maechler
  > ##
  > ## This program is free software; you can redistribute it and/or modify it under
  > ## the terms of the GNU General Public License as published by the Free Software
  > ## Foundation; either version 3 of the License, or (at your option) any later
  > ## version.
  > ##
  > ## This program is distributed in the hope that it will be useful, but WITHOUT
  > ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  > ## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  > ## details.
  > ##
  > ## You should have received a copy of the GNU General Public License along with
  > ## this program; if not, see <http://www.gnu.org/licenses/>.
  > 
  > 
  > ### setup ######################################################################
  > 
  > require(copula)
  
  > doPDF <- !dev.interactive(orNone=TRUE)
  
  > if(!(exists("setSeeds") && is.logical(as.logical(setSeeds))))
  + setSeeds <- TRUE # for reproducibility
  
  > ##  maybe set to FALSE *before* running this demo
  > 
  > if(interactive()) readline(
  +     "NOTE: Set   doX <- TRUE   before running this demo 'realistically' ok? ")
  
  > if(!(exists("doX") && is.logical(as.logical(doX))))
  +     print(doX <- copula:::doExtras())
  
  > if(!doX)
  +     cat("** doX is FALSE ==> unrealistically small N, but speed for testing.\n")
  ** doX is FALSE ==> unrealistically small N, but speed for testing.
  
  > (N <- if(doX) 256 else 32)# be fast when run as "check"
  [1] 32
  
  > ### Example 1: 5d Gumbel copula ################################################
  > 
  > ## setup
  > n <- if(doX) 1000 else 250 # sample size
  
  > d <- 5 # dimension
  
  > family <- "Gumbel" # copula family
  
  > tau <- 0.5
  
  > if(setSeeds) set.seed(1)
  
  > ## define and sample the copula (= H0 copula), build pseudo-observations
  > cop <- getAcop(family)
  
  > th <- cop@iTau(tau) # correct parameter value
  
  > copH0 <- onacopulaL(family, list(th, 1:d)) # define H0 copula
  
  > U. <- pobs(rCopula(n, cop=copH0))
  
  > ## create array of pairwise copH0-transformed data columns
  > cu.u <- pairwiseCcop(U., copH0)
  
  > stopifnot(is.array(cu.u), dim(cu.u) == c(n,d,d)) # check
  
  > ## compute pairwise matrix of p-values and corresponding colors
  > pwIT <- pairwiseIndepTest(cu.u, N=N, verbose=interactive()) # (d,d)-matrix of test results
  
  > round(pmat <- pviTest(pwIT), 3) # pick out p-values
        [,1]  [,2]  [,3]  [,4]  [,5]
  [1,]    NA 0.924 0.530 0.379 0.985
  [2,] 0.682    NA 0.439 0.439 0.682
  [3,] 0.924 0.652    NA 0.652 0.924
  [4,] 0.682 0.742 0.439    NA 0.712
  [5,] 0.924 0.682 0.924 0.864    NA
  
  > ## Here (with seed=1):  no significant ones, smallest = 0.0603
  > str(cc <- pairsColList(pmat)) # compute corresponding colors
  Loading required namespace: colorspace
  List of 4
   $ fgColMat     : chr [1:5, 1:5] "#000000" "#000000" "#000000" "#000000" ...
   $ bgColMat     : chr [1:5, 1:5] "transparent" "#F4EFC8" "#F4EFC8" "#F4EFC8" ...
   $ bucketCols   : chr [1:6] "#0066CC" "#995CD8" "#D35DD3" "#FFAD8B" ...
   $ pvalueBuckets: num [1:7] 1e-04 1e-03 1e-02 5e-02 1e-01 ...
  
  > ## which pairs violate H0? [none, here]
  > which(pmat < 0.05, arr.ind=TRUE)
       row col
  
  > ## check whether p-values are uniform -- only if we have "many" (~ d^2)
  > if(d > 10){
  +     n. <- d*(d-1)
  +     qqplot(qunif(ppoints(n.)), sort(pmat), main = paste("n = ",n.))
  +     abline(0,1)
  + }
  
  > ## Artificially more extreme P-values: {to see more}
  > pm.0 <- pmat
  
  > pm.0[1,2] <- 5.0e-3
  
  > pm.0[3,2] <- 0.03
  
  > pm.0[5,2] <- 0.9e-3
  
  > ### Example 1 b): Plots ########################################################
  > 
  > ## 1a) plain (too large plot symbols here)
  > pairsRosenblatt(cu.u, pvalueMat=pmat)
  Error in loadNamespace(name) : there is no package called 'sfsmisc'
  Calls: demo ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
  In addition: Warning message:
  In indepTestSim(n, p = 2, m = 2, N = N, verbose = idT.verbose, ...) :
    N should be at least 100
  Execution halted