CRAN Package Check Results for Package optismixture

Last updated on 2020-02-19 10:49:01 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.1 8.78 59.70 68.48 ERROR
r-devel-linux-x86_64-debian-gcc 0.1 6.42 47.35 53.77 ERROR
r-devel-linux-x86_64-fedora-clang 0.1 82.37 ERROR
r-devel-linux-x86_64-fedora-gcc 0.1 81.69 ERROR
r-devel-windows-ix86+x86_64 0.1 14.00 68.00 82.00 OK
r-devel-windows-ix86+x86_64-gcc8 0.1 21.00 87.00 108.00 OK
r-patched-linux-x86_64 0.1 5.90 51.18 57.08 OK
r-patched-solaris-x86 0.1 108.50 OK
r-release-linux-x86_64 0.1 7.51 51.11 58.62 OK
r-release-windows-ix86+x86_64 0.1 12.00 61.00 73.00 OK
r-release-osx-x86_64 0.1 OK
r-oldrel-windows-ix86+x86_64 0.1 8.00 60.00 68.00 OK
r-oldrel-osx-x86_64 0.1 OK

Check Details

Version: 0.1
Check: examples
Result: ERROR
    Running examples in 'optismixture-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: batch.estimation
    > ### Title: Two stage estimation, a pilot estimate of mixing alpha and a
    > ### following importance sampling, with or without control variates
    > ### Aliases: batch.estimation
    >
    > ### ** Examples
    >
    > library(optismixture)
    > seed <- 1
    > p <- 5
    > rho <- 1/2
    > gamma <- 2.4
    > sigma.dvar <- function(rho, p){
    + sigma <- matrix(0, p, p)
    + for(i in 1:(p-1)){
    + for(j in (i+1):p){
    + sigma[i,j] <- rho^(abs(i-j))
    + }
    + }
    + sigma <- sigma + t(sigma)
    + diag(sigma) <- 1
    + return(sigma)
    + }
    > sigma <- sigma.dvar(rho, p)
    > batch.size <- c(10^4, 1002)
    > j.vec <- 2^-(seq(1,5,1))
    > eps.status <- 1
    > eps.safe <- 0.1
    > ## initialization and construct derived parameters
    > mu <- rep(0, p)
    > x0 <- matrix(1, 1, p)
    > x0.mat <- rbind(rep(1,p), rep(-1, p))
    > j.mat <- data.frame(centerid = rep(1:dim(x0.mat)[1], each = length(j.vec)),
    + variance = rep(j.vec, 2))
    > J <- dim(j.mat)[1] + 1
    > eps <- rep(0.1/J, J)
    > mixture.param <- list(x0 = x0, x0.mat = x0.mat, p = p,
    + sigma = sigma, gamma = gamma, j.mat = j.mat, J = J)
    > f <- function(x, j, mixture.param){
    + f1 <- function(x, mixture.param){
    + x0 <- mixture.param$x0
    + gamma <- mixture.param$gamma
    + return(sum((x - x0)^2)^(-gamma/2))
    + }
    + return(apply(x, 1, f1, mixture.param))
    + }
    > dq <- function(x, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j, 2]
    + return(mvtnorm::dmvnorm(x, mixture.param$x0.mat[centerid,], j.param*diag(mixture.param$p)))
    + }
    > dp <- function(x, mixture.param){
    + return(mvtnorm::dmvnorm(x, rep(0, mixture.param$p), mixture.param$sigma))
    + }
    > rq <- function(n, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j,2]
    + return(mvtnorm::rmvnorm(n, mixture.param$x0.mat[centerid, ], j.param*diag(mixture.param$p)))
    + }
    > rp <- function(n, mixture.param){
    + mu <- rep(0, mixture.param$p)
    + sigma <- mixture.param$sigma
    + return(mvtnorm::rmvnorm(n, mu, sigma))
    + }
    > a <- batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
    + fname = "f", rpname = "rp", rqname = "rq", dpname = "dp", dqname = "dq")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    optismixture
     --- call from context ---
    dampednewton(alpha, rho, reltol = reltol)
     --- call from argument ---
    if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
    }
     --- R stacktrace ---
    where 1: dampednewton(alpha, rho, reltol = reltol)
    where 2: penoptpersp.alpha.only(y = opt.input$Y[get.index.b(batch.size,
     b), ], z = as.matrix(opt.input$Z[get.index.b(batch.size,
     b), ]), a0 = alpha.opt, eps = eps, reltol = opt.param$reltol,
     relerr = opt.param$relerr, rho0 = opt.param$rho0, maxin = opt.param$maxin,
     maxout = opt.param$maxout)
    where 3: batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
     fname = "f", rpname = "rp", rqname = "rq", dpname = "dp",
     dqname = "dq")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (alpha, rho, reltol)
    {
     done = FALSE
     inct <- 0
     oldf <- -Inf
     while (1) {
     vals = fgH(alpha, rho, do = 3)
     if (identical(oldf, vals$f)) {
     solstatus <- "exact"
     break
     }
     oldf <- vals$f
     newtonstep = try(-svdsolve(vals$H, vals$g), silent = TRUE)
     if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
     }
     newtonstep <- drop(newtonstep)
     decrement = -(vals$g %*% newtonstep)[1, 1]/2
     reldecrement = decrement/vals$f
     if (reldecrement <= reltol) {
     solstatus <- "exact"
     break
     }
     tval = linesearch(alpha, rho, newtonstep, vals$f, vals$g)
     alpha = alpha + tval * newtonstep
     inct = inct + 1
     if (inct >= maxin) {
     print("Reaching maximum inner iterations")
     solstatus <- "semiexact"
     print(paste("decrement", decrement))
     print(paste("vals$f", vals$f))
     break
     }
     }
     list(alpha = alpha, solstatus = solstatus, inct = inct)
    }
    <bytecode: 0x49f4fe0>
    <environment: 0x5e85790>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(newtonstep) == "try-error") { :
     the condition has length > 1
    Calls: batch.estimation -> penoptpersp.alpha.only -> dampednewton
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 0.1
Check: examples
Result: ERROR
    Running examples in ‘optismixture-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: batch.estimation
    > ### Title: Two stage estimation, a pilot estimate of mixing alpha and a
    > ### following importance sampling, with or without control variates
    > ### Aliases: batch.estimation
    >
    > ### ** Examples
    >
    > library(optismixture)
    > seed <- 1
    > p <- 5
    > rho <- 1/2
    > gamma <- 2.4
    > sigma.dvar <- function(rho, p){
    + sigma <- matrix(0, p, p)
    + for(i in 1:(p-1)){
    + for(j in (i+1):p){
    + sigma[i,j] <- rho^(abs(i-j))
    + }
    + }
    + sigma <- sigma + t(sigma)
    + diag(sigma) <- 1
    + return(sigma)
    + }
    > sigma <- sigma.dvar(rho, p)
    > batch.size <- c(10^4, 1002)
    > j.vec <- 2^-(seq(1,5,1))
    > eps.status <- 1
    > eps.safe <- 0.1
    > ## initialization and construct derived parameters
    > mu <- rep(0, p)
    > x0 <- matrix(1, 1, p)
    > x0.mat <- rbind(rep(1,p), rep(-1, p))
    > j.mat <- data.frame(centerid = rep(1:dim(x0.mat)[1], each = length(j.vec)),
    + variance = rep(j.vec, 2))
    > J <- dim(j.mat)[1] + 1
    > eps <- rep(0.1/J, J)
    > mixture.param <- list(x0 = x0, x0.mat = x0.mat, p = p,
    + sigma = sigma, gamma = gamma, j.mat = j.mat, J = J)
    > f <- function(x, j, mixture.param){
    + f1 <- function(x, mixture.param){
    + x0 <- mixture.param$x0
    + gamma <- mixture.param$gamma
    + return(sum((x - x0)^2)^(-gamma/2))
    + }
    + return(apply(x, 1, f1, mixture.param))
    + }
    > dq <- function(x, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j, 2]
    + return(mvtnorm::dmvnorm(x, mixture.param$x0.mat[centerid,], j.param*diag(mixture.param$p)))
    + }
    > dp <- function(x, mixture.param){
    + return(mvtnorm::dmvnorm(x, rep(0, mixture.param$p), mixture.param$sigma))
    + }
    > rq <- function(n, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j,2]
    + return(mvtnorm::rmvnorm(n, mixture.param$x0.mat[centerid, ], j.param*diag(mixture.param$p)))
    + }
    > rp <- function(n, mixture.param){
    + mu <- rep(0, mixture.param$p)
    + sigma <- mixture.param$sigma
    + return(mvtnorm::rmvnorm(n, mu, sigma))
    + }
    > a <- batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
    + fname = "f", rpname = "rp", rqname = "rq", dpname = "dp", dqname = "dq")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    optismixture
     --- call from context ---
    dampednewton(alpha, rho, reltol = reltol)
     --- call from argument ---
    if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
    }
     --- R stacktrace ---
    where 1: dampednewton(alpha, rho, reltol = reltol)
    where 2: penoptpersp.alpha.only(y = opt.input$Y[get.index.b(batch.size,
     b), ], z = as.matrix(opt.input$Z[get.index.b(batch.size,
     b), ]), a0 = alpha.opt, eps = eps, reltol = opt.param$reltol,
     relerr = opt.param$relerr, rho0 = opt.param$rho0, maxin = opt.param$maxin,
     maxout = opt.param$maxout)
    where 3: batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
     fname = "f", rpname = "rp", rqname = "rq", dpname = "dp",
     dqname = "dq")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (alpha, rho, reltol)
    {
     done = FALSE
     inct <- 0
     oldf <- -Inf
     while (1) {
     vals = fgH(alpha, rho, do = 3)
     if (identical(oldf, vals$f)) {
     solstatus <- "exact"
     break
     }
     oldf <- vals$f
     newtonstep = try(-svdsolve(vals$H, vals$g), silent = TRUE)
     if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
     }
     newtonstep <- drop(newtonstep)
     decrement = -(vals$g %*% newtonstep)[1, 1]/2
     reldecrement = decrement/vals$f
     if (reldecrement <= reltol) {
     solstatus <- "exact"
     break
     }
     tval = linesearch(alpha, rho, newtonstep, vals$f, vals$g)
     alpha = alpha + tval * newtonstep
     inct = inct + 1
     if (inct >= maxin) {
     print("Reaching maximum inner iterations")
     solstatus <- "semiexact"
     print(paste("decrement", decrement))
     print(paste("vals$f", vals$f))
     break
     }
     }
     list(alpha = alpha, solstatus = solstatus, inct = inct)
    }
    <bytecode: 0x55ff9fc3de60>
    <environment: 0x55ffa05f4ad8>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(newtonstep) == "try-error") { :
     the condition has length > 1
    Calls: batch.estimation -> penoptpersp.alpha.only -> dampednewton
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 0.1
Check: examples
Result: ERROR
    Running examples in ‘optismixture-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: batch.estimation
    > ### Title: Two stage estimation, a pilot estimate of mixing alpha and a
    > ### following importance sampling, with or without control variates
    > ### Aliases: batch.estimation
    >
    > ### ** Examples
    >
    > library(optismixture)
    > seed <- 1
    > p <- 5
    > rho <- 1/2
    > gamma <- 2.4
    > sigma.dvar <- function(rho, p){
    + sigma <- matrix(0, p, p)
    + for(i in 1:(p-1)){
    + for(j in (i+1):p){
    + sigma[i,j] <- rho^(abs(i-j))
    + }
    + }
    + sigma <- sigma + t(sigma)
    + diag(sigma) <- 1
    + return(sigma)
    + }
    > sigma <- sigma.dvar(rho, p)
    > batch.size <- c(10^4, 1002)
    > j.vec <- 2^-(seq(1,5,1))
    > eps.status <- 1
    > eps.safe <- 0.1
    > ## initialization and construct derived parameters
    > mu <- rep(0, p)
    > x0 <- matrix(1, 1, p)
    > x0.mat <- rbind(rep(1,p), rep(-1, p))
    > j.mat <- data.frame(centerid = rep(1:dim(x0.mat)[1], each = length(j.vec)),
    + variance = rep(j.vec, 2))
    > J <- dim(j.mat)[1] + 1
    > eps <- rep(0.1/J, J)
    > mixture.param <- list(x0 = x0, x0.mat = x0.mat, p = p,
    + sigma = sigma, gamma = gamma, j.mat = j.mat, J = J)
    > f <- function(x, j, mixture.param){
    + f1 <- function(x, mixture.param){
    + x0 <- mixture.param$x0
    + gamma <- mixture.param$gamma
    + return(sum((x - x0)^2)^(-gamma/2))
    + }
    + return(apply(x, 1, f1, mixture.param))
    + }
    > dq <- function(x, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j, 2]
    + return(mvtnorm::dmvnorm(x, mixture.param$x0.mat[centerid,], j.param*diag(mixture.param$p)))
    + }
    > dp <- function(x, mixture.param){
    + return(mvtnorm::dmvnorm(x, rep(0, mixture.param$p), mixture.param$sigma))
    + }
    > rq <- function(n, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j,2]
    + return(mvtnorm::rmvnorm(n, mixture.param$x0.mat[centerid, ], j.param*diag(mixture.param$p)))
    + }
    > rp <- function(n, mixture.param){
    + mu <- rep(0, mixture.param$p)
    + sigma <- mixture.param$sigma
    + return(mvtnorm::rmvnorm(n, mu, sigma))
    + }
    > a <- batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
    + fname = "f", rpname = "rp", rqname = "rq", dpname = "dp", dqname = "dq")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    optismixture
     --- call from context ---
    dampednewton(alpha, rho, reltol = reltol)
     --- call from argument ---
    if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
    }
     --- R stacktrace ---
    where 1: dampednewton(alpha, rho, reltol = reltol)
    where 2: penoptpersp.alpha.only(y = opt.input$Y[get.index.b(batch.size,
     b), ], z = as.matrix(opt.input$Z[get.index.b(batch.size,
     b), ]), a0 = alpha.opt, eps = eps, reltol = opt.param$reltol,
     relerr = opt.param$relerr, rho0 = opt.param$rho0, maxin = opt.param$maxin,
     maxout = opt.param$maxout)
    where 3: batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
     fname = "f", rpname = "rp", rqname = "rq", dpname = "dp",
     dqname = "dq")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (alpha, rho, reltol)
    {
     done = FALSE
     inct <- 0
     oldf <- -Inf
     while (1) {
     vals = fgH(alpha, rho, do = 3)
     if (identical(oldf, vals$f)) {
     solstatus <- "exact"
     break
     }
     oldf <- vals$f
     newtonstep = try(-svdsolve(vals$H, vals$g), silent = TRUE)
     if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
     }
     newtonstep <- drop(newtonstep)
     decrement = -(vals$g %*% newtonstep)[1, 1]/2
     reldecrement = decrement/vals$f
     if (reldecrement <= reltol) {
     solstatus <- "exact"
     break
     }
     tval = linesearch(alpha, rho, newtonstep, vals$f, vals$g)
     alpha = alpha + tval * newtonstep
     inct = inct + 1
     if (inct >= maxin) {
     print("Reaching maximum inner iterations")
     solstatus <- "semiexact"
     print(paste("decrement", decrement))
     print(paste("vals$f", vals$f))
     break
     }
     }
     list(alpha = alpha, solstatus = solstatus, inct = inct)
    }
    <bytecode: 0x693d970>
    <environment: 0x6936580>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(newtonstep) == "try-error") { :
     the condition has length > 1
    Calls: batch.estimation -> penoptpersp.alpha.only -> dampednewton
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 0.1
Check: examples
Result: ERROR
    Running examples in ‘optismixture-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: batch.estimation
    > ### Title: Two stage estimation, a pilot estimate of mixing alpha and a
    > ### following importance sampling, with or without control variates
    > ### Aliases: batch.estimation
    >
    > ### ** Examples
    >
    > library(optismixture)
    > seed <- 1
    > p <- 5
    > rho <- 1/2
    > gamma <- 2.4
    > sigma.dvar <- function(rho, p){
    + sigma <- matrix(0, p, p)
    + for(i in 1:(p-1)){
    + for(j in (i+1):p){
    + sigma[i,j] <- rho^(abs(i-j))
    + }
    + }
    + sigma <- sigma + t(sigma)
    + diag(sigma) <- 1
    + return(sigma)
    + }
    > sigma <- sigma.dvar(rho, p)
    > batch.size <- c(10^4, 1002)
    > j.vec <- 2^-(seq(1,5,1))
    > eps.status <- 1
    > eps.safe <- 0.1
    > ## initialization and construct derived parameters
    > mu <- rep(0, p)
    > x0 <- matrix(1, 1, p)
    > x0.mat <- rbind(rep(1,p), rep(-1, p))
    > j.mat <- data.frame(centerid = rep(1:dim(x0.mat)[1], each = length(j.vec)),
    + variance = rep(j.vec, 2))
    > J <- dim(j.mat)[1] + 1
    > eps <- rep(0.1/J, J)
    > mixture.param <- list(x0 = x0, x0.mat = x0.mat, p = p,
    + sigma = sigma, gamma = gamma, j.mat = j.mat, J = J)
    > f <- function(x, j, mixture.param){
    + f1 <- function(x, mixture.param){
    + x0 <- mixture.param$x0
    + gamma <- mixture.param$gamma
    + return(sum((x - x0)^2)^(-gamma/2))
    + }
    + return(apply(x, 1, f1, mixture.param))
    + }
    > dq <- function(x, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j, 2]
    + return(mvtnorm::dmvnorm(x, mixture.param$x0.mat[centerid,], j.param*diag(mixture.param$p)))
    + }
    > dp <- function(x, mixture.param){
    + return(mvtnorm::dmvnorm(x, rep(0, mixture.param$p), mixture.param$sigma))
    + }
    > rq <- function(n, j, mixture.param){
    + centerid <- mixture.param$j.mat[j, 1]
    + j.param <- mixture.param$j.mat[j,2]
    + return(mvtnorm::rmvnorm(n, mixture.param$x0.mat[centerid, ], j.param*diag(mixture.param$p)))
    + }
    > rp <- function(n, mixture.param){
    + mu <- rep(0, mixture.param$p)
    + sigma <- mixture.param$sigma
    + return(mvtnorm::rmvnorm(n, mu, sigma))
    + }
    > a <- batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
    + fname = "f", rpname = "rp", rqname = "rq", dpname = "dp", dqname = "dq")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    optismixture
     --- call from context ---
    dampednewton(alpha, rho, reltol = reltol)
     --- call from argument ---
    if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
    }
     --- R stacktrace ---
    where 1: dampednewton(alpha, rho, reltol = reltol)
    where 2: penoptpersp.alpha.only(y = opt.input$Y[get.index.b(batch.size,
     b), ], z = as.matrix(opt.input$Z[get.index.b(batch.size,
     b), ]), a0 = alpha.opt, eps = eps, reltol = opt.param$reltol,
     relerr = opt.param$relerr, rho0 = opt.param$rho0, maxin = opt.param$maxin,
     maxout = opt.param$maxout)
    where 3: batch.estimation(seed, batch.size, mixture.param, eps, cv = FALSE,
     fname = "f", rpname = "rp", rqname = "rq", dpname = "dp",
     dqname = "dq")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (alpha, rho, reltol)
    {
     done = FALSE
     inct <- 0
     oldf <- -Inf
     while (1) {
     vals = fgH(alpha, rho, do = 3)
     if (identical(oldf, vals$f)) {
     solstatus <- "exact"
     break
     }
     oldf <- vals$f
     newtonstep = try(-svdsolve(vals$H, vals$g), silent = TRUE)
     if (class(newtonstep) == "try-error") {
     if (isTRUE(all.equal(vals$g, rep(0, length(vals$g))))) {
     solstatus <- "exact"
     break
     }
     else {
     print("returning inexact solution")
     solstatus <- "inexact"
     break
     }
     }
     newtonstep <- drop(newtonstep)
     decrement = -(vals$g %*% newtonstep)[1, 1]/2
     reldecrement = decrement/vals$f
     if (reldecrement <= reltol) {
     solstatus <- "exact"
     break
     }
     tval = linesearch(alpha, rho, newtonstep, vals$f, vals$g)
     alpha = alpha + tval * newtonstep
     inct = inct + 1
     if (inct >= maxin) {
     print("Reaching maximum inner iterations")
     solstatus <- "semiexact"
     print(paste("decrement", decrement))
     print(paste("vals$f", vals$f))
     break
     }
     }
     list(alpha = alpha, solstatus = solstatus, inct = inct)
    }
    <bytecode: 0x5e14a68>
    <environment: 0x55216a8>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(newtonstep) == "try-error") { :
     the condition has length > 1
    Calls: batch.estimation -> penoptpersp.alpha.only -> dampednewton
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc