Commit e5ae8bab authored by Armin Rauschenberger's avatar Armin Rauschenberger

vignette

parent 961cfb7e
...@@ -342,11 +342,14 @@ predict.joinet <- function(object,newx,type="response",...){ ...@@ -342,11 +342,14 @@ predict.joinet <- function(object,newx,type="response",...){
#' in a matrix with \eqn{p} rows (inputs) and \eqn{q} columns. #' in a matrix with \eqn{p} rows (inputs) and \eqn{q} columns.
#' #'
#' @examples #' @examples
#' if(!grepl('SunOS',Sys.info()['sysname'])){
#' 1+1
#' n <- 50; p <- 100; q <- 3 #' n <- 50; p <- 100; q <- 3
#' X <- matrix(rnorm(n*p),nrow=n,ncol=p) #' X <- matrix(rnorm(n*p),nrow=n,ncol=p)
#' Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5]))) #' Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5])))
#' object <- joinet(Y=Y,X=X) #' object <- joinet(Y=Y,X=X)
#' coef <- coef(object) #' coef <- coef(object)
#' }
#' #'
coef.joinet <- function(object,...){ coef.joinet <- function(object,...){
if(length(list(...))!=0){warning("Ignoring argument.",call.=FALSE)} if(length(list(...))!=0){warning("Ignoring argument.",call.=FALSE)}
......
...@@ -4,5 +4,5 @@ pkgdown_sha: ~ ...@@ -4,5 +4,5 @@ pkgdown_sha: ~
articles: articles:
article: article.html article: article.html
joinet: joinet.html joinet: joinet.html
last_built: 2020-11-02T12:41Z last_built: 2020-11-02T13:19Z
...@@ -155,11 +155,14 @@ and the slot <code>beta</code> contains the slopes ...@@ -155,11 +155,14 @@ and the slot <code>beta</code> contains the slopes
in a matrix with \(p\) rows (inputs) and \(q\) columns.</p> 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='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> <pre class="examples"><div class='input'><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='fl'>1</span>+<span class='fl'>1</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'>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'>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'>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='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>
</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">
......
...@@ -24,10 +24,13 @@ Extracts pooled coefficients. ...@@ -24,10 +24,13 @@ Extracts pooled coefficients.
the coefficients from the base learners.) the coefficients from the base learners.)
} }
\examples{ \examples{
if(!grepl('SunOS',Sys.info()['sysname'])){
1+1
n <- 50; p <- 100; q <- 3 n <- 50; p <- 100; q <- 3
X <- matrix(rnorm(n*p),nrow=n,ncol=p) X <- matrix(rnorm(n*p),nrow=n,ncol=p)
Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5]))) Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5])))
object <- joinet(Y=Y,X=X) object <- joinet(Y=Y,X=X)
coef <- coef(object) coef <- coef(object)
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment