Package netcoh. May 2, 2016

Similar documents
Package covtest. R topics documented:

Package scio. February 20, 2015

Package esaddle. R topics documented: January 9, 2017

Package penmsm. R topics documented: February 20, Type Package

Package Grace. R topics documented: April 9, Type Package

Package metafuse. October 17, 2016

Package jmcm. November 25, 2017

Package spcov. R topics documented: February 20, 2015

Package CoxRidge. February 27, 2015

Package rnmf. February 20, 2015

Package varband. November 7, 2016

Package survidinri. February 20, 2015

Package CompQuadForm

Package dhsic. R topics documented: July 27, 2017

Package rbvs. R topics documented: August 29, Type Package Title Ranking-Based Variable Selection Version 1.0.

Package CPE. R topics documented: February 19, 2015

Package SimSCRPiecewise

Package HIMA. November 8, 2017

Package penalized. February 21, 2018

Package abundant. January 1, 2017

Package BNN. February 2, 2018

Package icmm. October 12, 2017

Package basad. November 20, 2017

Package rarhsmm. March 20, 2018

Package TwoStepCLogit

Package ICGOR. January 13, 2017

Package idmtpreg. February 27, 2018

Package gma. September 19, 2017

Package MiRKATS. May 30, 2016

Package GPfit. R topics documented: April 2, Title Gaussian Processes Modeling Version Date

Package bayeslm. R topics documented: June 18, Type Package

The nltm Package. July 24, 2006

Package gwqs. R topics documented: May 7, Type Package. Title Generalized Weighted Quantile Sum Regression. Version 1.1.0

Package alphaoutlier

Package RZigZag. April 30, 2018

Package ltsbase. R topics documented: February 20, 2015

Package esreg. August 22, 2017

Package ARCensReg. September 11, 2016

Package anoint. July 19, 2015

Package MACAU2. R topics documented: April 8, Type Package. Title MACAU 2.0: Efficient Mixed Model Analysis of Count Data. Version 1.

Package mlmmm. February 20, 2015

Package RI2by2. October 21, 2016

Package RcppSMC. March 18, 2018

Package ShrinkCovMat

Package severity. February 20, 2015

Package flexcwm. R topics documented: July 11, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.0.

Package RootsExtremaInflections

Package IsingFit. September 7, 2016

Package shrink. August 29, 2013

Package fwsim. October 5, 2018

Package EnergyOnlineCPM

Package zic. August 22, 2017

Package SpatPCA. R topics documented: February 20, Type Package

Package leiv. R topics documented: February 20, Version Type Package

Package R1magic. August 29, 2016

Package flexcwm. R topics documented: July 2, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.1.

Package drgee. November 8, 2016

Package clogitboost. R topics documented: December 21, 2015

Package GORCure. January 13, 2017

Package pssm. March 1, 2017

Package threg. August 10, 2015

Package MicroMacroMultilevel

Package NlinTS. September 10, 2018

Package bivariate. December 10, 2018

Package comparec. R topics documented: February 19, Type Package

Package gtheory. October 30, 2016

Package metansue. July 11, 2018

Package EMVS. April 24, 2018

Package SpatialVS. R topics documented: November 10, Title Spatial Variable Selection Version 1.1

Package R1magic. April 9, 2013

Package msir. R topics documented: April 7, Type Package Version Date Title Model-Based Sliced Inverse Regression

Package beam. May 3, 2018

Package sscor. January 28, 2016

Package FinCovRegularization

Package factorqr. R topics documented: February 19, 2015

Package sindyr. September 10, 2018

Package NonpModelCheck

Package JointModel. R topics documented: June 9, Title Semiparametric Joint Models for Longitudinal and Counting Processes Version 1.

Package unbalhaar. February 20, 2015

Package blme. August 29, 2016

Package RTransferEntropy

Package darts. February 19, 2015

Package spef. February 26, 2018

Package pearson7. June 22, 2016

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package ICBayes. September 24, 2017

Package crrsc. R topics documented: February 19, 2015

Package mhsmm. January 15, 2017

Package SPreFuGED. July 29, 2016

Package multivariance

Package alabama. March 6, 2015

Package rgabriel. February 20, 2015

Package LBLGXE. R topics documented: July 20, Type Package

Package FDRreg. August 29, 2016

Package horseshoe. November 8, 2016

Package skellam. R topics documented: December 15, Version Date

Package monmlp. R topics documented: December 5, Type Package

Package CovSel. September 25, 2013

Package FDRSeg. September 20, 2017

Package eel. September 1, 2015

Transcription:

