View source: R/pre_define_functions.r
RSAVS_Generate_D_Matrix | R Documentation |
This function generate the pairwise difference matrix(D matrix in the paper). By default it returns a sparse matrix(matrix.csr) from the package SparseM.
RSAVS_Generate_D_Matrix(n, dense = FALSE, w_vec = 1)
n |
number of observations. |
dense |
logical, whether the return type should be in dense matrix or not |
w_vec |
a scalar value of a length |
In Original RSAVS via ADMM algorithm. This functions generates the pairwise
difference matrix with w_vec = 1
.
In RSI, the original objective function is converted to a sparse median regression
via LLA. The pairwise difference matrix is coupled with weights extracted from
the penalty functions. This is supplied into this function through w_vec
.
a difference matrix with size (n * (n - 1) / 2) \times n
RSAVS:::RSAVS_Generate_D_Matrix(5)
RSAVS:::RSAVS_Generate_D_Matrix(4, dense = TRUE)
RSAVS:::RSAVS_Generate_D_Matrix(3, w_vec = 2)
RSAVS:::RSAVS_Generate_D_Matrix(4, dense = TRUE, w_vec = c(1, -2, 3, -4, 5, -6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.