proj: Projection matrix onto the column space

Description Usage Arguments Details Value

View source: R/util.R

Description

This function assumes X has full column rank, and returns the projection matrix onto the column space of X.

Usage

1
proj(X)

Arguments

X,

a matrix with full column rank, can be an empty matrix with ncol(X) == 0.

Details

The projection matrix onto the column space of X can be written as

X(X^TX)^{-1}X^T.

When X is an empty matrix, then this function returns the zero matrix.

Value

This function returns the desired square matrix with dimension nrow(X).


shuxiaoc/outference documentation built on Dec. 5, 2017, 3:48 a.m.