dot-PCA_smallest_eig: Compute smallest eigenvalue and its corresponding eigenvector

.PCA_smallest_eigR Documentation

Compute smallest eigenvalue and its corresponding eigenvector

Description

Calculates the smallest eigenvalue and its corresponding eigenvector of the covariance matrix of a filtered 3D coordinates data set, optionally centering the latter.

Usage

.PCA_smallest_eig(xyz_data, C, c, center = FALSE)

Arguments

xyz_data

A Nx3 numeric matrix-like object where each row represents the x, y, and z coordinates of a point in space.

C

A numeric vector indicating the group of each observation in xyz_data.

c

A numeric value specifying the group to be processed.

center

Logical; if TRUE, the data will be centered (mean subtracted) before computing the covariance matrix. Defaults to FALSE.

Details

This is a translation of c++ code from the Meshlab Virtual Goniometer plugin developed by the AMAAZE consortium

Value

A list containing two elements: smallest_eigenvalue, the smallest eigenvalue of the covariance matrix, and smallest_eigenvector, the corresponding eigenvector.

Examples

## Not run: 
xyz_data <- matrix(rnorm(300), ncol = 3)
C <- sample(1:2, 100, replace = TRUE)
result <- Lithics3D:::.PCA_smallest_eig(xyz_data, C, 1)
print(result)

## End(Not run)

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.