* using log directory ‘/data/blackswan/ripley/R/packages/tests-devel/OBRE.Rcheck’ * using R Under development (unstable) (2020-03-29 r78100) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * checking for file ‘OBRE/DESCRIPTION’ ... OK * this is package ‘OBRE’ version ‘0.1-0’ * 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 executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘OBRE’ can be installed ... OK * checking installed package size ... OK * checking package 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 * 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 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 ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... 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 examples ... OK * checking examples with --run-donttest ... ERROR Running examples in ‘OBRE-Ex.R’ failed The error most likely occurred in: > ### Name: OBRE > ### Title: Optimal B-Robust Estimator > ### Aliases: OBRE > > ### ** Examples > > # Using the densityExpressions function for initialize the distribution > distrForOBRE <- densityExpressions(strDistribution = "normal") > simData = c(rnorm(1000, 12, 2),200,150) > ## No test: > estOBRE <- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) ----------- FAILURE REPORT -------------- --- failure: the condition has length > 1 --- --- srcref --- : --- package (from environment) --- OBRE --- call from context --- OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) --- call from argument --- if (class(invFisher) == "try-error") { strMess = "Fisher Matrix is singular" lOutOBRE = list(nvTheta = c(NA, NA), strMess = strMess, nvA = c(NA, NA), matA = matrix(NA, nrow = 2, ncol = 2), nCParOBRE = nCParOBRE, nvThetaInit = c(nTheta1Init, nTheta2Init), nvWeights = rep(NA, length(nvData)), nvData = nvData, lDensityExpr = lDensityExpr) return(lOutOBRE) } --- R stacktrace --- where 1: OBRE(nvData = simData, strDistribution = distrForOBRE, nCParOBRE = 3) --- value of length: 2 type: logical --- [1] FALSE FALSE --- function from context --- function (nvData, strDistribution, nCParOBRE, dfParOBRE = data.frame(nEta = 1e-06, nMaxIterLoopWc = 10, nMaxIterLoopA = 10, nRelTol = 0.001, nAbsTol = 0.5, stringsAsFactors = FALSE), nTheta1Init = NA, nTheta2Init = NA, eDensityFun = NA) { if (class(strDistribution) == "OBREdist") { lDensityExpr = strDistribution } else { lDensityExpr = densityExpressions(strDistribution = strDistribution, eDensityFun = eDensityFun) } if (is.na(nTheta1Init) || is.na(nTheta2Init)) { lMLE = MLE(nvData = nvData, strDistribution = strDistribution, lDensityExpr = lDensityExpr) nTheta1Init = lMLE$nvTheta[1] nTheta2Init = lMLE$nvTheta[2] } matFisherMLE = try(matFisherComputation(nTheta1 = nTheta1Init, nTheta2 = nTheta2Init, lDensityExpr = lDensityExpr), silent = TRUE) invFisher = try(solve(matFisherMLE), silent = TRUE) eInvFisher = try(eigen(invFisher), silent = TRUE) if (class(invFisher) == "try-error") { strMess = "Fisher Matrix is singular" lOutOBRE = list(nvTheta = c(NA, NA), strMess = strMess, nvA = c(NA, NA), matA = matrix(NA, nrow = 2, ncol = 2), nCParOBRE = nCParOBRE, nvThetaInit = c(nTheta1Init, nTheta2Init), nvWeights = rep(NA, length(nvData)), nvData = nvData, lDensityExpr = lDensityExpr) return(lOutOBRE) } if (min(eInvFisher$values) < 0) { strMess = "Fisher Matrix is not positive definite" lOutOBRE = list(nvTheta = c(NA, NA), strMess = strMess, nvA = c(NA, NA), matA = matrix(NA, nrow = 2, ncol = 2), nCParOBRE = nCParOBRE, nvThetaInit = c(nTheta1Init, nTheta2Init), nvWeights = rep(NA, length(nvData)), nvData = nvData, lDensityExpr = lDensityExpr) return(lOutOBRE) } nvA = c(0, 0) matA = eInvFisher$vectors %*% diag(sqrt(eInvFisher$values)) %*% t(eInvFisher$vectors) nTheta1 = nTheta1Init nTheta2 = nTheta2Init nvDeltaTheta = c(nTheta1Init, nTheta2Init) nIterLoopWc = 0 while (max(abs(nvDeltaTheta/c(nTheta1, nTheta2))) > dfParOBRE$nEta && nIterLoopWc < dfParOBRE$nMaxIterLoopWc) { cat("#") nIterLoopA = 0 flagDone = FALSE while (!flagDone && nIterLoopA < dfParOBRE$nMaxIterLoopA) { cat(".") nIterLoopA = nIterLoopA + 1 matAOld = matA nvAOld = nvA nvA = OBREnvAComputation(nvData = nvData, nTheta1 = nTheta1, nTheta2 = nTheta2, lDensityExpr = lDensityExpr, nCParOBRE = nCParOBRE, matA = matA, nvA = nvA) matM2 = OBREMatMComputation(nvData = nvData, nTheta1 = nTheta1, nTheta2 = nTheta2, lDensityExpr = lDensityExpr, nCParOBRE = nCParOBRE, matA = matA, nvA = nvA, nK = 2) invM2 = try(solve(matM2), silent = TRUE) if (class(invM2) == "try-error") { strMess = "OBRE matrix M2 is singular" lOutOBRE = list(nvTheta = c(NA, NA), strMess = strMess, nvA = nvA, matA = matA, nCParOBRE = nCParOBRE, nvThetaInit = c(nTheta1Init, nTheta2Init), nvWeights = rep(NA, length(nvData)), nvData = nvData, lDensityExpr = lDensityExpr) return(lOutOBRE) } eInvM2 = eigen(invM2) if (min(eInvM2$values) < 0) { strMess = "OBRE matrix M2 is not positive definite" lOutOBRE = list(nvTheta = c(NA, NA), strMess = strMess, nvA = nvA, matA = matA, nCParOBRE = nCParOBRE, nvThetaInit = c(nTheta1Init, nTheta2Init), nvWeights = rep(NA, length(nvData)), nvData = nvData, lDensityExpr = lDensityExpr) return(lOutOBRE) } matA = chol(invM2) flagDone = OBRECheckTolParameters(matANew = matA, matAOld = matAOld, nvANew = nvA, nvAOld = nvAOld, nRelTol = dfParOBRE$nRelTol, nAbsTol = dfParOBRE$nAbsTol) } matM1 = OBREMatMComputation(nvData = nvData, nTheta1 = nTheta1, nTheta2 = nTheta2, lDensityExpr = lDensityExpr, nCParOBRE = nCParOBRE, matA = matA, nvA = nvA, nK = 1) nvWeightFunLoop = OBREWeightsFun(nvData = nvData, nTheta1 = nTheta1, nTheta2 = nTheta2, lDensityExpr = lDensityExpr, nCParOBRE = nCParOBRE, matA = matA, nvA = nvA) nMeanComponent1 = mean((scoreComponent(nvData = nvData, nTheta1 = nTheta1, nTheta2 = nTheta2, lDensityExpr = lDensityExpr, nParIndex = 1) - nvA[1]) * nvWeightFunLoop) nMeanComponent2 = mean((scoreComponent(nvData = nvData, nTheta1 = nTheta1, nTheta2 = nTheta2, lDensityExpr = lDensityExpr, nParIndex = 2) - nvA[2]) * nvWeightFunLoop) nvDeltaTheta = solve(matM1) %*% c(nMeanComponent1, nMeanComponent2) nTheta1 = nTheta1 + nvDeltaTheta[1] nTheta2 = nTheta2 + nvDeltaTheta[2] nIterLoopWc = nIterLoopWc + 1 } strMess = "OBRE converged in less than maxiterLoopWc iterations" if (nIterLoopWc >= dfParOBRE$nMaxIterLoopWc) { strMess = "OBRE terminates with maximum number of iteration" } lOutOBRE = list(nvTheta = c(nTheta1, nTheta2), strMess = strMess, nvA = nvA, matA = matA, nCParOBRE = nCParOBRE, nvThetaInit = c(nTheta1Init, nTheta2Init), nvWeights = nvWeightFunLoop, nvData = nvData, lDensityExpr = lDensityExpr) class(lOutOBRE) = "OBREresult" return(lOutOBRE) } --- function search by body --- Function OBRE in namespace OBRE has this body. ----------- END OF FAILURE REPORT -------------- Error in if (class(invFisher) == "try-error") { : the condition has length > 1 Calls: OBRE Execution halted * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR See ‘/data/blackswan/ripley/R/packages/tests-devel/OBRE.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 0:14.99, 12.45 + 2.41