general_MT: General function to generate a unit space for a family of...

Description Usage Arguments Value See Also Examples

View source: R/general_MT.R

Description

general_MT is a (higher-order) general function that generates a unit space for a family of Mahalanobis-Taguchi (MT) methods. Each MT method can be implemented by setting the parameters of this function appropriately.

Usage

1
2
general_MT(unit_space_data, calc_A, generates_transform_function,
  includes_transformed_data = FALSE)

Arguments

unit_space_data

Matrix with n rows (samples) and p columns (variables). Data to generate the unit space. All data should be continuous values and should not have missing values.

calc_A

Function that returns A in a quadratic form x'Ax. calc_A takes the transformed data as an (only) argument.

generates_transform_function

Function that takes unit_space_data as an (only) argument and returns a data transformation function. The data transformation function takes data as an (only) argument and returns the transformed data.

includes_transformed_data

If TRUE, then the transformed data are included in a return object.

Value

A list containing the following components is returned.

A

q x q matrix calculated by calc_A.

calc_A

Function passed by calc_A.

transforms_data

Data transformation function generated from generates_transform_function based on unit_space_data.

distance

Vector with length n. Distances from the unit space to each sample.

n

The number of samples.

q

The number of independent variables after the data transformation. According to the data transoformation function, q may be equal to p.

x

If includes_transformed_data is TRUE, then the transformed data are included.

See Also

MT, MTA and RT

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 40 data for versicolor in the iris dataset                            
iris_versicolor <- iris[61:100, -5] 

# The following settings are same as the MT method.                          
unit_space <- general_MT(unit_space_data = iris_versicolor, 
                         generates_transform_function = 
                                            generates_normalization_function,
                         calc_A = function(x) solve(cor(x)),  
                         includes_transformed_data = TRUE)
                         
(unit_space$distance)

okayaa/MT documentation built on March 15, 2021, 8:41 a.m.