linear_transform: Best Linear Transformations

View source: R/linear_transform.R

linear_transformR Documentation

Best Linear Transformations

Description

The algorithm uses gradient descent algorithm to obtain the maximum of the square of sample skewness, of the kurtosis or of their average under any univariate linear transformation of the multivariate data.

Usage

linear_transform(
  x,
  l0 = rep(1, ncol(x)),
  method = "both",
  epsilon = 1e-10,
  iter = 5000,
  stepsize = 0.001
)

Arguments

x

multivariate data matrix.

l0

starting point for projection algorithm, default is rep(1, ncol(x)).

method

character strings, one of c("skewness", "kurtosis", "both").

epsilon

bounds on error of optimal solution, default is 1e-10.

iter

number of iteration of projection algorithm, default is 5000.

stepsize

gradient descent stepsize, default is .001.

Value

  • max_result: The maximum value after linear transformation.

  • x_uni: Univariate data after transformation.

  • vector_k: Vector of the "best" linear transformation.

  • error: Error of projection algorithm.

  • iteration: Number of iteration.

See Also

skewness(), kurtosis()

Examples

set.seed(1)
x <- MASS::mvrnorm(100, mu = rep(0, 2), diag(2))
linear_transform(x, method = "skewness")$max_result
linear_transform(x, method = "kurtosis")$max_result
linear_transform(x, method = "both")$max_result

PlotNormTest documentation built on April 12, 2025, 9:14 a.m.