projector: Orthogonal Projector (a.k.a. hat matrix)

Description Usage Arguments Examples

Description

produces an orthogonal projection matrix i.e. X (X' X)-1 X'

Usage

1
  projector(x, inverse = "solve")

Arguments

x

numeric matrix

inverse

type of inverse. Options: "solve" (default) and "ginv"

Examples

1
2
3
4
5
6
7
8
9
# a matrix
set.seed(5)
M = matrix(runif(15), 5, 3)

# projector
projector(M)

# synonym function
hat_matrix(M)

gastonstat/matrixkit documentation built on May 16, 2019, 5:45 p.m.