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.)" /> ...@@ -74,7 +74,7 @@ the coefficients from the base learners.)" />
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a> <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> </span>
</div> </div>
...@@ -99,13 +99,13 @@ the coefficients from the base learners.)" /> ...@@ -99,13 +99,13 @@ the coefficients from the base learners.)" />
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/rauschenberger/joinet"> <a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span> <span class="fas fa-github"></span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://cran.r-project.org/package=joinet"> <a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span> <span class="fas fa-download"></span>
</a> </a>
</li> </li>
...@@ -134,7 +134,7 @@ the coefficients from the base learners.)</p> ...@@ -134,7 +134,7 @@ the coefficients from the base learners.)</p>
</div> </div>
<pre class="usage"><span class='co'># S3 method for joinet</span> <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> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
...@@ -159,18 +159,20 @@ in a matrix with \(p\) rows (inputs) and \(q\) columns.</p> ...@@ -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> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># \dontshow{</span> <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='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='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='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='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='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'>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='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='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='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='fl'>FALSE</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='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='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='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='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='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'>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='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='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='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>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top"> <nav id="toc" data-toggle="toc" class="sticky-top">
...@@ -186,7 +188,7 @@ in a matrix with \(p\) rows (inputs) and \(q\) columns.</p> ...@@ -186,7 +188,7 @@ in a matrix with \(p\) rows (inputs) and \(q\) columns.</p>
</div> </div>
<div class="pkgdown"> <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> </div>
</footer> </footer>
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a> <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> </span>
</div> </div>
...@@ -97,13 +97,13 @@ ...@@ -97,13 +97,13 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/rauschenberger/joinet"> <a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span> <span class="fas fa-github"></span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://cran.r-project.org/package=joinet"> <a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span> <span class="fas fa-download"></span>
</a> </a>
</li> </li>
...@@ -129,23 +129,23 @@ ...@@ -129,23 +129,23 @@
<p>Compares univariate and multivariate regression.</p> <p>Compares univariate and multivariate regression.</p>
</div> </div>
<pre class="usage"><span class='fu'>cv.joinet</span>( <pre class="usage"><span class='fu'>cv.joinet</span><span class='op'>(</span>
<span class='no'>Y</span>, <span class='va'>Y</span>,
<span class='no'>X</span>, <span class='va'>X</span>,
<span class='kw'>family</span> <span class='kw'>=</span> <span class='st'>"gaussian"</span>, family <span class='op'>=</span> <span class='st'>"gaussian"</span>,
<span class='kw'>nfolds.ext</span> <span class='kw'>=</span> <span class='fl'>5</span>, nfolds.ext <span class='op'>=</span> <span class='fl'>5</span>,
<span class='kw'>nfolds.int</span> <span class='kw'>=</span> <span class='fl'>10</span>, nfolds.int <span class='op'>=</span> <span class='fl'>10</span>,
<span class='kw'>foldid.ext</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, foldid.ext <span class='op'>=</span> <span class='cn'>NULL</span>,
<span class='kw'>foldid.int</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, foldid.int <span class='op'>=</span> <span class='cn'>NULL</span>,
<span class='kw'>type.measure</span> <span class='kw'>=</span> <span class='st'>"deviance"</span>, type.measure <span class='op'>=</span> <span class='st'>"deviance"</span>,
<span class='kw'>alpha.base</span> <span class='kw'>=</span> <span class='fl'>1</span>, alpha.base <span class='op'>=</span> <span class='fl'>1</span>,
<span class='kw'>alpha.meta</span> <span class='kw'>=</span> <span class='fl'>1</span>, alpha.meta <span class='op'>=</span> <span class='fl'>1</span>,
<span class='kw'>compare</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, compare <span class='op'>=</span> <span class='cn'>FALSE</span>,
<span class='kw'>mice</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, mice <span class='op'>=</span> <span class='cn'>FALSE</span>,
<span class='kw'>cvpred</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, cvpred <span class='op'>=</span> <span class='cn'>FALSE</span>,
<span class='kw'>times</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, times <span class='op'>=</span> <span class='cn'>FALSE</span>,
<span class='no'>...</span> <span class='va'>...</span>
)</pre> <span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
...@@ -154,8 +154,7 @@ ...@@ -154,8 +154,7 @@
<th>Y</th> <th>Y</th>
<td><p>outputs<strong>:</strong> <td><p>outputs<strong>:</strong>
numeric matrix with \(n\) rows (samples) numeric matrix with \(n\) rows (samples)
and \(q\) columns (variables), and \(q\) columns (variables)</p></td>
with positive correlation (see details)</p></td>
</tr> </tr>
<tr> <tr>
<th>X</th> <th>X</th>
...@@ -196,7 +195,7 @@ or <code>NULL</code></p></td> ...@@ -196,7 +195,7 @@ or <code>NULL</code></p></td>
<td><p>loss function<strong>:</strong> <td><p>loss function<strong>:</strong>
vector of length \(1\) or \(q\) with entries vector of length \(1\) or \(q\) with entries
<code>"deviance"</code>, <code>"class"</code>, <code>"mse"</code> or <code>"mae"</code> <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>
<tr> <tr>
<th>alpha.base</th> <th>alpha.base</th>
...@@ -205,7 +204,7 @@ numeric between \(0\) (ridge) and \(1\) (lasso)</p></td> ...@@ -205,7 +204,7 @@ numeric between \(0\) (ridge) and \(1\) (lasso)</p></td>
</tr> </tr>
<tr> <tr>
<th>alpha.meta</th> <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> numeric between \(0\) (ridge) and \(1\) (lasso)</p></td>
</tr> </tr>
<tr> <tr>
...@@ -231,8 +230,8 @@ logical</p></td> ...@@ -231,8 +230,8 @@ logical</p></td>
</tr> </tr>
<tr> <tr>
<th>...</th> <th>...</th>
<td><p>further arguments passed to <code><a href='https://rdrr.io/pkg/glmnet/man/glmnet.html'>glmnet</a></code> <td><p>further arguments passed to <code><a href='https://glmnet.stanford.edu/reference/glmnet.html'>glmnet</a></code>
and <code><a href='https://rdrr.io/pkg/glmnet/man/cv.glmnet.html'>cv.glmnet</a></code></p></td> and <code><a href='https://glmnet.stanford.edu/reference/cv.glmnet.html'>cv.glmnet</a></code></p></td>
</tr> </tr>
</table> </table>
...@@ -260,7 +259,7 @@ and the intercept-only models (<code>none</code>).</p> ...@@ -260,7 +259,7 @@ and the intercept-only models (<code>none</code>).</p>
</div> </div>
<div class="pkgdown"> <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> </div>
</footer> </footer>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a> <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> </span>
</div> </div>
...@@ -96,13 +96,13 @@ ...@@ -96,13 +96,13 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/rauschenberger/joinet"> <a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span> <span class="fas fa-github"></span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://cran.r-project.org/package=joinet"> <a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span> <span class="fas fa-download"></span>
</a> </a>
</li> </li>
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
</div> </div>
<div class="pkgdown"> <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> </div>
</footer> </footer>
......
...@@ -77,7 +77,7 @@ in high-dimensional settings." /> ...@@ -77,7 +77,7 @@ in high-dimensional settings." />
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a> <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> </span>
</div> </div>
...@@ -102,13 +102,13 @@ in high-dimensional settings." /> ...@@ -102,13 +102,13 @@ in high-dimensional settings." />
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/rauschenberger/joinet"> <a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span> <span class="fas fa-github"></span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://cran.r-project.org/package=joinet"> <a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span> <span class="fas fa-download"></span>
</a> </a>
</li> </li>
...@@ -144,7 +144,7 @@ in high-dimensional settings.</p> ...@@ -144,7 +144,7 @@ in high-dimensional settings.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> <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. <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> <code>help("joinet)"</code> to open its help file.</p>
<p>See the vignette for further examples. <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> 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> ...@@ -158,64 +158,66 @@ to open the vignette.</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># \dontshow{</span> <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='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='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='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='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='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'>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'># n samples, p inputs, q outputs</span>
<span class='co'>#--- model fitting ---</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 "base": univariate</span>
<span class='co'># slot "meta": multivariate</span> <span class='co'># slot "meta": multivariate</span>
<span class='co'>#--- make predictions ---</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 "base": univariate</span>
<span class='co'># n x q matrix "meta": multivariate </span> <span class='co'># n x q matrix "meta": multivariate </span>
<span class='co'>#--- extract coefficients ---</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'># effects of inputs on outputs</span>
<span class='co'># q vector "alpha": intercepts</span> <span class='co'># q vector "alpha": intercepts</span>
<span class='co'># p x q matrix "beta": slopes</span> <span class='co'># p x q matrix "beta": slopes</span>
<span class='co'>#--- model comparison ---</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'># cross-validated loss</span>
<span class='co'># row "base": univariate</span> <span class='co'># row "base": univariate</span>
<span class='co'># row "meta": multivariate</span> <span class='co'># row "meta": multivariate</span>
}<span class='co'># }</span> <span class='op'>}</span><span class='co'># }</span>
<span class='kw'>if</span> (<span class='fl'>FALSE</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='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='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='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='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='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'>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'># n samples, p inputs, q outputs</span>
<span class='co'>#--- model fitting ---</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 "base": univariate</span>
<span class='co'># slot "meta": multivariate</span> <span class='co'># slot "meta": multivariate</span>
<span class='co'>#--- make predictions ---</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 "base": univariate</span>
<span class='co'># n x q matrix "meta": multivariate </span> <span class='co'># n x q matrix "meta": multivariate </span>
<span class='co'>#--- extract coefficients ---</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'># effects of inputs on outputs</span>
<span class='co'># q vector "alpha": intercepts</span> <span class='co'># q vector "alpha": intercepts</span>
<span class='co'># p x q matrix "beta": slopes</span> <span class='co'># p x q matrix "beta": slopes</span>
<span class='co'>#--- model comparison ---</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'># cross-validated loss</span>
<span class='co'># row "base": univariate</span> <span class='co'># row "base": univariate</span>
<span class='co'># row "meta": multivariate</span> <span class='co'># row "meta": multivariate</span>
}</div></pre> <span class='op'>}</span>
</div></pre>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top"> <nav id="toc" data-toggle="toc" class="sticky-top">
...@@ -231,7 +233,7 @@ to open the vignette.</p> ...@@ -231,7 +233,7 @@ to open the vignette.</p>
</div> </div>
<div class="pkgdown"> <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> </div>
</footer> </footer>
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">joinet</a> <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> </span>
</div> </div>
...@@ -97,13 +97,13 @@ ...@@ -97,13 +97,13 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li> <li>
<a href="https://github.com/rauschenberger/joinet"> <a href="https://github.com/rauschenberger/joinet">
<span class="fa fa-github"></span> <span class="fas fa-github"></span>
</a> </a>
</li> </li>
<li> <li>
<a href="https://cran.r-project.org/package=joinet"> <a href="https://cran.r-project.org/package=joinet">
<span class="fa fa-download"></span> <span class="fas fa-download"></span>
</a> </a>
</li> </li>
...@@ -129,17 +129,19 @@ ...@@ -129,17 +129,19 @@
<p>Implements multivariate elastic net regression.</p> <p>Implements multivariate elastic net regression.</p>
</div> </div>
<pre class="usage"><span class='fu'>joinet</span>( <pre class="usage"><span class='fu'>joinet</span><span class='op'>(</span>
<span class='no'>Y</span>,