constrainSimCpp | R Documentation |
Constrain similarity matrix with a mask
constrainSimCpp(sim, MASK, samples4gradient = 100)
sim |
(matrix) A numeric matrix. Input similarity matrix. |
MASK |
(matrix) A numeric matrix. Masked indices have non-zero values. |
samples4gradient |
(numeric) This paarameter modulates penalization of masked indices. |
s_new (matrix) A constrained similarity matrix.
Shubham Gupta, shubh.gupta@mail.utoronto.ca ORCID: 0000-0003-3500-8152 License: (c) Author (2019) + MIT Date: 2019-03-08
sim <- matrix(c(-2, 10, -2, -2, -2, -2, 10, -2, 10, -2, -2, -2, -2, -2, -2, 10, 10, -2,-2, -2),
4, 5, byrow = FALSE)
MASK <- matrix(c(0.000, 0.000, 0.707, 1.414, 0.000, 0.000, 0.000, 0.707, 0.707, 0.000,
0.000, 0.000, 1.414, 0.707, 0, 0, 2.121, 1.414, 0, 0), 4, 5, byrow = FALSE)
constrainSimCpp(sim, MASK, 10)
matrix(c(-2, 10, -3.414, -4.828, -2, -2, 10, -3.414, 8.586, -2, -2, -2, -4.828,
-3.414, -2, 10, 5.758, -4.828, -2, -2), 4, 5, byrow = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.