Learn R Programming

toscca (version 0.1.0)

residualisation: Performs matrix residualisation over estimated canonical vectors. There are three types: basic (subtracts scaled estimated latent variable from data), null (uses the null space of the estimated canonical vector to construct a new matrix) and LV (uses SVD to residualise).

Description

Performs matrix residualisation over estimated canonical vectors. There are three types: basic (subtracts scaled estimated latent variable from data), null (uses the null space of the estimated canonical vector to construct a new matrix) and LV (uses SVD to residualise).

Usage

residualisation(
  mat,
  vec,
  spaceMat = NULL,
  type = c("LV", "null", "basic"),
  na.allow = TRUE
)

Value

Matrix.

Arguments

mat

An nxp matrix.

vec

A vector of dimensions nxk.

spaceMat

Only for "null" type residualisation. Default is NULL.

type

Character. It can be LV, null or basic depending on which type of residualisation will be performed.

na.allow

Logical. If TRUE, NAs will be allowed.