Type Package Title Statistical Modeling with Network Cohesion Version 0.2 Date 2016-04-29 Author Tianxi Li, Elizaveta Levina, Ji Zhu Maintainer Tianxi Li <tianxili@umich.edu> Package netcoh May 2, 2016 Description Model fitting procedures for regression with network cohesion effects, when a network connecting sample individuals is available in a regression problem. In the future, other commonly used statistical models will be added, such as gaussian graphical model. License GPL (>= 2) Depends methods,matrix Imports Rcpp (>= 0.11.5) LinkingTo Rcpp,RcppArmadillo NeedsCompilation yes Repository CRAN Date/Publication 2016-05-02 13:21:13 R topics documented: netcoh-package....................................... 2 predict.rncreg........................................ 2 rncreg............................................ 4 rncreg-class......................................... 7 rncregpath.......................................... 8 Index 11 1

2 predict.rncreg netcoh-package Statistical models with network cohesion. Description Details The package provides the methods to build a class of statistical models on networks with network cohesion effects being taken into consideration. Package: netcoh Type: Package Version: 0.2 Date: 2016-04-29 License: GPL (>= 2) The major function rncreg accepts A network adjacency matrix, X design matrix and response Y for regression models and then produces the fitted modelfor the tuning parameter lambda. Another function predict.rncreg accepts the model fitted by rncreg and the full design matrix as well as the full adjacency matrix (with both training and test data). Author(s) Tianxi Li, Elizaveta Levina, Ji Zhu Maintainer: Tianxi Li <tianxili@umich.edu> References Tianxi Li, Elizaveta Levina and Ji Zhu. (2016) Regression with network cohesion, http://arxiv. org/pdf/1602.01192v1.pdf predict.rncreg make predictions from a "rncreg" object. Description Usage The generic prediction function that makes predictions according an "rncreg" object, which is a regression model fitted with network cohesion. ## S3 method for class rncreg predict(object,full.x=null,full.a,...)

predict.rncreg 3 Arguments object full.x full.a An object returned by the function rncreg. A matrix with first n rows being the original training covariates and the last m rows being the new test covariates. If not provided, covariates will not be used in prediction. An adjacency matrix of the complete network with both training and test samples. The first n vertices are representing the training samples (in the original order) and the last m vertices are reprenting the test samples.... further arguments passed to or from other methods. Details The function first predicts individual effects on test sample by minimizing network cohesion penalty and then incorporates the covariate effects. For full details, please check the reference paper. The predicted test sample individual effects will be returned, as well as the corresponding linear terms. For linear regression model, the predicted response y is also given, which is exactly the same as the linear term. For logistic regression, the predicted probability is also given. Value A list with following slots: terms alpha y p model the linear term in the model. the predicted individual effects. the predicted responses in linear model. the predicted probabilities in logistic regression. the model used in prediction. This is the same as in object. Author(s) Tianxi Li, Elizaveta Levina, Ji Zhu Maintainer: Tianxi Li <tianxili@umich.edu> References Tianxi Li, Elizaveta Levina and Ji Zhu. (2016) Regression with network cohesion, http://arxiv. org/pdf/1602.01192v1.pdf See Also rncreg

4 rncreg Examples set.seed(100) A <- matrix(0,200,200) A[1:100,1:100] <- 1 A[101:200,101:200] <- 1 diag(a) <- 0 alpha <- c(rep(1,100),rep(-1,100)) + rnorm(200)*0.5 A <- A[c(1:50,101:150,51:100,151:200),c(1:50,101:150,51:100,151:200)] alpha <- alpha[c(1:50,101:150,51:100,151:200)] beta <- rnorm(2) X <- matrix(rnorm(400),ncol=2) Y <- X A1 <- A[1:100,1:100] X1 <- X[1:100,] Y1 <- matrix(y[1:100],ncol=1) ## If one wants to regularize the Laplacian by ## using gamma > 0 in rncreg, we suggest use ## centered data. #mean.x <- colmeans(x1) #mean.y <- mean(y1) #Y1 <- Y1-mean.y #X1 <- t(t(x1)-mean.x) #Y <- Y-mean.y #X <- t(t(x)-mean.x) m <- rncreg(a=a1,x=x1,y=y1,model="linear",lambda=10,gamma=0,cv=5) p <- predict(m,full.a=a,full.x=x) rncreg Fits a regression model with network cohesion effects. Description fits a regression model such that each samples are following a different regression curve such that connected individuals in a network tend to have similar curves. The function currently fits linear, logistic and Cox s regression model.

