* using log directory 'd:/Rcompile/CRANpkg/local/3.6/LinearDetect.Rcheck' * using R version 3.6.3 (2020-02-29) * using platform: x86_64-w64-mingw32 (64-bit) * using session charset: ISO8859-1 * checking for file 'LinearDetect/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'LinearDetect' version '0.1.5' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'LinearDetect' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking 'build' directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * loading checks for arch 'i386' ** checking whether the package can be loaded ... OK ** checking whether the package can be loaded with stated dependencies ... OK ** checking whether the package can be unloaded cleanly ... OK ** checking whether the namespace can be loaded with stated dependencies ... OK ** checking whether the namespace can be unloaded cleanly ... OK ** checking loading without being on the library search path ... OK ** checking use of S3 registration ... OK * loading checks for arch 'x64' ** checking whether the package can be loaded ... OK ** checking whether the package can be loaded with stated dependencies ... OK ** checking whether the package can be unloaded cleanly ... OK ** checking whether the namespace can be loaded with stated dependencies ... OK ** checking whether the namespace can be unloaded cleanly ... OK ** checking loading without being on the library search path ... OK ** checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [21s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking line endings in Makefiles ... OK * checking compilation flags in Makevars ... OK * checking for GNU extensions in Makefiles ... OK * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking pragmas in C/C++ headers and code ... OK * checking compiled code ... OK * checking installed files from 'inst/doc' ... OK * checking files in 'vignettes' ... OK * checking examples ... ** running examples for arch 'i386' ... ERROR Running examples in 'LinearDetect-Ex.R' failed The error most likely occurred in: > ### Name: tbfl > ### Title: Threshold block fused lasso (TBFL) algorithm for change point > ### detection > ### Aliases: tbfl > > ### ** Examples > > #### constant model > TT <- 10^3; # number of observations/samples > p.y <- 50; # dimension of observed Y > brk <- c(floor(TT/3),floor(2*TT/3), TT+1) > m <- length(brk) > d <- 5 #number of non-zero coefficient > ### generate coefficient > constant.full <- matrix(0, p.y, m) > set.seed(1) > constant.full[sample(1:p.y, d, replace = FALSE), 1] <- runif(d, -1, -0.5); > constant.full[sample(1:p.y, d, replace = FALSE), 2] <- runif(d, 0.5, 1); > constant.full[sample(1:p.y, d, replace = FALSE), 3] <- runif(d, -1, -0.5); > e.sigma <- as.matrix(1*diag(p.y)) > try <- constant.sim.break(nobs = TT, cnst = constant.full, sigma = e.sigma, brk = brk) > data_y <- try$series_y; data_y <- as.matrix(data_y, ncol = p.y) > ### Fit the model > method <- c("Constant") > temp <- tbfl(method, data_y, block.size = 40, optimal.block = FALSE) #use a single block size [1] "block sizes" [1] 80 80 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 80 80 [1] "block size" [1] 40 [1] "cv.index:" [1] 4 8 12 16 20 [1] 1 [1] "##################lambda1:" [1] 401.8868 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 1.025186 [1] "====================================" [1] 2 [1] "##################lambda1:" [1] 144.4306 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 1.008716 [1] "====================================" [1] 3 [1] "##################lambda1:" [1] 51.90568 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9978732 [1] "====================================" [1] 4 [1] "##################lambda1:" [1] 18.65393 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9938887 [1] "====================================" [1] 5 [1] "##################lambda1:" [1] 6.703876 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9947952 [1] "====================================" [1] 6 [1] "##################lambda1:" [1] 2.409248 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9961026 [1] "====================================" [1] 7 [1] "##################lambda1:" [1] 0.8658388 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.996265 [1] "====================================" [1] 8 [1] "##################lambda1:" [1] 0.3111663 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9958982 [1] "====================================" [1] 9 [1] "##################lambda1:" [1] 0.1118274 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9957791 [1] "====================================" [1] 10 [1] "##################lambda1:" [1] 0.04018868 [1] "##################lambda2:" [1] 0.6254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9958029 [1] "====================================" [1] 11 [1] "##################lambda1:" [1] 401.8868 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 1.025186 [1] "====================================" [1] 12 [1] "##################lambda1:" [1] 144.4306 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 1.004269 [1] "====================================" [1] 13 [1] "##################lambda1:" [1] 51.90568 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9678177 [1] "====================================" [1] 14 [1] "##################lambda1:" [1] 18.65393 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9510438 [1] "====================================" [1] 15 [1] "##################lambda1:" [1] 6.703876 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9481294 [1] "====================================" [1] 16 [1] "##################lambda1:" [1] 2.409248 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9447256 [1] "====================================" [1] 17 [1] "##################lambda1:" [1] 0.8658388 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9441555 [1] "====================================" [1] 18 [1] "##################lambda1:" [1] 0.3111663 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9440089 [1] "====================================" [1] 19 [1] "##################lambda1:" [1] 0.1118274 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9437034 [1] "====================================" [1] 20 [1] "##################lambda1:" [1] 0.04018868 [1] "##################lambda2:" [1] 0.06254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.943712 [1] "====================================" [1] 21 [1] "##################lambda1:" [1] 401.8868 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 1.025186 [1] "====================================" [1] 22 [1] "##################lambda1:" [1] 144.4306 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 1.003713 [1] "====================================" [1] 23 [1] "##################lambda1:" [1] 51.90568 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9674787 [1] "====================================" [1] 24 [1] "##################lambda1:" [1] 18.65393 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9537906 [1] "====================================" [1] 25 [1] "##################lambda1:" [1] 6.703876 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9533223 [1] "====================================" [1] 26 [1] "##################lambda1:" [1] 2.409248 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9563411 [1] "====================================" [1] 27 [1] "##################lambda1:" [1] 0.8658388 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.957752 [1] "====================================" [1] 28 [1] "##################lambda1:" [1] 0.3111663 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9588602 [1] "====================================" [1] 29 [1] "##################lambda1:" [1] 0.1118274 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9600366 [1] "====================================" [1] 30 [1] "##################lambda1:" [1] 0.04018868 [1] "##################lambda2:" [1] 0.006254617 [1] "All coefficients are piecewise constant!" [1] "============cv-result=======================" [1] 0.9610222 [1] "====================================" [1] "All cv:" [1] 1.0251863 1.0087156 0.9978732 0.9938887 0.9947952 0.9961026 0.9962650 [8] 0.9958982 0.9957791 0.9958029 1.0251863 1.0042694 0.9678177 0.9510438 [15] 0.9481294 0.9447256 0.9441555 0.9440089 0.9437034 0.9437120 1.0251863 [22] 1.0037127 0.9674787 0.9537906 0.9533223 0.9563411 0.9577520 0.9588602 [29] 0.9600366 0.9610222 [1] "Use BIC!" [1] "Use BIC!" [1] "small number of cp !!!!" [1] "Cluster: 1" [1] 321 [1] "Cluster: 2" [1] 641 681 [1] "First step DONE!!!!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" [1] "cp.final:" [1] 333 666 [1] "Second step DONE!!!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" [1] "no refit!" > temp$cp.final [1] 333 666 > temp$beta.final [[1]] [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [7] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [13] 0.0000000 -0.7058880 0.0000000 0.0000000 0.0000000 0.0000000 [19] 0.0000000 0.0000000 0.0000000 0.0000000 -1.1593873 0.0000000 [25] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [31] 0.0000000 0.0000000 -0.7169640 0.0000000 0.0000000 0.0000000 [37] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [43] -0.9256323 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [49] 0.0000000 0.0000000 [[2]] [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [7] 1.0206999 0.0000000 0.8150900 0.5548061 0.0000000 0.0000000 [13] 0.0000000 0.0000000 1.0615466 0.0000000 0.0000000 0.0000000 [19] 0.0000000 0.0000000 0.9893644 0.0000000 0.0000000 0.0000000 [25] -0.5288655 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [31] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [37] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [43] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [49] 0.0000000 0.0000000 [[3]] [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [7] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [13] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [19] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [25] -1.1662868 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 [31] 0.0000000 0.0000000 0.0000000 -0.7604442 0.0000000 0.0000000 [37] -0.9873347 0.0000000 0.0000000 0.0000000 0.0000000 -0.7722985 [43] 0.0000000 -0.8151191 0.0000000 0.0000000 0.0000000 0.0000000 [49] 0.0000000 0.0000000 > > > > > #### multiple linear regression > TT <- 2*10^3; # number of observations/samples > p.y <- 1; # dimension of observed Y > p.x <- 20 > brk <- c(floor(TT/4), floor(2*TT/4), floor(3*TT/4), TT+1) > m <- length(brk) > d <- 15 #number of non-zero coefficient > ###generate coefficient beta > beta.full <- matrix(0, p.y, p.x*m) > set.seed(1) > aa <- c(-3, 5, -3, 3) > for(i in 1:m){beta.full[1, (i-1)*p.x+sample(1:p.x, d, replace = FALSE)] <- aa[i] + runif(d, -1, 1);} > e.sigma <- as.matrix(1*diag(p.y)) > try <- lm.sim.break(nobs = TT, px = p.x, phi = beta.full, sigma = e.sigma, sigma_x = 1, brk = brk) > data_y <- try$series_y; data_y <- as.matrix(data_y, ncol = p.y) > data_x <- try$series_x; data_x <- as.matrix(data_x) > ### Fit the model > method <- c("MLR") > > > > > #### Gaussian Graphical model > TT <- 3*10^3; # number of observations/samples > p.x <- 20 # dimension of obsrved X > # TRUE BREAK POINTS WITH T+1 AS THE LAST ELEMENT > brk <- c(floor(TT/3), floor(2*TT/3), TT+1) > m <- length(brk) > ###generate precision matrix and covariance matrix > eta = 0.1 > d <- ceiling(p.x*eta) > sigma.full <- matrix(0, p.x, p.x*m) > omega.full <- matrix(0, p.x, p.x*m) > aa <- 1/d > for(i in 1:m){ + if(i%%2==1){ + ajmatrix <- matrix(0, p.x, p.x) + for(j in 1:(floor(p.x/5)) ){ + ajmatrix[ ((j-1)*5+1): (5*j), ((j-1)*5+1): (5*j)] <- 1 + } + } + if(i%%2==0){ + ajmatrix <- matrix(0, p.x, p.x) + for(j in 1:(floor(p.x/10)) ){ + ajmatrix[ seq(((j-1)*10+1), (10*j), 2), seq(((j-1)*10+1), (10*j), 2)] <- 1 + ajmatrix[ seq(((j-1)*10+2), (10*j), 2), seq(((j-1)*10+2), (10*j), 2)] <- 1 + } + } + theta <- aa* ajmatrix + # force it to be positive definite + if(min(eigen(theta)$values) <= 0){ + print('add noise') + theta = theta - (min(eigen(theta)$values)-0.05) * diag(p.x) + } + sigma.full[, ((i-1)*p.x+1):(i*p.x)] <- as.matrix(solve(theta)) + omega.full[, ((i-1)*p.x+1):(i*p.x)] <- as.matrix(theta) + } Error in solve.default(theta) : Lapack routine dgesv: system is exactly singular: U[2,2] = 0 Calls: as.matrix -> solve -> solve.default Execution halted ** running examples for arch 'x64' ... [9s] OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes in 'inst/doc' ... OK * checking re-building of vignette outputs ... [4s] OK * checking PDF version of manual ... OK * DONE Status: 1 ERROR