Running 'SP500-ex.R' [28s]
Running the tests in 'tests/SP500-ex.R' failed.
Complete output:
  > require(CLA)
  Loading required package: CLA
  > 
  > b64 <- .Machine$sizeof.pointer == 8
  > cat(sprintf("%d bit platform type '%s'\n", if(b64) 64 else 32, .Platform$OS.type))
  64 bit platform type 'windows'
  > (nonWindows <- .Platform$OS.type != "windows")
  [1] FALSE
  > arch <- Sys.info()[["machine"]]
  > .M <- .Machine; str(.M[grep("^sizeof", names(.M))]) ## differentiate long-double..
  List of 4
   $ sizeof.long      : int 4
   $ sizeof.longlong  : int 8
   $ sizeof.longdouble: int 16
   $ sizeof.pointer   : int 8
  > ## Do we have 64bit but no-long-double ?
  > b64nLD <- (arch == "x86_64" && .M$sizeof.longdouble != 16)
  > if(b64nLD) arch <- paste0(arch, "--no-long-double")
  > arch
  [1] "x86-64"
  > 
  > data(muS.sp500)
  > 
  > if(requireNamespace("FRAPO")) {
  +     data(SP500, package = "FRAPO")
  +     print(dim(SP500)) # 265 * 476
  + }
  Loading required namespace: FRAPO
  [1] 265 476
  > 
  > (n <- length(muS.sp500$mu)) # 476
  [1] 476
  > system.time(# ~ 9 sec (64-bit); 13.8 sec (32-b florence); seen 27.44 sec on Winb.32
  +     CLs5c.0.120 <- CLA(muS.sp500$mu, muS.sp500$covar, lB=0, uB=1/20)
  + )
     user  system elapsed 
    25.21    0.09   25.31 
  > CLs5c.0.120 # -> print() method
  Call: CLA(mu = muS.sp500$mu, covar = muS.sp500$covar, lB = 0, uB = 1/20)
  Critical Line Algorithm for n = 476 assets, resulting in  162  turning points
  Overview of result parts:
  List of 5
   $ weights_set : num [1:476, 1:162] 0 0 0.05 0 0 0 0 0 0 0 ...
   $ free_indices:List of 162
    .. [list output truncated]
   $ gammas      : num [1:162] NA -0.0845 -0.0845 -0.0134 -0.013 ...
   $ lambdas     : num [1:162] NA 10.5 10.5 1.83 1.78 ...
   $ MS_weights  : num [1:162, 1:2] 0.0369 0.0369 0.0369 0.0369 0.0369 ...
  > 
  > un.call <- function(x) { x$call <- NULL ; x }
  > 
  > doExtras <- TRUE  # for experiments, not normally
  > doExtras <- FALSE
  > 
  > if(doExtras) system.time({
  +     tols <- 10^-c(1,3,5:9,11,14)
  +     names(tols) <- paste0("10^", round(log10(tols)))
  +     CLs5c.ls <- lapply(tols, function(tol)
  +         CLA(muS.sp500$mu, muS.sp500$covar, lB=0, uB=1/20, tol.lambda = tol))
  + }) #  78.101 elapsed [nb-mm4]
  > 
  > if(doExtras) {
  +     identical(un.call(CLs5c.ls[["10^-7"]]), un.call(CLs5c.0.120))
  +     for(i in seq_along(tols)[-1]) {
  +         cat("--=--=--=--=--\n", (n1 <- names(tols[i-1])), " vs. ", (n2 <- names(tols[i])), ": ")
  +         ae <- all.equal(un.call(CLs5c.ls[[i-1]]),
  +                         un.call(CLs5c.ls[[ i ]]))
  +         if(isTRUE(ae)) cat(" are all.equal()\n")
  +         else {
  +             CLA.i. <- un.call(CLs5c.ls[[i-1]]) ; wgt <- CLA.i.$weights_set
  +             cat("are different [all.equal()]: dim(..[[",n1,"]]$weights_set) =",
  +                 dim(wgt)[1],"x", dim(wgt)[2],"\n")
  +         }
  +     }
  + }
  > 
  > op <- options(width = max(500, getOption("width"))) # then it actually fits
  > 
  > if(require(Matrix)) withAutoprint(local = FALSE, {
  +     ## visualize how weights change "along turning points"
  +     spWts <- Matrix(CLs5c.0.120$weights_set, sparse=TRUE)
  +     image(spWts, xlab = "turning point", ylab = "asset number")
  +     ##
  +     dim(spWts.non0 <- spWts[rowSums(spWts) > 0 , ])
  +     round(1000 * spWts.non0)
  +     ##
  +     image(spWts.non0, xlab = "turning point", ylab = "asset number")
  +     wts.non0 <- as(spWts.non0, "matrix")
  + }) else {
  +     warning("'Matrix' package not available -- should not happen!")
  +     wts.non0 <- CLs5c.0.120$weights_set[rowSums(CLs5c.0.120$weights_set) > 0 , ]
  +     if(is.null(colnames(wts.non0))) ## empty column names for nice printing:
  +         colnames(wts.non0) <- rep("", ncol(wts.non0))
  +     print.table(round(1000 * wts.non0), zero.print=".")
  + }
  Loading required package: Matrix
  Error: could not find function "withAutoprint"
  Execution halted