==1148537== Memcheck, a memory error detector ==1148537== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1148537== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==1148537== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==1148537== R Under development (unstable) (2021-03-19 r80100) -- "Unsuffered Consequences" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "glmgraph" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('glmgraph') Loading required package: Rcpp > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("coef.cv.glmgraph") > ### * coef.cv.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: coef.cv.glmgraph > ### Title: Retrieve coefficients from a fitted "cv.glmgraph" object. > ### Aliases: coef.cv.glmgraph > ### Keywords: models regression > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > ## construct laplacian matrix from adjacency matrix > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > ### gaussian > Y <- eta+rnorm(n) > cv.obj <- cv.glmgraph(X,Y,L) Starting CV fold #1 Starting CV fold #2 Starting CV fold #3 Starting CV fold #4 Starting CV fold #5 > beta.min <- coef(cv.obj) > > > > cleanEx() > nameEx("coef.glmgraph") > ### * coef.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: coef.glmgraph > ### Title: Retrieve coefficients from a fitted "glmgraph" object. > ### Aliases: coef.glmgraph > ### Keywords: models regression > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > ## construct laplacian matrix from adjacency matrix > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > ### gaussian > Y <- eta+rnorm(n) > obj <- glmgraph(X,Y,L) > coefs <- coef(obj) > coefs <- coef(obj,lambda2=0.01) > coefs <- coef(obj,lambda1=c(0.11,0.12)) > coefs <- coef(obj,lambda1=c(0.11,0.12),lambda2=0.01) > > > > cleanEx() > nameEx("cv.glmgraph") > ### * cv.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: cv.glmgraph > ### Title: Cross-validation for glmgraph > ### Aliases: cv.glmgraph > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > ## construct laplacian matrix from adjacency matrix > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > ### gaussian > Y <- eta+rnorm(n) > cv.obj <- cv.glmgraph(X,Y,L,penalty="lasso",lambda2=c(0,1.28)) Starting CV fold #1 Starting CV fold #2 Starting CV fold #3 Starting CV fold #4 Starting CV fold #5 > beta.min <- coef(cv.obj) > print(cv.obj) The solution path for the regularization parameter lambda1 and lambda2 is: lambda2 lambda1.min cvmin semin lambda1.1se 1 0.00 0.04599 2.173743 2.491064 0.069901 2 1.28 0.03479 1.373100 1.548913 0.050474 The minimum mse value 1.37309991836758 is achieved when lambda2 is: 1.28 and lambda1 is: 0.03479 > ### binomial > Y <- rbinom(n,1,prob=1/(1+exp(-eta))) > cv.obj <- cv.glmgraph(X,Y,L,family="binomial",lambda2=c(0,1.28),penalty="lasso",type.measure="auc") ==1148537== Conditional jump or move depends on uninitialised value(s) ==1148537== at 0x173446F8: direct_mean (R-devel/site-library/RcppArmadillo/include/armadillo_bits/op_mean_meat.hpp:396) ==1148537== by 0x173446F8: mean_all, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur>, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/op_mean_meat.hpp:687) ==1148537== by 0x173446F8: mean, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur>, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/fn_mean.hpp:30) ==1148537== by 0x173446F8: cycle_binomial_lasso(arma::Col const&, arma::Mat const&, arma::Mat const&, arma::Col const&, arma::Col&, arma::Col&, arma::Col const&, arma::Col const&, double, double, int) (packages/tests-vg/glmgraph/src/binomial_utils.cpp:94) ==1148537== by 0x173370B2: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:69) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4DF61D: bcEval (svn/R-devel/src/main/eval.c:7083) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== Uninitialised value was created by a heap allocation ==1148537== at 0x483CE14: memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:906) ==1148537== by 0x483CF14: posix_memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:1070) ==1148537== by 0x17336610: acquire (R-devel/site-library/RcppArmadillo/include/armadillo_bits/memory.hpp:68) ==1148537== by 0x17336610: init_cold (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:225) ==1148537== by 0x17336610: Mat (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:168) ==1148537== by 0x17336610: Col (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Col_meat.hpp:48) ==1148537== by 0x17336610: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:42) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4DF61D: bcEval (svn/R-devel/src/main/eval.c:7083) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== ==1148537== Conditional jump or move depends on uninitialised value(s) ==1148537== at 0x173372C5: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:80) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4DF61D: bcEval (svn/R-devel/src/main/eval.c:7083) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1148537== Uninitialised value was created by a heap allocation ==1148537== at 0x483CE14: memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:906) ==1148537== by 0x483CF14: posix_memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:1070) ==1148537== by 0x17336610: acquire (R-devel/site-library/RcppArmadillo/include/armadillo_bits/memory.hpp:68) ==1148537== by 0x17336610: init_cold (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:225) ==1148537== by 0x17336610: Mat (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:168) ==1148537== by 0x17336610: Col (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Col_meat.hpp:48) ==1148537== by 0x17336610: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:42) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4DF61D: bcEval (svn/R-devel/src/main/eval.c:7083) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== ==1148537== Conditional jump or move depends on uninitialised value(s) ==1148537== at 0x17337354: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:80) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4DF61D: bcEval (svn/R-devel/src/main/eval.c:7083) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1148537== Uninitialised value was created by a heap allocation ==1148537== at 0x483CE14: memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:906) ==1148537== by 0x483CF14: posix_memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:1070) ==1148537== by 0x17336610: acquire (R-devel/site-library/RcppArmadillo/include/armadillo_bits/memory.hpp:68) ==1148537== by 0x17336610: init_cold (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:225) ==1148537== by 0x17336610: Mat (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:168) ==1148537== by 0x17336610: Col (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Col_meat.hpp:48) ==1148537== by 0x17336610: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:42) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4DF61D: bcEval (svn/R-devel/src/main/eval.c:7083) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== Starting CV fold #1 ==1148537== Conditional jump or move depends on uninitialised value(s) ==1148537== at 0x17345013: direct_mean (R-devel/site-library/RcppArmadillo/include/armadillo_bits/op_mean_meat.hpp:396) ==1148537== by 0x17345013: mean_all, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur>, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/op_mean_meat.hpp:687) ==1148537== by 0x17345013: mean, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur>, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/fn_mean.hpp:30) ==1148537== by 0x17345013: cycle_binomial_lasso(arma::Col const&, arma::Mat const&, arma::Mat const&, arma::Col const&, arma::Col&, arma::Col&, arma::Col const&, arma::Col const&, double, double, int) (packages/tests-vg/glmgraph/src/binomial_utils.cpp:94) ==1148537== by 0x173370B2: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:69) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1148537== by 0x46BB4C: do_docall (svn/R-devel/src/main/coerce.c:2715) ==1148537== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== Uninitialised value was created by a heap allocation ==1148537== at 0x483CE14: memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:906) ==1148537== by 0x483CF14: posix_memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:1070) ==1148537== by 0x17336610: acquire (R-devel/site-library/RcppArmadillo/include/armadillo_bits/memory.hpp:68) ==1148537== by 0x17336610: init_cold (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:225) ==1148537== by 0x17336610: Mat (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:168) ==1148537== by 0x17336610: Col (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Col_meat.hpp:48) ==1148537== by 0x17336610: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:42) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1148537== by 0x46BB4C: do_docall (svn/R-devel/src/main/coerce.c:2715) ==1148537== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1148537== Starting CV fold #2 Starting CV fold #3 Starting CV fold #4 Starting CV fold #5 > beta.min <- coef(cv.obj) > print(cv.obj) The solution path for the regularization parameter lambda1 and lambda2 is: lambda2 lambda1.min cvmin semin lambda1.1se 1 0.00 0.103158 0.7442424 0.7009390 0.130171 2 1.28 0.074489 0.8934949 0.8815182 0.089722 The maximum auc value 0.89349494949495 is achieved when lambda2 is: 1.28 and lambda1 is: 0.074489 > > > > cleanEx() > nameEx("glmgraph-package") > ### * glmgraph-package > > flush(stderr()); flush(stdout()) > > ### Name: glmgraph-package > ### Title: Fit a GLM with a combination of sparse and smooth regularization > ### Aliases: glmgraph-package > ### Keywords: models regression package > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > ## Construct Adjacency and Laplacian matrices > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > Y <- eta+rnorm(n) > obj <- glmgraph(X,Y,L,family="gaussian") > plot(obj) > betas <- coef(obj) > betas <- coef(obj,lambda1=c(0.1,0.2)) > yhat <- predict(obj,X,type="response") > cv.obj <- cv.glmgraph(X,Y,L) Starting CV fold #1 Starting CV fold #2 Starting CV fold #3 Starting CV fold #4 Starting CV fold #5 > plot(cv.obj) > beta.min <- coef(cv.obj) > yhat.min <- predict(cv.obj,X) > > > > > cleanEx() > nameEx("glmgraph") > ### * glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: glmgraph > ### Title: Fit a GLM with a combination of sparse and smooth regularization > ### Aliases: glmgraph > ### Keywords: models regression > > ### ** Examples > > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > ### construct laplacian matrix from adjacency matrix > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > ### gaussian > Y <- eta+rnorm(n) > obj <- glmgraph(X,Y,L,family="gaussian") > plot(obj) > ### binomial > Y <- rbinom(n,1,prob=1/(1+exp(-eta))) > obj <- glmgraph(X,Y,L,family="binomial") ==1148537== Conditional jump or move depends on uninitialised value(s) ==1148537== at 0x17340FB4: direct_mean (R-devel/site-library/RcppArmadillo/include/armadillo_bits/op_mean_meat.hpp:396) ==1148537== by 0x17340FB4: mean_all, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur>, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/op_mean_meat.hpp:687) ==1148537== by 0x17340FB4: mean, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur>, arma::eGlue, arma::Col, arma::eglue_minus>, arma::eglue_schur> > (R-devel/site-library/RcppArmadillo/include/armadillo_bits/fn_mean.hpp:30) ==1148537== by 0x17340FB4: cycle_binomial_MCP(arma::Col const&, arma::Mat const&, arma::Mat const&, arma::Col const&, arma::Col&, arma::Col&, arma::Col const&, arma::Col const&, double, double, double, std::__cxx11::basic_string, std::allocator > const&, int) (packages/tests-vg/glmgraph/src/binomial_utils.cpp:233) ==1148537== by 0x17337B74: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:70) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1148537== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1148537== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1148537== by 0x52123C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==1148537== Uninitialised value was created by a heap allocation ==1148537== at 0x483CE14: memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:906) ==1148537== by 0x483CF14: posix_memalign (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:1070) ==1148537== by 0x17336610: acquire (R-devel/site-library/RcppArmadillo/include/armadillo_bits/memory.hpp:68) ==1148537== by 0x17336610: init_cold (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:225) ==1148537== by 0x17336610: Mat (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Mat_meat.hpp:168) ==1148537== by 0x17336610: Col (R-devel/site-library/RcppArmadillo/include/armadillo_bits/Col_meat.hpp:48) ==1148537== by 0x17336610: cdfit_binomial (packages/tests-vg/glmgraph/src/binomial.cpp:42) ==1148537== by 0x49CFEB: R_doDotCall (svn/R-devel/src/main/dotcode.c:657) ==1148537== by 0x49D663: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==1148537== by 0x4DA5CA: bcEval (svn/R-devel/src/main/eval.c:7671) ==1148537== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1148537== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1148537== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1148537== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1148537== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1148537== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1148537== > plot(obj) > > > > > cleanEx() > nameEx("plot.cv.glmgraph") > ### * plot.cv.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: plot.cv.glmgraph > ### Title: Plot the cross-validation curve produced by cv.glmgraph > ### Aliases: plot.cv.glmgraph > ### Keywords: models regression > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > ### construct laplacian matrix from adjacency matrix > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > ### gaussian > Y <- eta+rnorm(n) > cv.obj <- cv.glmgraph(X,Y,L) Starting CV fold #1 Starting CV fold #2 Starting CV fold #3 Starting CV fold #4 Starting CV fold #5 > plot(cv.obj) > > > > cleanEx() > nameEx("plot.glmgraph") > ### * plot.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: plot.glmgraph > ### Title: Plot coefficients from a "glmgraph" object > ### Aliases: plot.glmgraph > ### Keywords: models regression > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > ### construct laplacian matrix from adjacency matrix > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > ### gaussian > Y <- eta+rnorm(n) > obj <- glmgraph(X,Y,L) > plot(obj) > ### binomial > Y <- rbinom(n,1,prob=1/(1+exp(-eta))) > obj <- glmgraph(X,Y,L,family="binomial") > plot(obj) > > > > > cleanEx() > nameEx("predict.cv.glmgraph") > ### * predict.cv.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: predict.cv.glmgraph > ### Title: make prediction from a fitted "cv.glmgraph" object. > ### Aliases: predict.cv.glmgraph > ### Keywords: models regression > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > ### construct laplacian matrix from adjacency matrix > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > ### gaussian > Y <- eta+rnorm(n) > cv.obj <- cv.glmgraph(X,Y,L) Starting CV fold #1 Starting CV fold #2 Starting CV fold #3 Starting CV fold #4 Starting CV fold #5 > beta.min <- predict(cv.obj,X,type="coefficients") > > > > cleanEx() > nameEx("predict.glmgraph") > ### * predict.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: predict.glmgraph > ### Title: Model predictions based on a fitted "glmgraph" object. > ### Aliases: predict.glmgraph predict.glmgraph > ### Keywords: models regression > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > ## construct laplacian matrix from adjacency matrix > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > ### gaussian > Y <- eta+rnorm(n) > obj <- glmgraph(X,Y,L) > res <- predict(obj, X, type="link", lambda1=0.05,lambda2=0.01) > res <- predict(obj, X, type="response", lambda1=0.05,lambda2=0.01) > res <- predict(obj,X,type="nzeros",lambda1=0.05,lambda2=0.01) > ### binomial > Y <- rbinom(n,1,prob=1/(1+exp(-eta))) > obj <- glmgraph(X,Y,L,family="binomial") > res <- predict(obj,X,type="class",lambda1=c(0.05,0.06),lambda2=c(0.02,0.16,0.32)) > > > > cleanEx() > nameEx("print.cv.glmgraph") > ### * print.cv.glmgraph > > flush(stderr()); flush(stdout()) > > ### Name: print.cv.glmgraph > ### Title: print a glmgraph object > ### Aliases: print.cv.glmgraph > ### Keywords: models regression > > ### ** Examples > > set.seed(1234) > library(glmgraph) > n <- 100 > p1 <- 10 > p2 <- 90 > p <- p1+p2 > X <- matrix(rnorm(n*p), n,p) > magnitude <- 1 > A <- matrix(rep(0,p*p),p,p) > A[1:p1,1:p1] <- 1 > A[(p1+1):p,(p1+1):p] <- 1 > diag(A) <- 0 > btrue <- c(rep(magnitude,p1),rep(0,p2)) > intercept <- 0 > eta <- intercept+X%*%btrue > ### construct laplacian matrix from adjacency matrix > diagL <- apply(A,1,sum) > L <- -A > diag(L) <- diagL > ### gaussian > Y <- eta+rnorm(n) > cv.obj <- cv.glmgraph(X,Y,L) Starting CV fold #1 Starting CV fold #2 Starting CV fold #3 Starting CV fold #4 Starting CV fold #5 > print(cv.obj) The solution path for the regularization parameter lambda1 and lambda2 is: lambda2 lambda1.min cvmin semin lambda1.1se 1 0.00 0.058033 1.783354 1.998853 0.076716 2 0.01 0.050474 1.612999 1.806555 0.073230 3 0.02 0.048180 1.527260 1.706511 0.073230 4 0.04 0.048180 1.435546 1.600005 0.069901 5 0.08 0.045990 1.353865 1.506644 0.069901 6 0.16 0.045990 1.294081 1.437688 0.069901 7 0.32 0.045990 1.253975 1.390898 0.069901 8 0.64 0.045990 1.236160 1.369409 0.069901 9 1.28 0.045990 1.226148 1.357273 0.069901 The minimum mse value 1.22614827955824 is achieved when lambda2 is: 1.28 and lambda1 is: 0.04599 > > > > ### *