matrix.standardize: Creates a standardized matrix.

View source: R/matrix.R

matrix.standardizeR Documentation

Creates a standardized matrix.

Description

Creates a standardized matrix.

Usage

matrix.standardize(
  mat,
  centers = NULL,
  scales = NULL,
  weights = NULL,
  ddof = 0,
  n_threads = 1
)

Arguments

mat

An adelie matrix.

centers

The center values. Default is to use the column means.

scales

The scale values. Default is to use the sample standard deviations.

weights

Observation weight vector, which defaults to 1/n per observation.

ddof

Degrees of freedom for standard deviations, with default 0 (1/n). The alternative is 1 leading to 1/(n-1).

n_threads

Number of threads.

Value

Standardized matrix. The object is an S4 class with methods for efficient computation by adelie.

Author(s)

James Yang, Trevor Hastie, and Balasubramanian Narasimhan
Maintainer: Trevor Hastie hastie@stanford.edu

Examples

n <- 100
p <- 20
X <- matrix(rnorm(n * p), n, p)
out <- matrix.standardize(matrix.dense(X))

adelie documentation built on Sept. 11, 2024, 6:36 p.m.