generates_model: Wrapper function to generate a model for a family of Taguchi...

Description Usage Arguments Value See Also Examples

View source: R/wrapper.R

Description

generates_model generates a model for a family of Taguchi (MT) methods. The model of T1 method, Ta method or the Tb method can be generated by passing a method name (character) into a parameter method.

Usage

1
2
3
generates_model(unit_space_data, signal_space_data, sample_data,
  method = c("T1", "Ta", "Tb"), subtracts_V_e = TRUE,
  includes_transformed_data = FALSE)

Arguments

unit_space_data

Used only for the T1 method. 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 signal_space_data. All data should be continuous values and should not have missing values.

signal_space_data

Used only for the T1 method. 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.

sample_data

Used for the Ta and the Tb methods. 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. All data should be continuous values and should not have missing values.

method

Character to designate a method. Currently, "MT", "MTA", and "RT" are available.

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 returned object depends on the selected method. See T1, Ta or Tb.

See Also

T1, Ta, Tb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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 test samples are chosen casually.
stackloss_test <- stackloss[c(2, 12, 19), -4]

# T1 method
model_T1 <- generates_model(unit_space_data = stackloss_center,
                            signal_space_data = stackloss_signal,
                            method = "T1",
                            subtracts_V_e = TRUE)

forecasting_T1 <- forecasting(model = model_T1,
                              newdata = stackloss_test)

(forecasting_T1$y_hat)

# Ta method
model_Ta <- generates_model(sample_data =
                                   rbind(stackloss_center, stackloss_signal),
                            method = "Ta",
                            subtracts_V_e = TRUE)

forecasting_Ta <- forecasting(model = model_Ta,
                              newdata = stackloss_test)

(forecasting_Ta$y_hat)

# Tb method
model_Tb <- generates_model(sample_data =
                                   rbind(stackloss_center, stackloss_signal),
                            method = "Tb",
                            subtracts_V_e = TRUE)

forecasting_Tb <- forecasting(model = model_Tb,
                              newdata = stackloss_test)

(forecasting_Tb$y_hat)

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