general_forecasting.T: General function to implement a forecasting method for a...

Description Usage Arguments Value See Also Examples

View source: R/general_T.R

Description

general_forecasting.T is the general function that implements a forecasting method for a family of Taguchi (T) methods. Each forecasting method of a family of T methods can be implemented by setting the parameters of this function appropriately.

Usage

1
general_forecasting.T(model, newdata, includes_transformed_newdata = FALSE)

Arguments

model

Object generated as a model.

newdata

Matrix with n rows (samples) and p columns (variables). The data are used to calculate the desired distances from the unit space. All data should be continuous values and should not have missing values.

includes_transformed_newdata

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

Value

A list containing the following components is returned.

M_hat

Vector with length n. The estimated values of the dependent variable after the data trasformation.

y_hat

Vector with length n. The estimated values after the inverse transformation from M_hat.

model

Object passed by model.

n

The number of samples for newdata.

q

The number of variables after the data transformation.

X

If includes_transformed_newdata is TRUE, then the transformed data for newdata are included.

See Also

forecasting.T1, forecasting.Ta, and forecasting.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
# 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)

# The following test samples are chosen casually.
stackloss_test <- stackloss[c(2, 12, 19), -4]

forecasting <- general_forecasting.T(model = model,
                                     newdata = stackloss_test,
                                     includes_transformed_newdata = TRUE)

(forecasting$y_hat) # Estimated values
(stackloss[c(2, 12, 19), 4]) # True values

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