weight_matrix {EMSNM}R Documentation

Weighted Inner Product

Description

Calculate the weighted inner product of A and B with the weight W. This result is useful in Logistic Regression.

Usage

weight_matrix(A, W, B)

Arguments

A

the left matrix

W

the weight

B

the right matrix

Value

the wighted inner product, noticing it can be vector when A or B is 2 dimension.

Author(s)

Linsui Deng

Examples

#data generation
A <- matrix(rnorm(200),100,2)
W <- rnorm(100)
B <- matrix(rnorm(100),100,1)
weighted <- weight_matrix(A,W,B)

[Package EMSNM version 1.0 Index]