construct_weights {sparselink}R Documentation

Construct internal and external weights

Description

Construct internal and external weights

Usage

construct_weights(coef, id)

Arguments

coef

matrix with p rows (features) and q columns (problems)

id

integer in 1,\ldots,q

Value

Returns a list with slots lower.limits, upper.limits, weight.source (external weights) and weight.target (internal weights). Each slot is a vector of length 2*p, with the first p entries for positive effects and the last p entries for negative effects.

See Also

Use construct_penfacs to obtain penalty factors (i.e., for scaling and inverting weights).

Examples

p <- 10
q <- 3
data <- stats::rbinom(p*q,size=1,prob=0.2)*stats::rnorm(p*q)
coef <- matrix(data=data,nrow=p,ncol=q)
construct_weights(coef=coef,id=1)


[Package sparselink version 1.0.0 Index]