weight_matrix: Weighted Inner Product

Description Usage Arguments Value Author(s) Examples

View source: R/weight_matrix.R

Description

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

Usage

1
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

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

EMSNM documentation built on May 2, 2019, 1:41 p.m.