Learn R Programming

joinet (version 1.0.0)

weights.joinet: Extract Weights

Description

Extracts coefficients from the meta learner, i.e. the weights for the base learners.

Usage

# S3 method for joinet
weights(object, ...)

Value

This function returns a matrix with \(1+q\) rows and \(q\) columns. The first row contains the intercepts, and the other rows contain the slopes, which are the effects of the outcomes in the row on the outcomes in the column.

Arguments

object

joinet object

...

further arguments (not applicable)

Examples

Run this code
# \dontshow{
if(!grepl('SunOS',Sys.info()['sysname'])){
n <- 50; p <- 100; q <- 3
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5])))
object <- joinet(Y=Y,X=X)
weights(object)}# }
if (FALSE) {
n <- 50; p <- 100; q <- 3
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
Y <- replicate(n=q,expr=rnorm(n=n,mean=rowSums(X[,1:5])))
object <- joinet(Y=Y,X=X)
weights(object)}

Run the code above in your browser using DataLab