Learn R Programming

tempted (version 0.1.1)

svd_centralize: Remove the mean structure of the temporal tensor

Description

This function first average the feature value of all time points for each subject to form a subject by feature matrix. Next, it performs a singular value decomposition of this matrix and construct the matrix's rank-r approximation. Then, it subtracts this rank-r subject by feature matrix from the temporal tensor.

Usage

svd_centralize(datlist, r = 1)

Value

A list of results.

datlist

The new temporal tensor after mean structure is removed.

A_tilde

The subject singular vector of the mean structure, a subject by r matrix.

B_tilde

The feature singular vector of the mean structure, a feature by r matrix.

lambda_tilde

The singular value of the mean structure, a length r vector.

Arguments

datlist

A length n list of matrices. Each matrix represents a subject, with columns representing samples from this subject, the first row representing the sampling time points, and the following rows representing the feature values.

r

The number of ranks in the mean structure. Default is 1.

References

Shi P, Martino C, Han R, Janssen S, Buck G, Serrano M, Owzar K, Knight R, Shenhav L, Zhang AR. (2023) Time-Informed Dimensionality Reduction for Longitudinal Microbiome Studies. bioRxiv. doi: 10.1101/550749. https://www.biorxiv.org/content/10.1101/550749.

See Also

Examples can be found in tempted.