general_T: General function to generate a prediction expression for a...

Description Usage Arguments Value See Also Examples

View source: R/general_T.R

Description

general_T is a (higher-order) general function that generates a prediction expression for a family of Taguchi (T) methods. Each T method can be implemented by setting the parameters of this function appropriately.

Usage

1
2
general_T(unit_space_data, signal_space_data, generates_transform_functions,
  subtracts_V_e = TRUE, includes_transformed_data = FALSE)

Arguments

unit_space_data

Matrix with n rows (samples) and (p + 1) columns (variables). The 1 ~ p th columns are independent variables and the (p + 1) th column is a dependent variable. Underlying data to obtain a representative point for the normalization of the signal_space_data. All data should be continuous values and should not have missing values.

signal_space_data

Matrix with m rows (samples) and (p + 1) columns (variables). The 1 ~ p th columns are independent variables and the (p + 1) th column is a dependent variable. Underlying data to generate a prediction expression. All data should be continuous values and should not have missing values.

generates_transform_functions

A function that takes the unit_space_data as an (only) argument and returns a list containing three functions. A data transformation function for independent variables is the first component, a data transformation function for a dependent variable is the second component, and an inverse function of the data transformation function for a dependent variable is the third component. The data transformation function for independent variables takes independent variable data (a matrix of p columns) as an (only) argument and returns the transformed independent variable data. The data transformation function for a dependent variable takes dependent variable data (a vector) as an (only) argument and returns the transformed dependent variable data. The inverse function of the data transformation for a dependent variable takes the transformed dependent variable data (a vector) as an (only) argument and returns the untransformed dependent variable data.

subtracts_V_e

If TRUE, then the error variance is subtracted in the numerator when calculating eta_hat.

includes_transformed_data

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

Value

A list containing the following components is returned.

beta_hat

Vector with length q. Estimated proportionality constants between each independent variable and the dependent variable.

subtracts_V_e

Logical. If TRUE, then eta_hat was calculated without subtracting the error variance in the numerator.

eta_hat

Vector with length q. Estimated squared signal-to-noise ratios (S/N) coresponding to beta_hat.

M_hat

Vector with length n. The estimated values of the dependent variable after the data transformation for signal_space_data.

overall_prediction_eta

Numeric. The overall squared signal-to-noise ratio (S/N).

transforms_independent_data

Data transformation function generated from generates_transform_functions based on unit_space_data. The function for independent variables takes independent variable data (a matrix of p columns) as an (only) argument and returns the transformed independent variable data.

transforms_dependent_data

Data transformation function generated in generates_transform_functions based on the unit_space_data. The function for a dependent variable takes dependent variable data (a vector) as an (only) argument and returns the transformed dependent variable data.

inverses_transformed_dependent_data

Inverse function generated in the generates_transform_functions based on unit_space_data. The function of the takes the transformed dependent variable data (a vector) as an (only) argument and returns the dependent variable data inversed from the transformed dependent variable data.

m

The number of samples for signal_space_data.

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 independent variable data after the data transformation for the signal_space_data are included.

M

If includes_transformed_data is TRUE, then the (true) value of the dependent variable after the data transformation for the signal_space_data are included.

See Also

T1, Ta, and Tb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# The value of the dependent variable of the following samples mediates
# in the stackloss dataset.
stackloss_center <- stackloss[c(9, 10, 11, 20, 21), ]

# The following samples are data other than the unit space data and the test
# data.
stackloss_signal <- stackloss[-c(2, 9, 10, 11, 12, 19, 20, 21), ]

# The following settings are same as the T1 method.
model <- general_T(unit_space_data = stackloss_center,
                   signal_space_data = stackloss_signal,
                   generates_transform_functions =
                                       generates_transformation_functions_T1,
                   subtracts_V_e = TRUE,
                   includes_transformed_data = TRUE)

(model$M_hat)

okayaa/MTSYS documentation built on March 22, 2021, 10:45 a.m.