rncreg 5 Usage rncreg(a,lambda,y=null,x=null,dt=null,gamma=0.05, model=c("linear","logistic","cox"), max.iter=50,tol=1e-4, init=null, cv=null,cv.seed=999,low.dim=null,verbose=false) Arguments A lambda Y X dt gamma model max.iter tol init cv cv.seed low.dim verbose An nxn symmetric adjacency matrix for the network. Tuning parameter for the cohesion penalty. An nx1 matrix of response, if the model to fit is linear or logistic. It will not be used if one fits Cox s model. An nxp covariate matrix with each row being the covariates for one individual. If one want to fits a model without using any covariate, it can be empty. Only used to fit Cox s model. An nx2 data.frame such that the first column is the observed time while the second column is the event indicator which is 1 for truely observed events and 0 for censored events. The amount of diagonal regularization added to graph Laplacian. Can only be one of "linear", "logistic" or "cox". The maximum number of newton steps to iterate. Only used for logistic model or Cox s model. The tolerance level for convergence. Only used for logistic model or Cox s model. The initial point for newton algoritm. It should be an (n+p)x1 matrix that stacks alpha and beta. Only used for logistic model or Cox s model. If not specified, zeros will be used. Number of folds for cross-validation. If unspecified, then no cross-validation will be done. Random number generator seed for cross-validation. Only used for linear model. If the probelm is a low dimensional problem such that n»p, then using low.dim=true is potentially faster. If TRUE, the log likelihood in each newton step will be printed. Only used for logistic model and Cox s model. Details The function solves maxl(α, β) λα T Lα. With a proper choice of L function according to the specific model. When the model is linear regression, L is the negative squared error (or gaussian kernel); when the model is logistic regression, L is the binomial log likelihood; when the model is Cox s model, L is the log partial likelihood. gamma is used to regularize the graph Laplacian and is potentially helpful for numerical stability and Cox s model identifiability. Notice that having a positive gamma tends to shrink individual effects to zeros. Thus in linear regression, we suggest first center the data (both predictors and response) before fitting the model. For full details, please check the reference paper.

6 rncreg Value An object from class rncreg will be returned. Author(s) Tianxi Li, Elizaveta Levina, Ji Zhu Maintainer: Tianxi Li <tianxili@umich.edu> References Tianxi Li, Elizaveta Levina and Ji Zhu. (2016) Regression with network cohesion, http://arxiv. org/pdf/1602.01192v1.pdf See Also rncreg,predict.rncreg Examples set.seed(100) A <- matrix(0,200,200) A[1:100,1:100] <- 1 A[101:200,101:200] <- 1 diag(a) <- 0 alpha <- c(rep(1,100),rep(-1,100)) + rnorm(200)*0.5 A <- A[c(1:50,101:150,51:100,151:200),c(1:50,101:150,51:100,151:200)] alpha <- alpha[c(1:50,101:150,51:100,151:200)] beta <- rnorm(2) X <- matrix(rnorm(400),ncol=2) Y <- X delta <- Y delta[y>0] <- 1 delta[y<=0] <- 0 A1 <- A[1:100,1:100] X1 <- X[1:100,] Y1 <- matrix(y[1:100],ncol=1) delta1 <- matrix(delta[1:100],ncol=1) ## If one wants to regularize the Laplacian ## by using gamma > 0 in rncreg, ## we suggest use centered data. #mean.x <- colmeans(x1) #mean.y <- mean(y1) #Y1 <- Y1-mean.y

rncreg-class 7 #X1 <- t(t(x1)-mean.x) #Y <- Y-mean.y #X <- t(t(x)-mean.x) m <- rncreg(a=a1,x=x1,y=y1,model="linear",lambda=10,gamma=0,cv=5) p <- predict(m,full.a=a,full.x=x) #m <- rncreg(a=a1,x=x1,y=y1,model="logistic",lambda=10,gamma=0.01,cv=5) #m <- rncreg(a=a1,x=x1,dt=data.frame(y=y1,delta=delta1),model="cox",lambda=10,gamma=0.01,cv=5) rncreg-class Class "rncreg" Description A generic class for regression objects with network cohesion. Objects from the Class Slots Objects can be created by calls of the form new("rncreg",...). alpha: The individual effects of the regression. beta: The fixed effects or covariate coefficients of the regression. A: The network adjacency matrix for which cohession is assumed. lambda: Parameter for cohesion penalty. X: Covariate matrix. Y: Response matrix. dt: The response data frame with the first column being the observed time and the second column being the event indicator. gamma: Regularization parameter for graph Laplacian. cv: Number of folds in cross-validation. cv.loss: Cross-validated prediciton loss. It is MSE for linear regression, binomial deviance for logistic regression and test partial loglikelihood for Cox s model (see reference paper). cv.sd: Standard deviation of cross-validation loss. It can be used for cross-validation by 1 sigma rule. It is more robust to noises. model: The specific regression model used. Methods No methods defined with class "rncreg" in the signature.

