Last updated on 2020-02-19 10:49:05 CET.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 0.1.2 | 8.48 | 73.46 | 81.94 | ERROR | |
r-devel-linux-x86_64-debian-gcc | 0.1.2 | 8.73 | 56.71 | 65.44 | ERROR | |
r-devel-linux-x86_64-fedora-clang | 0.1.2 | 97.24 | ERROR | |||
r-devel-linux-x86_64-fedora-gcc | 0.1.2 | 98.70 | ERROR | |||
r-devel-windows-ix86+x86_64 | 0.1.2 | 20.00 | 95.00 | 115.00 | OK | |
r-devel-windows-ix86+x86_64-gcc8 | 0.1.2 | 26.00 | 100.00 | 126.00 | OK | |
r-patched-linux-x86_64 | 0.1.2 | 7.65 | 86.83 | 94.48 | OK | |
r-patched-solaris-x86 | 0.1.2 | 175.60 | OK | |||
r-release-linux-x86_64 | 0.1.2 | 8.55 | 90.29 | 98.84 | OK | |
r-release-windows-ix86+x86_64 | 0.1.2 | 16.00 | 93.00 | 109.00 | OK | |
r-release-osx-x86_64 | 0.1.2 | OK | ||||
r-oldrel-windows-ix86+x86_64 | 0.1.2 | 11.00 | 90.00 | 101.00 | OK | |
r-oldrel-osx-x86_64 | 0.1.2 | OK |
Version: 0.1.2
Check: examples
Result: ERROR
Running examples in 'qrcmNP-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: gof.piqr
> ### Title: Goodness of Fit of Penalized Quantile Regression Coefficients
> ### Modeling
> ### Aliases: gof.piqr
>
> ### ** Examples
>
>
> # using simulated data
>
> set.seed(1234)
> n <- 300
> x1 <- rexp(n)
> x2 <- runif(n, 0, 5)
> x <- cbind(x1,x2)
>
> b <- function(p){matrix(cbind(1, qnorm(p), slp(p, 2)), nrow=4, byrow=TRUE)}
> theta <- matrix(0, nrow=3, ncol=4); theta[, 1] <- 1; theta[1,2] <- 1; theta[2:3,3] <- 2
> qy <- function(p, theta, b, x){rowSums(x * t(theta %*% b(p)))}
>
> y <- qy(runif(n), theta, b, cbind(1, x))
>
> s <- matrix(1, nrow=3, ncol=4); s[1,3:4] <- 0
> obj <- piqr(y ~ x1 + x2, formula.p = ~ I(qnorm(p)) + slp(p, 2), s=s, nlambda=50)
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
qrcmNP
--- call from context ---
piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
--- call from argument ---
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
} else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
--- R stacktrace ---
where 1: piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
where 2: piqr.internal(mf = mf, cl = cl, formula.p = formula.p, tol = tol,
maxit = maxit, segno = 1, lambda = 0, check = FALSE, A = A,
s = seqS[[1]], st.theta = TRUE, theta0 = Theta0)
where 3: piqr(y ~ x1 + x2, formula.p = ~I(qnorm(p)) + slp(p, 2), s = s,
nlambda = 50)
--- value of length: 2 type: logical ---
[1] TRUE TRUE
--- function from context ---
function (theta, y, z, d, X, Xw, bfun, s, type, tol = 1e-06,
maxit = 100, safeit, eps0, segno = 1, lambda = 0)
{
p.bisec.internal <- getFromNamespace("p.bisec.internal",
"qrcm")
if (type == "iqr") {
ee <- piqr.ee
}
else if (type == "ciqr") {
ee <- pciqr.ee
}
else {
ee <- pctiqr.ee
}
q <- nrow(theta)
k <- ncol(theta)
s <- c(s == 1)
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = segno, lambda = lambda)
g <- G$g[s]
conv <- FALSE
eps <- eps0
edf <- NULL
for (i in 1:safeit) {
if (conv | max(abs(g)) < tol) {
break
}
u <- rep.int(0, q * k)
u[s] <- g
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
eps <- min(eps * 2, 0.1)
}
alg <- "nr"
conv <- FALSE
eps <- 0.1
h <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)$J[s,
s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
for (i in 1:maxit) {
if (conv | max(abs(g)) < tol) {
break
}
if (type == "iqr") {
H1 <- try(chol(h), silent = TRUE)
err <- (class(H1) == "try-error")
}
else {
H1 <- qr(h)
r <- H1$rank
err <- (r != ncol(h))
}
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
}
else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
u <- rep.int(0, q * k)
u[s] <- delta
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
.temp <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)
edf <- .temp$edf
h <- .temp$J[s, s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
if (i > 1) {
eps <- min(eps * 10, 1)
}
else {
eps <- min(eps * 10, 0.1)
}
}
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
py <- bfun$p[p.star.y]
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
pz <- bfun$p[p.star.z]
pz <- pmin(pz, py - 1e-08)
pz[p.star.z == 1] <- 0
}
else {
p.star.z <- pz <- NULL
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = 1, lambda = 0)
list(coefficients = matrix(theta, q, k), converged = (i <
maxit), n.it = i, p.star.y = p.star.y, p.star.z = p.star.z,
py = py, pz = pz, ee = g, jacobian = h, rank = (alg ==
"nr") * sum(s), grad = G$g, edf = edf)
}
<bytecode: 0xd577988>
<environment: namespace:qrcmNP>
--- function search by body ---
Function piqr.newton in namespace qrcmNP has this body.
----------- END OF FAILURE REPORT --------------
Error in if (!err) { : the condition has length > 1
Calls: piqr -> piqr.internal -> piqr.newton
Execution halted
Flavor: r-devel-linux-x86_64-debian-clang
Version: 0.1.2
Check: examples
Result: ERROR
Running examples in ‘qrcmNP-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: gof.piqr
> ### Title: Goodness of Fit of Penalized Quantile Regression Coefficients
> ### Modeling
> ### Aliases: gof.piqr
>
> ### ** Examples
>
>
> # using simulated data
>
> set.seed(1234)
> n <- 300
> x1 <- rexp(n)
> x2 <- runif(n, 0, 5)
> x <- cbind(x1,x2)
>
> b <- function(p){matrix(cbind(1, qnorm(p), slp(p, 2)), nrow=4, byrow=TRUE)}
> theta <- matrix(0, nrow=3, ncol=4); theta[, 1] <- 1; theta[1,2] <- 1; theta[2:3,3] <- 2
> qy <- function(p, theta, b, x){rowSums(x * t(theta %*% b(p)))}
>
> y <- qy(runif(n), theta, b, cbind(1, x))
>
> s <- matrix(1, nrow=3, ncol=4); s[1,3:4] <- 0
> obj <- piqr(y ~ x1 + x2, formula.p = ~ I(qnorm(p)) + slp(p, 2), s=s, nlambda=50)
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
qrcmNP
--- call from context ---
piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
--- call from argument ---
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
} else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
--- R stacktrace ---
where 1: piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
where 2: piqr.internal(mf = mf, cl = cl, formula.p = formula.p, tol = tol,
maxit = maxit, segno = 1, lambda = 0, check = FALSE, A = A,
s = seqS[[1]], st.theta = TRUE, theta0 = Theta0)
where 3: piqr(y ~ x1 + x2, formula.p = ~I(qnorm(p)) + slp(p, 2), s = s,
nlambda = 50)
--- value of length: 2 type: logical ---
[1] TRUE TRUE
--- function from context ---
function (theta, y, z, d, X, Xw, bfun, s, type, tol = 1e-06,
maxit = 100, safeit, eps0, segno = 1, lambda = 0)
{
p.bisec.internal <- getFromNamespace("p.bisec.internal",
"qrcm")
if (type == "iqr") {
ee <- piqr.ee
}
else if (type == "ciqr") {
ee <- pciqr.ee
}
else {
ee <- pctiqr.ee
}
q <- nrow(theta)
k <- ncol(theta)
s <- c(s == 1)
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = segno, lambda = lambda)
g <- G$g[s]
conv <- FALSE
eps <- eps0
edf <- NULL
for (i in 1:safeit) {
if (conv | max(abs(g)) < tol) {
break
}
u <- rep.int(0, q * k)
u[s] <- g
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
eps <- min(eps * 2, 0.1)
}
alg <- "nr"
conv <- FALSE
eps <- 0.1
h <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)$J[s,
s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
for (i in 1:maxit) {
if (conv | max(abs(g)) < tol) {
break
}
if (type == "iqr") {
H1 <- try(chol(h), silent = TRUE)
err <- (class(H1) == "try-error")
}
else {
H1 <- qr(h)
r <- H1$rank
err <- (r != ncol(h))
}
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
}
else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
u <- rep.int(0, q * k)
u[s] <- delta
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
.temp <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)
edf <- .temp$edf
h <- .temp$J[s, s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
if (i > 1) {
eps <- min(eps * 10, 1)
}
else {
eps <- min(eps * 10, 0.1)
}
}
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
py <- bfun$p[p.star.y]
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
pz <- bfun$p[p.star.z]
pz <- pmin(pz, py - 1e-08)
pz[p.star.z == 1] <- 0
}
else {
p.star.z <- pz <- NULL
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = 1, lambda = 0)
list(coefficients = matrix(theta, q, k), converged = (i <
maxit), n.it = i, p.star.y = p.star.y, p.star.z = p.star.z,
py = py, pz = pz, ee = g, jacobian = h, rank = (alg ==
"nr") * sum(s), grad = G$g, edf = edf)
}
<bytecode: 0x560dca8e6b10>
<environment: namespace:qrcmNP>
--- function search by body ---
Function piqr.newton in namespace qrcmNP has this body.
----------- END OF FAILURE REPORT --------------
Error in if (!err) { : the condition has length > 1
Calls: piqr -> piqr.internal -> piqr.newton
Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 0.1.2
Check: examples
Result: ERROR
Running examples in ‘qrcmNP-Ex.R’ failed
The error most likely occurred in:
> ### Name: gof.piqr
> ### Title: Goodness of Fit of Penalized Quantile Regression Coefficients
> ### Modeling
> ### Aliases: gof.piqr
>
> ### ** Examples
>
>
> # using simulated data
>
> set.seed(1234)
> n <- 300
> x1 <- rexp(n)
> x2 <- runif(n, 0, 5)
> x <- cbind(x1,x2)
>
> b <- function(p){matrix(cbind(1, qnorm(p), slp(p, 2)), nrow=4, byrow=TRUE)}
> theta <- matrix(0, nrow=3, ncol=4); theta[, 1] <- 1; theta[1,2] <- 1; theta[2:3,3] <- 2
> qy <- function(p, theta, b, x){rowSums(x * t(theta %*% b(p)))}
>
> y <- qy(runif(n), theta, b, cbind(1, x))
>
> s <- matrix(1, nrow=3, ncol=4); s[1,3:4] <- 0
> obj <- piqr(y ~ x1 + x2, formula.p = ~ I(qnorm(p)) + slp(p, 2), s=s, nlambda=50)
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
qrcmNP
--- call from context ---
piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
--- call from argument ---
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
} else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
--- R stacktrace ---
where 1: piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
where 2: piqr.internal(mf = mf, cl = cl, formula.p = formula.p, tol = tol,
maxit = maxit, segno = 1, lambda = 0, check = FALSE, A = A,
s = seqS[[1]], st.theta = TRUE, theta0 = Theta0)
where 3: piqr(y ~ x1 + x2, formula.p = ~I(qnorm(p)) + slp(p, 2), s = s,
nlambda = 50)
--- value of length: 2 type: logical ---
[1] TRUE TRUE
--- function from context ---
function (theta, y, z, d, X, Xw, bfun, s, type, tol = 1e-06,
maxit = 100, safeit, eps0, segno = 1, lambda = 0)
{
p.bisec.internal <- getFromNamespace("p.bisec.internal",
"qrcm")
if (type == "iqr") {
ee <- piqr.ee
}
else if (type == "ciqr") {
ee <- pciqr.ee
}
else {
ee <- pctiqr.ee
}
q <- nrow(theta)
k <- ncol(theta)
s <- c(s == 1)
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = segno, lambda = lambda)
g <- G$g[s]
conv <- FALSE
eps <- eps0
edf <- NULL
for (i in 1:safeit) {
if (conv | max(abs(g)) < tol) {
break
}
u <- rep.int(0, q * k)
u[s] <- g
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
eps <- min(eps * 2, 0.1)
}
alg <- "nr"
conv <- FALSE
eps <- 0.1
h <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)$J[s,
s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
for (i in 1:maxit) {
if (conv | max(abs(g)) < tol) {
break
}
if (type == "iqr") {
H1 <- try(chol(h), silent = TRUE)
err <- (class(H1) == "try-error")
}
else {
H1 <- qr(h)
r <- H1$rank
err <- (r != ncol(h))
}
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
}
else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
u <- rep.int(0, q * k)
u[s] <- delta
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
.temp <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)
edf <- .temp$edf
h <- .temp$J[s, s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
if (i > 1) {
eps <- min(eps * 10, 1)
}
else {
eps <- min(eps * 10, 0.1)
}
}
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
py <- bfun$p[p.star.y]
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
pz <- bfun$p[p.star.z]
pz <- pmin(pz, py - 1e-08)
pz[p.star.z == 1] <- 0
}
else {
p.star.z <- pz <- NULL
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = 1, lambda = 0)
list(coefficients = matrix(theta, q, k), converged = (i <
maxit), n.it = i, p.star.y = p.star.y, p.star.z = p.star.z,
py = py, pz = pz, ee = g, jacobian = h, rank = (alg ==
"nr") * sum(s), grad = G$g, edf = edf)
}
<bytecode: 0xd1b2098>
<environment: namespace:qrcmNP>
--- function search by body ---
Function piqr.newton in namespace qrcmNP has this body.
----------- END OF FAILURE REPORT --------------
Error in if (!err) { : the condition has length > 1
Calls: piqr -> piqr.internal -> piqr.newton
Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang
Version: 0.1.2
Check: examples
Result: ERROR
Running examples in ‘qrcmNP-Ex.R’ failed
The error most likely occurred in:
> ### Name: gof.piqr
> ### Title: Goodness of Fit of Penalized Quantile Regression Coefficients
> ### Modeling
> ### Aliases: gof.piqr
>
> ### ** Examples
>
>
> # using simulated data
>
> set.seed(1234)
> n <- 300
> x1 <- rexp(n)
> x2 <- runif(n, 0, 5)
> x <- cbind(x1,x2)
>
> b <- function(p){matrix(cbind(1, qnorm(p), slp(p, 2)), nrow=4, byrow=TRUE)}
> theta <- matrix(0, nrow=3, ncol=4); theta[, 1] <- 1; theta[1,2] <- 1; theta[2:3,3] <- 2
> qy <- function(p, theta, b, x){rowSums(x * t(theta %*% b(p)))}
>
> y <- qy(runif(n), theta, b, cbind(1, x))
>
> s <- matrix(1, nrow=3, ncol=4); s[1,3:4] <- 0
> obj <- piqr(y ~ x1 + x2, formula.p = ~ I(qnorm(p)) + slp(p, 2), s=s, nlambda=50)
----------- FAILURE REPORT --------------
--- failure: the condition has length > 1 ---
--- srcref ---
:
--- package (from environment) ---
qrcmNP
--- call from context ---
piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
--- call from argument ---
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
} else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
--- R stacktrace ---
where 1: piqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type,
tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0, segno = segno,
lambda = lambda)
where 2: piqr.internal(mf = mf, cl = cl, formula.p = formula.p, tol = tol,
maxit = maxit, segno = 1, lambda = 0, check = FALSE, A = A,
s = seqS[[1]], st.theta = TRUE, theta0 = Theta0)
where 3: piqr(y ~ x1 + x2, formula.p = ~I(qnorm(p)) + slp(p, 2), s = s,
nlambda = 50)
--- value of length: 2 type: logical ---
[1] TRUE TRUE
--- function from context ---
function (theta, y, z, d, X, Xw, bfun, s, type, tol = 1e-06,
maxit = 100, safeit, eps0, segno = 1, lambda = 0)
{
p.bisec.internal <- getFromNamespace("p.bisec.internal",
"qrcm")
if (type == "iqr") {
ee <- piqr.ee
}
else if (type == "ciqr") {
ee <- pciqr.ee
}
else {
ee <- pctiqr.ee
}
q <- nrow(theta)
k <- ncol(theta)
s <- c(s == 1)
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = segno, lambda = lambda)
g <- G$g[s]
conv <- FALSE
eps <- eps0
edf <- NULL
for (i in 1:safeit) {
if (conv | max(abs(g)) < tol) {
break
}
u <- rep.int(0, q * k)
u[s] <- g
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
eps <- min(eps * 2, 0.1)
}
alg <- "nr"
conv <- FALSE
eps <- 0.1
h <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)$J[s,
s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
for (i in 1:maxit) {
if (conv | max(abs(g)) < tol) {
break
}
if (type == "iqr") {
H1 <- try(chol(h), silent = TRUE)
err <- (class(H1) == "try-error")
}
else {
H1 <- qr(h)
r <- H1$rank
err <- (r != ncol(h))
}
if (!err) {
if (alg == "gs") {
alg <- "nr"
eps <- 1
}
delta <- (if (type == "iqr")
chol2inv(H1) %*% g
else qr.solve(H1) %*% g)
}
else {
if (alg == "nr") {
alg <- "gs"
eps <- 1
}
delta <- g
}
u <- rep.int(0, q * k)
u[s] <- delta
delta <- matrix(u, q, k)
delta[is.na(delta)] <- 0
cond <- FALSE
while (!cond) {
new.theta <- theta - delta * eps
if (max(abs(delta * eps)) < tol) {
conv <- TRUE
break
}
p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(new.theta, z, X,
bfun$bp)
}
G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y,
p.star.z, J = FALSE, segno = segno, lambda = lambda)
g1 <- G1$g[s]
cond <- (sum(g1^2) < sum(g^2))
eps <- eps * 0.5
}
if (conv) {
break
}
g <- g1
G <- G1
theta <- new.theta
.temp <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = TRUE, G = G, segno = segno, lambda = lambda)
edf <- .temp$edf
h <- .temp$J[s, s, drop = FALSE]
h <- h + diag(1e-04, nrow(h))
if (i > 1) {
eps <- min(eps * 10, 1)
}
else {
eps <- min(eps * 10, 0.1)
}
}
p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
py <- bfun$p[p.star.y]
if (type == "ctiqr") {
p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
pz <- bfun$p[p.star.z]
pz <- pmin(pz, py - 1e-08)
pz[p.star.z == 1] <- 0
}
else {
p.star.z <- pz <- NULL
}
G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z,
J = FALSE, segno = 1, lambda = 0)
list(coefficients = matrix(theta, q, k), converged = (i <
maxit), n.it = i, p.star.y = p.star.y, p.star.z = p.star.z,
py = py, pz = pz, ee = g, jacobian = h, rank = (alg ==
"nr") * sum(s), grad = G$g, edf = edf)
}
<bytecode: 0xcbaf9b0>
<environment: namespace:qrcmNP>
--- function search by body ---
Function piqr.newton in namespace qrcmNP has this body.
----------- END OF FAILURE REPORT --------------
Error in if (!err) { : the condition has length > 1
Calls: piqr -> piqr.internal -> piqr.newton
Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc