weight_matrix {EMSNM} | R Documentation |
Calculate the weighted inner product of A and B with the weight W. This result is useful in Logistic Regression.
weight_matrix(A, W, B)
A |
the left matrix |
W |
the weight |
B |
the right matrix |
the wighted inner product, noticing it can be vector when A or B is 2 dimension.
Linsui Deng
#data generation
A <- matrix(rnorm(200),100,2)
W <- rnorm(100)
B <- matrix(rnorm(100),100,1)
weighted <- weight_matrix(A,W,B)