Weighted Norms

  • \(||x||^2_W\)
  • t(x) %*% (W %x% x) (W is a weight matrix)
W <- matrix(1:9, ncol = 3, nrow = 3)
W
##      [,1] [,2] [,3]
## [1,]    1    4    7
## [2,]    2    5    8
## [3,]    3    6    9
x <- c(2, -1, 1)

W %*% x
##      [,1]
## [1,]    5
## [2,]    7
## [3,]    9
z <- t(x) %*% (W %*% x)
z
##      [,1]
## [1,]   12