create_subspace: A constructor function for the subspace class

View source: R/create_subspace.R

create_subspaceR Documentation

A constructor function for the subspace class

Description

This function calculates scaled eigenvalues and eigenvectors of x matrix.

Usage

create_subspace(
  x,
  components = NULL,
  decomposition = c("svd", "eigen"),
  verbose = FALSE,
  ...
)

Arguments

x

A numeric real-valued matrix with n number of samples and p number of features. If p > n, a warning message is generated and the transpose of x is used.

components

A series of right singular vectors to estimate. Components must be smaller or equal to min(nrow(x), ncol(x)).

decomposition

The method to be used; method = "svd" returns results from singular value decomposition; method = "eigen" returns results from eigenvalue decomposition.

verbose

output message

...

Extra parameters

Value

Returns a list with entries:

ndf:

The number of degrees of freedom of x.

pdim:

The number of dimensions of x.

components:

A series of right singular vectors estimated.

transpose_flag:

A logical value indicating whether the matrix x is transposed.

irl:

A data frame of scaled eigenvalues for specified components and corresponding dimensions.

sigma_a:

A vector of scaled eigenvalues up to max(components).

v:

Right singular vectors of x matrix for specified components.

u:

Left singular vectors of x matrix or specified components.

Examples

x <- x_sim(n = 100, p = 150, ncc = 10, var = c(rep(10, 5), rep(1, 5)))
x %>% create_subspace(components = 8:30) %>% str()

WenlanzZ/MKDim documentation built on July 30, 2022, 7:25 a.m.