Commit 11277c2a authored by Armin Rauschenberger's avatar Armin Rauschenberger
Browse files

extension

parent 0b889801
......@@ -74,7 +74,7 @@ the coefficients from the base learners.)" />
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.7</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.8</span>
</span>
</div>
......@@ -99,13 +99,13 @@ the coefficients from the base learners.)" />
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span>
<span class="fas fa-github"></span>
</a>
</li>
<li>
<a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span>
<span class="fas fa-download"></span>
</a>
</li>
......@@ -134,7 +134,7 @@ the coefficients from the base learners.)</p>
</div>
<pre class="usage"><span class='co'># S3 method for joinet</span>
<span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span>(<span class='no'>object</span>, <span class='no'>...</span>)</pre>
<span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
......@@ -159,18 +159,20 @@ in a matrix with \(p\) rows (inputs) and \(q\) columns.</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># \dontshow{</span>
<span class='kw'>if</span>(!<span class='fu'><a href='https://rdrr.io/r/base/grep.html'>grepl</a></span>(<span class='st'>'SunOS'</span>,<span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span>()[<span class='st'>'sysname'</span>])){
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</span>; <span class='no'>q</span> <span class='kw'>&lt;-</span> <span class='fl'>3</span>
<span class='no'>X</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span>(<span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='no'>n</span>*<span class='no'>p</span>),<span class='kw'>nrow</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>ncol</span><span class='kw'>=</span><span class='no'>p</span>)
<span class='no'>Y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>q</span>,<span class='kw'>expr</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>mean</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span>(<span class='no'>X</span>[,<span class='fl'>1</span>:<span class='fl'>5</span>])))
<span class='no'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span>(<span class='kw'>Y</span><span class='kw'>=</span><span class='no'>Y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='no'>coef</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span>(<span class='no'>object</span>)}<span class='co'># }</span>
<span class='kw'>if</span> (<span class='fl'>FALSE</span>) {
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</span>; <span class='no'>q</span> <span class='kw'>&lt;-</span> <span class='fl'>3</span>
<span class='no'>X</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span>(<span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='no'>n</span>*<span class='no'>p</span>),<span class='kw'>nrow</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>ncol</span><span class='kw'>=</span><span class='no'>p</span>)
<span class='no'>Y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>q</span>,<span class='kw'>expr</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>mean</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span>(<span class='no'>X</span>[,<span class='fl'>1</span>:<span class='fl'>5</span>])))
<span class='no'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span>(<span class='kw'>Y</span><span class='kw'>=</span><span class='no'>Y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='no'>coef</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span>(<span class='no'>object</span>)}</div></pre>
<span class='kw'>if</span><span class='op'>(</span><span class='op'>!</span><span class='fu'><a href='https://rdrr.io/r/base/grep.html'>grepl</a></span><span class='op'>(</span><span class='st'>'SunOS'</span>,<span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>[</span><span class='st'>'sysname'</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span><span class='op'>{</span>
<span class='va'>n</span> <span class='op'>&lt;-</span> <span class='fl'>50</span>; <span class='va'>p</span> <span class='op'>&lt;-</span> <span class='fl'>100</span>; <span class='va'>q</span> <span class='op'>&lt;-</span> <span class='fl'>3</span>
<span class='va'>X</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n</span><span class='op'>*</span><span class='va'>p</span><span class='op'>)</span>,nrow<span class='op'>=</span><span class='va'>n</span>,ncol<span class='op'>=</span><span class='va'>p</span><span class='op'>)</span>
<span class='va'>Y</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>q</span>,expr<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>n</span>,mean<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span><span class='op'>(</span><span class='va'>X</span><span class='op'>[</span>,<span class='fl'>1</span><span class='op'>:</span><span class='fl'>5</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>
<span class='va'>object</span> <span class='op'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span><span class='op'>(</span>Y<span class='op'>=</span><span class='va'>Y</span>,X<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='va'>coef</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span><span class='op'>(</span><span class='va'>object</span><span class='op'>)</span><span class='op'>}</span><span class='co'># }</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='cn'>FALSE</span><span class='op'>)</span> <span class='op'>{</span>
<span class='va'>n</span> <span class='op'>&lt;-</span> <span class='fl'>50</span>; <span class='va'>p</span> <span class='op'>&lt;-</span> <span class='fl'>100</span>; <span class='va'>q</span> <span class='op'>&lt;-</span> <span class='fl'>3</span>
<span class='va'>X</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n</span><span class='op'>*</span><span class='va'>p</span><span class='op'>)</span>,nrow<span class='op'>=</span><span class='va'>n</span>,ncol<span class='op'>=</span><span class='va'>p</span><span class='op'>)</span>
<span class='va'>Y</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>q</span>,expr<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>n</span>,mean<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span><span class='op'>(</span><span class='va'>X</span><span class='op'>[</span>,<span class='fl'>1</span><span class='op'>:</span><span class='fl'>5</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>
<span class='va'>object</span> <span class='op'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span><span class='op'>(</span>Y<span class='op'>=</span><span class='va'>Y</span>,X<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='va'>coef</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span><span class='op'>(</span><span class='va'>object</span><span class='op'>)</span><span class='op'>}</span>
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">
......@@ -186,7 +188,7 @@ in a matrix with \(p\) rows (inputs) and \(q\) columns.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
......
......@@ -72,7 +72,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.7</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.8</span>
</span>
</div>
......@@ -97,13 +97,13 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span>
<span class="fas fa-github"></span>
</a>
</li>
<li>
<a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span>
<span class="fas fa-download"></span>
</a>
</li>
......@@ -129,23 +129,23 @@
<p>Compares univariate and multivariate regression.</p>
</div>
<pre class="usage"><span class='fu'>cv.joinet</span>(
<span class='no'>Y</span>,
<span class='no'>X</span>,
<span class='kw'>family</span> <span class='kw'>=</span> <span class='st'>"gaussian"</span>,
<span class='kw'>nfolds.ext</span> <span class='kw'>=</span> <span class='fl'>5</span>,
<span class='kw'>nfolds.int</span> <span class='kw'>=</span> <span class='fl'>10</span>,
<span class='kw'>foldid.ext</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>foldid.int</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>type.measure</span> <span class='kw'>=</span> <span class='st'>"deviance"</span>,
<span class='kw'>alpha.base</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>alpha.meta</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>compare</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>mice</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>cvpred</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='kw'>times</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
<span class='no'>...</span>
)</pre>
<pre class="usage"><span class='fu'>cv.joinet</span><span class='op'>(</span>
<span class='va'>Y</span>,
<span class='va'>X</span>,
family <span class='op'>=</span> <span class='st'>"gaussian"</span>,
nfolds.ext <span class='op'>=</span> <span class='fl'>5</span>,
nfolds.int <span class='op'>=</span> <span class='fl'>10</span>,
foldid.ext <span class='op'>=</span> <span class='cn'>NULL</span>,
foldid.int <span class='op'>=</span> <span class='cn'>NULL</span>,
type.measure <span class='op'>=</span> <span class='st'>"deviance"</span>,
alpha.base <span class='op'>=</span> <span class='fl'>1</span>,
alpha.meta <span class='op'>=</span> <span class='fl'>1</span>,
compare <span class='op'>=</span> <span class='cn'>FALSE</span>,
mice <span class='op'>=</span> <span class='cn'>FALSE</span>,
cvpred <span class='op'>=</span> <span class='cn'>FALSE</span>,
times <span class='op'>=</span> <span class='cn'>FALSE</span>,
<span class='va'>...</span>
<span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
......@@ -154,8 +154,7 @@
<th>Y</th>
<td><p>outputs<strong>:</strong>
numeric matrix with \(n\) rows (samples)
and \(q\) columns (variables),
with positive correlation (see details)</p></td>
and \(q\) columns (variables)</p></td>
</tr>
<tr>
<th>X</th>
......@@ -196,7 +195,7 @@ or <code>NULL</code></p></td>
<td><p>loss function<strong>:</strong>
vector of length \(1\) or \(q\) with entries
<code>"deviance"</code>, <code>"class"</code>, <code>"mse"</code> or <code>"mae"</code>
(see <code><a href='https://rdrr.io/pkg/glmnet/man/cv.glmnet.html'>cv.glmnet</a></code>)</p></td>
(see <code><a href='https://glmnet.stanford.edu/reference/cv.glmnet.html'>cv.glmnet</a></code>)</p></td>
</tr>
<tr>
<th>alpha.base</th>
......@@ -205,7 +204,7 @@ numeric between \(0\) (ridge) and \(1\) (lasso)</p></td>
</tr>
<tr>
<th>alpha.meta</th>
<td><p>elastic net mixing parameter for meta learner<strong>:</strong>
<td><p>elastic net mixing parameter for meta learners<strong>:</strong>
numeric between \(0\) (ridge) and \(1\) (lasso)</p></td>
</tr>
<tr>
......@@ -231,8 +230,8 @@ logical</p></td>
</tr>
<tr>
<th>...</th>
<td><p>further arguments passed to <code><a href='https://rdrr.io/pkg/glmnet/man/glmnet.html'>glmnet</a></code>
and <code><a href='https://rdrr.io/pkg/glmnet/man/cv.glmnet.html'>cv.glmnet</a></code></p></td>
<td><p>further arguments passed to <code><a href='https://glmnet.stanford.edu/reference/glmnet.html'>glmnet</a></code>
and <code><a href='https://glmnet.stanford.edu/reference/cv.glmnet.html'>cv.glmnet</a></code></p></td>
</tr>
</table>
......@@ -260,7 +259,7 @@ and the intercept-only models (<code>none</code>).</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
......
......@@ -71,7 +71,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.7</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.8</span>
</span>
</div>
......@@ -96,13 +96,13 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span>
<span class="fas fa-github"></span>
</a>
</li>
<li>
<a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span>
<span class="fas fa-download"></span>
</a>
</li>
......@@ -197,7 +197,7 @@
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
......
......@@ -77,7 +77,7 @@ in high-dimensional settings." />
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.7</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.8</span>
</span>
</div>
......@@ -102,13 +102,13 @@ in high-dimensional settings." />
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span>
<span class="fas fa-github"></span>
</a>
</li>
<li>
<a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span>
<span class="fas fa-download"></span>
</a>
</li>
......@@ -144,7 +144,7 @@ in high-dimensional settings.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Use function <code><a href='joinet.html'>joinet</a></code> for model fitting.
Type <code><a href='https://rdrr.io/pkg/joinet/man'>library(joinet)</a></code> and then <code><a href='joinet.html'>?joinet</a></code> or
Type <code><a href='https://github.com/rauschenberger/joinet'>library(joinet)</a></code> and then <code><a href='joinet.html'>?joinet</a></code> or
<code>help("joinet)"</code> to open its help file.</p>
<p>See the vignette for further examples.
Type <code><a href='../articles/joinet.html'>vignette("joinet")</a></code> or <code><a href='https://rdrr.io/r/utils/browseVignettes.html'>browseVignettes("joinet")</a></code>
......@@ -158,64 +158,66 @@ to open the vignette.</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># \dontshow{</span>
<span class='kw'>if</span>(!<span class='fu'><a href='https://rdrr.io/r/base/grep.html'>grepl</a></span>(<span class='st'>'SunOS'</span>,<span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span>()[<span class='st'>'sysname'</span>])){
<span class='kw'>if</span><span class='op'>(</span><span class='op'>!</span><span class='fu'><a href='https://rdrr.io/r/base/grep.html'>grepl</a></span><span class='op'>(</span><span class='st'>'SunOS'</span>,<span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>[</span><span class='st'>'sysname'</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span><span class='op'>{</span>
<span class='co'>#--- data simulation ---</span>
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</span>; <span class='no'>q</span> <span class='kw'>&lt;-</span> <span class='fl'>3</span>
<span class='no'>X</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span>(<span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='no'>n</span>*<span class='no'>p</span>),<span class='kw'>nrow</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>ncol</span><span class='kw'>=</span><span class='no'>p</span>)
<span class='no'>Y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>q</span>,<span class='kw'>expr</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>mean</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span>(<span class='no'>X</span>[,<span class='fl'>1</span>:<span class='fl'>5</span>])))
<span class='va'>n</span> <span class='op'>&lt;-</span> <span class='fl'>50</span>; <span class='va'>p</span> <span class='op'>&lt;-</span> <span class='fl'>100</span>; <span class='va'>q</span> <span class='op'>&lt;-</span> <span class='fl'>3</span>
<span class='va'>X</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n</span><span class='op'>*</span><span class='va'>p</span><span class='op'>)</span>,nrow<span class='op'>=</span><span class='va'>n</span>,ncol<span class='op'>=</span><span class='va'>p</span><span class='op'>)</span>
<span class='va'>Y</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>q</span>,expr<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>n</span>,mean<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span><span class='op'>(</span><span class='va'>X</span><span class='op'>[</span>,<span class='fl'>1</span><span class='op'>:</span><span class='fl'>5</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>
<span class='co'># n samples, p inputs, q outputs</span>
<span class='co'>#--- model fitting ---</span>
<span class='no'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span>(<span class='kw'>Y</span><span class='kw'>=</span><span class='no'>Y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='va'>object</span> <span class='op'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span><span class='op'>(</span>Y<span class='op'>=</span><span class='va'>Y</span>,X<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='co'># slot "base": univariate</span>
<span class='co'># slot "meta": multivariate</span>
<span class='co'>#--- make predictions ---</span>
<span class='no'>y_hat</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/predict.html'>predict</a></span>(<span class='no'>object</span>,<span class='kw'>newx</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='va'>y_hat</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/predict.html'>predict</a></span><span class='op'>(</span><span class='va'>object</span>,newx<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='co'># n x q matrix "base": univariate</span>
<span class='co'># n x q matrix "meta": multivariate </span>
<span class='co'>#--- extract coefficients ---</span>
<span class='no'>coef</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span>(<span class='no'>object</span>)
<span class='va'>coef</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span><span class='op'>(</span><span class='va'>object</span><span class='op'>)</span>
<span class='co'># effects of inputs on outputs</span>
<span class='co'># q vector "alpha": intercepts</span>
<span class='co'># p x q matrix "beta": slopes</span>
<span class='co'>#--- model comparison ---</span>
<span class='no'>loss</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='cv.joinet.html'>cv.joinet</a></span>(<span class='kw'>Y</span><span class='kw'>=</span><span class='no'>Y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='va'>loss</span> <span class='op'>&lt;-</span> <span class='fu'><a href='cv.joinet.html'>cv.joinet</a></span><span class='op'>(</span>Y<span class='op'>=</span><span class='va'>Y</span>,X<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='co'># cross-validated loss</span>
<span class='co'># row "base": univariate</span>
<span class='co'># row "meta": multivariate</span>
}<span class='co'># }</span>
<span class='kw'>if</span> (<span class='fl'>FALSE</span>) {
<span class='op'>}</span><span class='co'># }</span>
<span class='kw'>if</span> <span class='op'>(</span><span class='cn'>FALSE</span><span class='op'>)</span> <span class='op'>{</span>
<span class='co'>#--- data simulation ---</span>
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</span>; <span class='no'>q</span> <span class='kw'>&lt;-</span> <span class='fl'>3</span>
<span class='no'>X</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span>(<span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='no'>n</span>*<span class='no'>p</span>),<span class='kw'>nrow</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>ncol</span><span class='kw'>=</span><span class='no'>p</span>)
<span class='no'>Y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>q</span>,<span class='kw'>expr</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>mean</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span>(<span class='no'>X</span>[,<span class='fl'>1</span>:<span class='fl'>5</span>])))
<span class='va'>n</span> <span class='op'>&lt;-</span> <span class='fl'>50</span>; <span class='va'>p</span> <span class='op'>&lt;-</span> <span class='fl'>100</span>; <span class='va'>q</span> <span class='op'>&lt;-</span> <span class='fl'>3</span>
<span class='va'>X</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n</span><span class='op'>*</span><span class='va'>p</span><span class='op'>)</span>,nrow<span class='op'>=</span><span class='va'>n</span>,ncol<span class='op'>=</span><span class='va'>p</span><span class='op'>)</span>
<span class='va'>Y</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>q</span>,expr<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span>n<span class='op'>=</span><span class='va'>n</span>,mean<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span><span class='op'>(</span><span class='va'>X</span><span class='op'>[</span>,<span class='fl'>1</span><span class='op'>:</span><span class='fl'>5</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>
<span class='co'># n samples, p inputs, q outputs</span>
<span class='co'>#--- model fitting ---</span>
<span class='no'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span>(<span class='kw'>Y</span><span class='kw'>=</span><span class='no'>Y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='va'>object</span> <span class='op'>&lt;-</span> <span class='fu'><a href='joinet.html'>joinet</a></span><span class='op'>(</span>Y<span class='op'>=</span><span class='va'>Y</span>,X<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='co'># slot "base": univariate</span>
<span class='co'># slot "meta": multivariate</span>
<span class='co'>#--- make predictions ---</span>
<span class='no'>y_hat</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/predict.html'>predict</a></span>(<span class='no'>object</span>,<span class='kw'>newx</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='va'>y_hat</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/predict.html'>predict</a></span><span class='op'>(</span><span class='va'>object</span>,newx<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='co'># n x q matrix "base": univariate</span>
<span class='co'># n x q matrix "meta": multivariate </span>
<span class='co'>#--- extract coefficients ---</span>
<span class='no'>coef</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span>(<span class='no'>object</span>)
<span class='va'>coef</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/coef.html'>coef</a></span><span class='op'>(</span><span class='va'>object</span><span class='op'>)</span>
<span class='co'># effects of inputs on outputs</span>
<span class='co'># q vector "alpha": intercepts</span>
<span class='co'># p x q matrix "beta": slopes</span>
<span class='co'>#--- model comparison ---</span>
<span class='no'>loss</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='cv.joinet.html'>cv.joinet</a></span>(<span class='kw'>Y</span><span class='kw'>=</span><span class='no'>Y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)
<span class='va'>loss</span> <span class='op'>&lt;-</span> <span class='fu'><a href='cv.joinet.html'>cv.joinet</a></span><span class='op'>(</span>Y<span class='op'>=</span><span class='va'>Y</span>,X<span class='op'>=</span><span class='va'>X</span><span class='op'>)</span>
<span class='co'># cross-validated loss</span>
<span class='co'># row "base": univariate</span>
<span class='co'># row "meta": multivariate</span>
}</div></pre>
<span class='op'>}</span>
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">
......@@ -231,7 +233,7 @@ to open the vignette.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
......
......@@ -72,7 +72,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.7</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.8</span>
</span>
</div>
......@@ -97,13 +97,13 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span>
<span class="fas fa-github"></span>
</a>
</li>
<li>
<a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span>
<span class="fas fa-download"></span>
</a>
</li>
......@@ -129,17 +129,19 @@
<p>Implements multivariate elastic net regression.</p>
</div>
<pre class="usage"><span class='fu'>joinet</span>(
<span class='no'>Y</span>,
<span class='no'>X</span>,
<span class='kw'>family</span> <span class='kw'>=</span> <span class='st'>"gaussian"</span>,
<span class='kw'>nfolds</span> <span class='kw'>=</span> <span class='fl'>10</span>,
<span class='kw'>foldid</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
<span class='kw'>type.measure</span> <span class='kw'>=</span> <span class='st'>"deviance"</span>,
<span class='kw'>alpha.base</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='kw'>alpha.meta</span> <span class='kw'>=</span> <span class='fl'>1</span>,
<span class='no'>...</span>
)</pre>
<pre class="usage"><span class='fu'>joinet</span><span class='op'>(</span>
<span class='va'>Y</span>,
<span class='va'>X</span>,
family <span class='op'>=</span> <span class='st'>"gaussian"</span>,
nfolds <span class='op'>=</span> <span class='fl'>10</span>,
foldid <span class='op'>=</span> <span class='cn'>NULL</span>,
type.measure <span class='op'>=</span> <span class='st'>"deviance"</span>,
alpha.base <span class='op'>=</span> <span class='fl'>1</span>,
alpha.meta <span class='op'>=</span> <span class='fl'>1</span>,
constraint <span class='op'>=</span> <span class='cn'>TRUE</span>,
weight <span class='op'>=</span> <span class='cn'>NULL</span>,
<span class='va'>...</span>
<span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
......@@ -148,8 +150,7 @@
<th>Y</th>
<td><p>outputs<strong>:</strong>
numeric matrix with \(n\) rows (samples)
and \(q\) columns (variables),
with positive correlation (see details)</p></td>
and \(q\) columns (variables)</p></td>
</tr>
<tr>
<th>X</th>
......@@ -178,7 +179,7 @@ or <code>NULL</code> (balance)</p></td>
<td><p>loss function<strong>:</strong>
vector of length \(1\) or \(q\) with entries
<code>"deviance"</code>, <code>"class"</code>, <code>"mse"</code> or <code>"mae"</code>
(see <code><a href='https://rdrr.io/pkg/glmnet/man/cv.glmnet.html'>cv.glmnet</a></code>)</p></td>
(see <code><a href='https://glmnet.stanford.edu/reference/cv.glmnet.html'>cv.glmnet</a></code>)</p></td>
</tr>
<tr>
<th>alpha.base</th>
......@@ -187,12 +188,23 @@ numeric between \(0\) (ridge) and \(1\) (lasso)</p></td>
</tr>
<tr>
<th>alpha.meta</th>
<td><p>elastic net mixing parameter for meta learner<strong>:</strong>
<td><p>elastic net mixing parameter for meta learners<strong>:</strong>
numeric between \(0\) (ridge) and \(1\) (lasso)</p></td>
</tr>
<tr>
<th>constraint</th>
<td><p>non-negativity constraints<strong>:</strong>
logical (see details)</p></td>
</tr>
<tr>
<th>weight</th>
<td><p>inclusion/exclusion of variables<strong>:</strong>
logical matrix with \(q\) rows and \(p\) columns,
or <code>NULL</code> (see details)</p></td>
</tr>
<tr>
<th>...</th>
<td><p>further arguments passed to <code><a href='https://rdrr.io/pkg/glmnet/man/glmnet.html'>glmnet</a></code></p></td>
<td><p>further arguments passed to <code><a href='https://glmnet.stanford.edu/reference/glmnet.html'>glmnet</a></code></p></td>
</tr>
</table>
......@@ -204,12 +216,21 @@ Available methods include
<code><a href='coef.joinet.html'>coef</a></code>,
and <code><a href='weights.joinet.html'>weights</a></code>.
The slots <code>base</code> and <code>meta</code> each contain
\(q\) <code><a href='https://rdrr.io/pkg/glmnet/man/cv.glmnet.html'>cv.glmnet</a></code>-like objects.</p>
\(q\) <code><a href='https://glmnet.stanford.edu/reference/cv.glmnet.html'>cv.glmnet</a></code>-like objects.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>correlation:</strong>
The \(q\) outcomes should be positively correlated.
Avoid negative correlations by changing the sign of the variable.</p>
<p><strong>non-negativity constraints:</strong>
If it is reasonable to assume that the outcomes
are <em>positively</em> correlated
(potentially after changing the sign of some outcomes)
we recommend to set <code>constraint=TRUE</code>.
Then non-negativity constraints are imposed on the meta learner.</p>
<p><strong>inclusion/exclusion of variables:</strong>
The entry in the \(j\)th column and the \(k\)th row
indicates whether the \(j\)th feature may be used for
modelling the \(k\)th outcome
(where \(0\) means <code>FALSE</code> and
\(1\) means <code>TRUE</code>).</p>
<p><strong>elastic net:</strong>
<code>alpha.base</code> controls input-output effects,
<code>alpha.meta</code> controls output-output effects;
......@@ -217,7 +238,7 @@ lasso renders sparse models (<code>alpha</code>\(=1\)),
ridge renders dense models (<code>alpha</code>\(=0\))</p>
<h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>
<p>Armin Rauschenberger, Enrico Glaab (2020)
<p>Armin Rauschenberger, Enrico Glaab (2021)
"Predicting correlated outcomes from molecular data"
<em>Manuscript in preparation</em>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
......@@ -241,7 +262,7 @@ ridge renders dense models (<code>alpha</code>\(=0\))</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
......
......@@ -72,7 +72,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.7</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.8</span>
</span>
</div>
......@@ -97,13 +97,13 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span>
<span class="fas fa-github"></span>
</a>
</li>
<li>
<a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span>
<span class="fas fa-download"></span>
</a>
</li>
......@@ -130,7 +130,7 @@
</div>
<pre class="usage"><span class='co'># S3 method for joinet</span>
<span class='fu'><a href='https://rdrr.io/r/stats/predict.html'>predict</a></span>(<span class='no'>object</span>, <span class='no'>newx</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"response"</span>, <span class='no'>...</span>)</pre>
<span class='fu'><a href='https://rdrr.io/r/stats/predict.html'>predict</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>newx</span>, type <span class='op'>=</span> <span class='st'>"response"</span>, <span class='va'>...</span><span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
......@@ -163,13 +163,14 @@ with \(n\) rows (samples) and \(q\) columns (variables).</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># \dontshow{</span>
<span class='kw'>if</span>(!<span class='fu'><a href='https://rdrr.io/r/base/grep.html'>grepl</a></span>(<span class='st'>'SunOS'</span>,<span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span>()[<span class='st'>'sysname'</span>])){
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</span>; <span class='no'>q</span> <span class='kw'>&lt;-</span> <span class='fl'>3</span>
<span class='no'>X</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span>(<span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='no'>n</span>*<span class='no'>p</span>),<span class='kw'>nrow</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>ncol</span><span class='kw'>=</span><span class='no'>p</span>)
<span class='no'>Y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>replicate</a></span>(<span class='kw'>n