Extracts coefficients from the meta learner, i.e. the weights for the base learners.
# S3 method for joinet
weights(object, ...)
joinet object
further arguments (not applicable)
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.
# \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)}# }
#> y1 y2 y3
#> (Intercept) -0.07829746 0.1602647 0.1759546
#> V1 0.71484572 0.3497354 0.4451388
#> V2 0.00000000 0.6218251 0.4726663
#> V3 0.53320609 0.2695437 0.3921932
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)}