soft_thresh: Soft Thresholding Function for Signed Correlation Networks

Description Usage Arguments Value

View source: R/softThreshold.R

Description

This function implements the soft thresholding function from WGCNA. This is used to downweight negative edges while at the same time shifting the matrix entries to be >= 0. This is accomplished by adding 1 to the matrix entries, then dividing by two. Then, the resulting values are raised to a power, denoted as lambda. Recommended values for lambda are 4 to 8 for partial correlation networks, and 8 to 12 for correlation networks. Larger values result in stronger thresholding. The formula used is given below.

w_{ij}^{\text {signed }}=≤ft[\frac{ρ≤ft(i,j\right)+1}{2}\right]^{λ}

Usage

1
soft_thresh(x, lambda = 8, zero.diag = T)

Arguments

x

a correlation or partial correlation matrix

lambda

the power to which the matrix will be raised. defaults to 8. setting lambda to "auto" will automatically choose a value based on the operator norm of the transformed matrix. A small value is added to lambda at each iteration, and the algorithm stops when the change in operator norm is <= than 0.01.

zero.diag

if TRUE (the default) the diagonal of the returned matrix will be set to zero. otherwise, it will be set to 1.

Value

a matrix


abnormally-distributed/rsfcNet documentation built on March 8, 2020, 5:32 p.m.