8 rncregpath Author(s) Tianxi Li, Elizaveta Levina, Ji Zhu Maintainer: Tianxi Li <tianxili@umich.edu> References Tianxi Li, Elizaveta Levina and Ji Zhu. (2016) Regression with network cohesion, http://arxiv. org/pdf/1602.01192v1.pdf Verweij, Pierre JM, and Hans C. Van Houwelingen. (1993) Cross-validation in survival analysis, Statistics in medicine 12, no. 24: 2305-2314. See Also rncreg rncregpath Fits regression models with network cohesion effects for a sequence of cohesion levels. Description Fits models by rncreg for a sequence of lambda values. Usage rncregpath(a,lambdaseq,y=null,x=null,dt=null,gamma=0.05, model=c("linear","logistic","cox"), max.iter=50,tol=1e-4, init=null, cv=null,cv.seed=999,low.dim=null,verbose=false) Arguments A lambdaseq Y X dt gamma model max.iter An nxn symmetric adjacency matrix for the network. A vector of lambda values. An nx1 matrix of response, if the model to fit is linear or logistic. It will not be used if one fits Cox s model. An nxp covariate matrix with each row being the covariates for one individual. If one want to fits a model without using any covariate, it can be empty. Only used to fit Cox s model. An nx2 data.frame such that the first column is the observed time while the second column is the event indicator which is 1 for truely observed events and 0 for censored events. The amount of diagonal regularization added to graph Laplacian. Can only be one of "linear", "logistic" or "cox". The maximum number of newton steps to iterate. Only used for logistic model or Cox s model.

rncregpath 9 tol init cv cv.seed low.dim verbose The tolerance level for convergence. Only used for logistic model or Cox s model. The initial point for newton algoritm. It should be an (n+p)x1 matrix that stacks alpha and beta. Only used for logistic model or Cox s model. If not specified, zeros will be used. Number of folds for cross-validation. If unspecified, then no cross-validation will be done. Random number generator seed for cross-validation. Only used for linear model. If the probelm is a low dimensional problem such that n»p, then using low.dim=true is potentially faster. If TRUE, the log likelihood in each newton step will be printed. Only used for logistic model and Cox s model. Details The function repeatly calls rncreg for the values of lambda. Value A list will be returned with the following slots: models cv.seq cv.sd cv.min.index cv.1sd.index A list of objects from rncreg class, each of which corresponds to a specific lambda value in lambdaseq. The sequence of cross-validation loss corresponding to lambdaseq. The sequence of corssivalidation standard deviation The index of model that corresponds to the one with miminum cv loss. The index of model that corresponds to the one selected by 1 sigma rule. Author(s) Tianxi Li, Elizaveta Levina, Ji Zhu Maintainer: Tianxi Li <tianxili@umich.edu> References Tianxi Li, Elizaveta Levina and Ji Zhu. (2016) Regression with network cohesion, http://arxiv. org/pdf/1602.01192v1.pdf See Also rncreg,predict.rncreg

10 rncregpath Examples set.seed(100) A <- matrix(0,200,200) A[1:100,1:100] <- 1 A[101:200,101:200] <- 1 diag(a) <- 0 alpha <- c(rep(1,100),rep(-1,100)) + rnorm(200)*0.5 A <- A[c(1:50,101:150,51:100,151:200),c(1:50,101:150,51:100,151:200)] alpha <- alpha[c(1:50,101:150,51:100,151:200)] beta <- rnorm(2) X <- matrix(rnorm(400),ncol=2) Y <- X A1 <- A[1:100,1:100] X1 <- X[1:100,] Y1 <- matrix(y[1:100],ncol=1) ## If one wants to regularize the Laplacian ## by using gamma > 0 in rncreg, ## we suggest use centered data. #mean.x <- colmeans(x1) #mean.y <- mean(y1) #Y1 <- Y1-mean.y #X1 <- t(t(x1)-mean.x) #Y <- Y-mean.y #X <- t(t(x)-mean.x) m.list <- rncregpath(a=a1,x=x1,y=y1,model="linear", lambdaseq=exp(seq(0,log(200),length.out=20)),gamma=0,cv=5) m.list$cv.seq

Index Topic classes rncreg-class, 7 Topic models netcoh-package, 2 predict.rncreg, 2 rncreg, 4 rncregpath, 8 Topic networks predict.rncreg, 2 rncreg, 4 rncregpath, 8 Topic network netcoh-package, 2 Topic package netcoh-package, 2 Topic regression netcoh-package, 2 predict.rncreg, 2 rncreg, 4 rncregpath, 8 netcoh (netcoh-package), 2 netcoh-package, 2 predict.rncreg, 2 rncreg, 4 rncreg-class, 7 rncregpath, 8 11