predict.dMax: Predict method for desirability functions

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/predict.R

Description

Predicted values based on desirability objects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'dMax'
predict(object, newdata = NA, ...)
## S3 method for class 'dMin'
predict(object, newdata = NA, ...)
## S3 method for class 'dTarget'
predict(object, newdata = NA, ...)
## S3 method for class 'dArb'
predict(object, newdata = NA, ...)
## S3 method for class 'dBox'
predict(object, newdata = NA, ...)
## S3 method for class 'dOverall'
predict(object, newdata = matrix(NA, ncol = length(object$d)), all = FALSE, ...)

Arguments

object

a object of class: dMax, dMin, dTarget, dArb, dBox or dOverall

newdata

values of the response for predicting desirability

all

a logical (for predict.dOverall only); should the individual desirabilities also be returned?

...

no currently used

Details

The responses are translated into desirability units.

Value

a vector, unless predict.dOverall is used with all=TRUE, in which case a matrix is returned.

Author(s)

Max Kuhn

References

Derringer, G. and Suich, R. (1980), Simultaneous Optimization of Several Response Variables. Journal of Quality Technology 12, 214–219.

See Also

dMax

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
d1 <- dMin(1,3)
d2 <- dTarget(1, 2, 3)
dBoth <- dOverall(d1, d2)

outcomes <- cbind(
   seq(0, 4, length = 10),
   seq(0.5, 4.5, length = 10))
   
  
predict(d1, outcomes[,2])
predict(d2, outcomes[,2])
predict(dBoth, outcomes)
predict(dBoth, outcomes, all = TRUE)

Example output

 [1] 1.0000000 1.0000000 0.8055556 0.5833333 0.3611111 0.1388889 0.0000000
 [8] 0.0000000 0.0000000 0.0000000
 [1] 0.0000000 0.0000000 0.3888889 0.8333333 0.7222222 0.2777778 0.0000000
 [8] 0.0000000 0.0000000 0.0000000
 [1] 0.0000000 0.0000000 0.6236096 0.8333333 0.6643478 0.3286711 0.0000000
 [8] 0.0000000 0.0000000 0.0000000
          D1        D2   Overall
1  1.0000000 0.0000000 0.0000000
2  1.0000000 0.0000000 0.0000000
3  1.0000000 0.3888889 0.6236096
4  0.8333333 0.8333333 0.8333333
5  0.6111111 0.7222222 0.6643478
6  0.3888889 0.2777778 0.3286711
7  0.1666667 0.0000000 0.0000000
8  0.0000000 0.0000000 0.0000000
9  0.0000000 0.0000000 0.0000000
10 0.0000000 0.0000000 0.0000000

desirability documentation built on May 2, 2019, 4:42 p.m.