scale_ssMRCD: Scale Data Locally

scale_ssMRCDR Documentation

Scale Data Locally

Description

Scale Data Locally

Usage

scale_ssMRCD(
  ssMRCD,
  X = NULL,
  groups = NULL,
  multivariate = FALSE,
  center_only = FALSE
)

Arguments

ssMRCD

ssMRCD object, see ssMRCD

X

matrix, new data to scale with ssMRCD estimation.

groups

vector, group assignments of new data X.

multivariate

logical, TRUE if multivariate structure should be used. Otherwise, univariate variances from the ssMRCD estimator is used.

center_only

logical, if TRUE observations are only centered.

Value

Returns matrix of observations. If X = NULL X from the ssMRCD object is used and sorted according to group numbering.

See Also

ssMRCD

Examples

# create data set
x1 = matrix(runif(200), ncol = 2)
x2 = matrix(rnorm(200), ncol = 2)
x = list(x1, x2)

# create weighting matrix
W = matrix(c(0, 1, 1, 0), ncol = 2)

# calculate ssMRCD
localCovs = ssMRCD(x, weights = W, lambda = 0.5)

# scale used data
scale_ssMRCD(localCovs,
      multivariate = TRUE)

# scale new data
scale_ssMRCD(localCovs,
      X = matrix(rnorm(20), ncol = 2, nrow = 10),
      groups = rep(2, 10),
      multivariate =TRUE)

ssMRCD documentation built on Sept. 11, 2024, 5:14 p.m.