joinet.Rd 2.43 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 5
\name{joinet}
\alias{joinet}
\alias{joinet-package}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
6 7
\title{Multivariate Elastic Net Regression}
\usage{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
8
joinet(Y, X, family = "gaussian", nfolds = 10, foldid = NULL,
Armin Rauschenberger's avatar
Armin Rauschenberger committed
9
  type.measure = "deviance", alpha.base = 1, alpha.meta = 0, ...)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
}
\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
40
numeric between \eqn{0} (ridge) and \eqn{1} (lasso)}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
41 42 43

\item{...}{further arguments passed to \code{\link[glmnet]{glmnet}}}
}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
44 45 46 47 48 49 50 51 52
\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
53 54 55 56
\description{
Implements multivariate elastic net regression.
}
\details{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
57
\strong{correlation:}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
58 59
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
60

Armin Rauschenberger's avatar
Armin Rauschenberger committed
61
\strong{elastic net:}
Armin Rauschenberger's avatar
Armin Rauschenberger committed
62 63
\code{alpha.base} controls input-output effects,
\code{alpha.meta} controls output-output effects;
Armin Rauschenberger's avatar
Armin Rauschenberger committed
64 65
lasso renders sparse models (\code{alpha}\eqn{=1}),
ridge renders dense models (\code{alpha}\eqn{=0})
Armin Rauschenberger's avatar
Armin Rauschenberger committed
66 67 68 69 70
}
\examples{
n <- 30; q <- 2; p <- 20
Y <- matrix(rnorm(n*q),nrow=n,ncol=q)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
71
object <- joinet(Y=Y,X=X)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
72 73 74

}
\references{
Armin Rauschenberger's avatar
Armin Rauschenberger committed
75
Armin Rauschenberger, Enrico Glaab (2019)
Armin Rauschenberger's avatar
Armin Rauschenberger committed
76
"Multivariate elastic net regression through stacked generalisation"
Armin Rauschenberger's avatar
Armin Rauschenberger committed
77
\emph{Manuscript in preparation}.
Armin Rauschenberger's avatar
Armin Rauschenberger committed
78
}