[Mboost-commits] r826 - pkg/mboostPatch/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Feb 12 14:58:00 CET 2015
Author: hofner
Date: 2015-02-12 14:58:00 +0100 (Thu, 12 Feb 2015)
New Revision: 826
Modified:
pkg/mboostPatch/R/bl.R
pkg/mboostPatch/R/bmrf.R
pkg/mboostPatch/R/brad.R
pkg/mboostPatch/R/btree.R
Log:
added requireNamespace and removed EISPACK = FALSE
Modified: pkg/mboostPatch/R/bl.R
===================================================================
--- pkg/mboostPatch/R/bl.R 2015-02-12 13:57:57 UTC (rev 825)
+++ pkg/mboostPatch/R/bl.R 2015-02-12 13:58:00 UTC (rev 826)
@@ -287,7 +287,7 @@
### L = \Gamma \Omega^1/2 in Section 2.3. of
### Fahrmeir et al. (2004, Stat Sinica)
"spectralDecomp" = {
- SVD <- eigen(crossprod(K), symmetric = TRUE, EISPACK = FALSE)
+ SVD <- eigen(crossprod(K), symmetric = TRUE)
ev <- SVD$vector[, 1:(ncol(X) - args$differences), drop = FALSE]
ew <- SVD$values[1:(ncol(X) - args$differences), drop = FALSE]
X %*% ev %*% diag(1/sqrt(ew))
@@ -360,7 +360,7 @@
if (!identical(args$center, FALSE)) {
### L = \Gamma \Omega^1/2 in Section 2.3. of Fahrmeir et al.
### (2004, Stat Sinica), always
- L <- eigen(K, symmetric = TRUE, EISPACK = FALSE)
+ L <- eigen(K, symmetric = TRUE)
L$vectors <- L$vectors[,1:(ncol(X) - args$differences^2), drop = FALSE]
L$values <- sqrt(L$values[1:(ncol(X) - args$differences^2), drop = FALSE])
L <- L$vectors %*% (diag(length(L$values)) * (1/L$values))
@@ -561,7 +561,6 @@
### cyclic B-splines
### adapted version of mgcv:cSplineDes from S.N. Wood
cbs <- function (x, knots, boundary.knots, degree = 3, deriv = 0L) {
- # require(splines)
nx <- names(x)
x <- as.vector(x)
## handling of NAs
Modified: pkg/mboostPatch/R/bmrf.R
===================================================================
--- pkg/mboostPatch/R/bmrf.R 2015-02-12 13:57:57 UTC (rev 825)
+++ pkg/mboostPatch/R/bmrf.R 2015-02-12 13:58:00 UTC (rev 826)
@@ -2,7 +2,7 @@
function (..., by = NULL, index = NULL, bnd = NULL, df = 4, lambda = NULL,
center = FALSE)
{
- if (!require("BayesX"))
+ if (!requireNamespace("BayesX"))
stop("cannot load ", sQuote("BayesX"))
cll <- match.call()
@@ -97,7 +97,7 @@
if (isTRUE(args$center)) {
### L = \Gamma \Omega^1/2 in Section 2.3. of Fahrmeir et al.
### (2004, Stat Sinica)
- SVD <- eigen(K, EISPACK = FALSE)
+ SVD <- eigen(K)
ev <- SVD$vectors[, -dim(SVD$vectors)[2]]
ew <- SVD$values[-length(SVD$values)]
X <- as(X %*% ev %*% diag(1/sqrt(ew)), "matrix")
Modified: pkg/mboostPatch/R/brad.R
===================================================================
--- pkg/mboostPatch/R/brad.R 2015-02-12 13:57:57 UTC (rev 825)
+++ pkg/mboostPatch/R/brad.R 2015-02-12 13:58:00 UTC (rev 826)
@@ -2,9 +2,6 @@
covFun = fields::stationary.cov,
args = list(Covariance = "Matern", smoothness = 1.5, theta = NULL)) {
- # if (!require("fields"))
- # stop("cannot load ", sQuote("fields"))
-
cll <- match.call()
cll[[1]] <- as.name("brad")
@@ -116,7 +113,7 @@
## first we need to build a correct matrix of mf
x <- as.matrix(mf[which(colnames(mf) != vary)])
if (length(knots) == 1) {
- if (!require("fields"))
+ if (!requireNamespace("fields"))
stop("Cannot load package", sQuote("fields"),
", which is needed for the automatic knot placement")
knots <- fields::cover.design(R = unique(x), nd = knots)$design
Modified: pkg/mboostPatch/R/btree.R
===================================================================
--- pkg/mboostPatch/R/btree.R 2015-02-12 13:57:57 UTC (rev 825)
+++ pkg/mboostPatch/R/btree.R 2015-02-12 13:58:00 UTC (rev 826)
@@ -6,7 +6,7 @@
mincriterion = 0,
savesplitstats = FALSE)) {
- if (!require("party"))
+ if (!requireNamespace("party"))
stop("cannot load ", sQuote("party"))
cll <- match.call()
More information about the Mboost-commits
mailing list