fun_lines {mglasso}R Documentation

weighted sum/difference of two regression vectors

Description

fun_lines applies function fun to regression vectors while reordering the coefficients, such that the j-th coefficient in beta[j, ] is permuted with the i-th coefficient.

Usage

fun_lines(i, j, beta, fun = `-`, ni = 1, nj = 1)

Arguments

i

integer scalar. Index of the first vector.

j

integer scalar. Index of the second vector.

beta

p by p numeric matrix. In rows, regression vectors coefficients after node-wise regression. diag(beta) = 0.

fun

function. Applied on lines.

ni

integer scalar. Weight for vector i.

nj

integer scalar. Weight for vector j.

Value

numeric vector

Examples

beta <- matrix(round(rnorm(9),2), ncol = 3)
diag(beta) <- 0
beta
fun_lines(1, 2, beta)
fun_lines(2, 1, beta)

[Package mglasso version 0.1.2 Index]