SigmaFromBlocks: Create penalized sample cross-product matrix

Description Usage Arguments Value See Also Examples

View source: R/MultiLambdaCVfun.R

Description

Creates penalized sample cross-product matrix, dimension nxn.

Usage

1
SigmaFromBlocks(XXblocks, penalties, pairing = NULL)

Arguments

XXblocks

List of nxn matrices. Usually output of createXXblocks.

penalties

Numeric vector, representing penaltyparameters.

pairing

Numerical vector of length 3 or NULL when pairs are absent. Represents the indices (in XXblocks) of the two data blocks involved in pairing, plus the index of the paired block.

Value

Matrix of size nxn.

See Also

A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Example
#Simulate
Xbl1 <- matrix(rnorm(1000),nrow=10)
Xbl2 <- matrix(rnorm(2000),nrow=10)

#check whether dimensions are correct
ncol(Xbl1)==nrow(Xbl2)

#create cross-product
XXbl <- createXXblocks(list(Xbl1,Xbl2))

#suppose penalties for two data types equal 5,10, respectively
Sigma <- SigmaFromBlocks(XXbl,c(5,10))

#check dimensions (should be n x n)
dim(Sigma)

multiridge documentation built on June 15, 2021, 9:08 a.m.