Description Usage Arguments Value
View source: R/softThreshold.R
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]^{λ}
1 | soft_thresh(x, lambda = 8, zero.diag = T)
|
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. |
a matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.