RegressOutLazily: Replace a matrix with residuals from an OLS regression.

View source: R/MatrixLazyEval_convenience.R

RegressOutLazilyR Documentation

Replace a matrix with residuals from an OLS regression.

Description

Replace a matrix with residuals from an OLS regression.

Usage

RegressOutLazily(M, X)

Arguments

M

Any matrix with a multiplication operator defined. Usually from the Matrix package.

X

This must be some sort of typical matrix such that solve(t(X) %*% X) works.

Details

This function returns a LazyMatrix representing the residuals after regressing M on X. If X is too big, though, you may not gain any efficiency.

This method is LAZY – calculations are put off until later, not triggered by calling this function.


ekernf01/MatrixLazyEval documentation built on July 24, 2022, 2:42 a.m.