joinet.Rd 2.58 KB
Newer Older
Armin Rauschenberger's avatar
Armin Rauschenberger committed
1 2
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
Armin Rauschenberger's avatar
Armin Rauschenberger committed
3 4
\name{joinet}
\alias{joinet}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
5 6
\title{Multivariate Elastic Net Regression}
\usage{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
7 8 9 10 11 12 13 14
joinet(
  Y,
  X,
  family = "gaussian",
  nfolds = 10,
  foldid = NULL,
  type.measure = "deviance",
  alpha.base = 1,
Armin Rauschenberger's avatar
Armin Rauschenberger committed
15
  alpha.meta = 1,
Armin Rauschenberger's avatar
Armin Rauschenberger committed
16 17
  ...
)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
}
\arguments{
\item{Y}{outputs\strong{:}
numeric matrix with \eqn{n} rows (samples)
and \eqn{q} columns (variables),
with positive correlation (see details)}

\item{X}{inputs\strong{:}
numeric matrix with \eqn{n} rows (samples)
and \eqn{p} columns (variables)}

\item{family}{distribution\strong{:}
vector of length \eqn{1} or \eqn{q} with entries
\code{"gaussian"}, \code{"binomial"} or \code{"poisson"}}

\item{nfolds}{number of folds}

\item{foldid}{fold identifiers\strong{:}
vector of length \eqn{n} with entries between \eqn{1} and \code{nfolds};
or \code{NULL} (balance)}

\item{type.measure}{loss function\strong{:}
vector of length \eqn{1} or \eqn{q} with entries
\code{"deviance"}, \code{"class"}, \code{"mse"} or \code{"mae"}
(see \code{\link[glmnet]{cv.glmnet}})}

\item{alpha.base}{elastic net mixing parameter for base learners\strong{:}
numeric between \eqn{0} (ridge) and \eqn{1} (lasso)}

\item{alpha.meta}{elastic net mixing parameter for meta learner\strong{:}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
48
numeric between \eqn{0} (ridge) and \eqn{1} (lasso)}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
49 50 51

\item{...}{further arguments passed to \code{\link[glmnet]{glmnet}}}
}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
52 53 54 55 56 57 58 59 60
\value{
This function returns an object of class \code{joinet}.
Available methods include
\code{\link[=predict.joinet]{predict}},
\code{\link[=coef.joinet]{coef}},
and \code{\link[=weights.joinet]{weights}}.
The slots \code{base} and \code{meta} each contain
\eqn{q} \code{\link[glmnet]{cv.glmnet}}-like objects.
}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
61 62 63 64
\description{
Implements multivariate elastic net regression.
}
\details{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
65
\strong{correlation:}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
66 67
The \eqn{q} outcomes should be positively correlated.
Avoid negative correlations by changing the sign of the variable.
Armin Rauschenberger's avatar
Armin Rauschenberger committed
68

Armin Rauschenberger's avatar
Armin Rauschenberger committed
69
\strong{elastic net:}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
70 71
\code{alpha.base} controls input-output effects,
\code{alpha.meta} controls output-output effects;
Armin Rauschenberger's avatar
Armin Rauschenberger committed
72 73
lasso renders sparse models (\code{alpha}\eqn{=1}),
ridge renders dense models (\code{alpha}\eqn{=0})
Armin Rauschenberger's avatar
Armin Rauschenberger committed
74 75
}
\examples{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
76 77
#if(!grepl('SunOS',Sys.info()['sysname'])){
set.seed(1)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
78
n <- 50; p <- 100; q <- 3
Armin Rauschenberger's avatar
Armin Rauschenberger committed
79
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
80
Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5])))
Armin Rauschenberger's avatar
Armin Rauschenberger committed
81
object <- joinet(Y=Y,X=X)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
82
#}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
83

Armin Rauschenberger's avatar
Armin Rauschenberger committed
84 85 86
\dontrun{
browseVignettes("joinet") # further examples}

Armin Rauschenberger's avatar
Armin Rauschenberger committed
87 88
}
\references{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
89 90
Armin Rauschenberger, Enrico Glaab (2020)
"Predicting correlated outcomes from molecular data"
Armin Rauschenberger's avatar
Armin Rauschenberger committed
91
\emph{Manuscript in preparation}.
Armin Rauschenberger's avatar
Armin Rauschenberger committed
92
}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
93
\seealso{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
94
\code{\link{cv.joinet}}, vignette
Armin Rauschenberger's avatar
Armin Rauschenberger committed
95
}