Description Usage Arguments Details Value Note Author(s) See Also Examples
Calculates the best factors settings with regard to defined desirabilities and constraints.
Two approaches are currently supported, (I) evaluating (all) possible factor settings and (II) using the function optim
or gosolnp
of the Rsolnp
package.
Using optim optim
initial values for the factors to be optimized over can be set via start.
The optimality of the solution depends critically on the starting parameters which is why it is recommended to use ‘type="gosolnp"’ although calculation takes a while.
1 |
fdo |
an object of class |
constraints |
constraints for the factors such as list(A = c(-2,1), B = c(0, 0.8)). |
steps |
number of grid points per factor if type = “grid”. |
type |
type of search. “grid”,“optim” or “gosolnp” are supported (see DESCRIPTION). |
start |
numerical vector giving the initial values for the factors to be optimized over. |
... |
further aguments. |
It is recommened to use ‘type="gosolnp"’. Derringer and Suich (1994) desirabilities do not have continuous first derivatives, more precisely they have points where their derivatives do not exist,
start should be defined in cases where ‘type = "optim"’ fails to calculate the best factor setting.
optimum
returns an object of class desOpt.
For a example which shows the usage of optimum()
in context please read the vignette for the package
qualityTools
at http://www.r-qualitytools.org/html/Improve.html.
Thomas Roth thomas.roth@tu-berlin.de
optim
desirability
desires
gosolnp
http://www.r-qualitytools.org/html/Improve.html
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #BEWARE BIG EXAMPLE --Simultaneous Optimization of Several Response Variables--
#Source: DERRINGER, George; SUICH, Ronald: Simultaneous Optimization of Several
# Response Variables. Journal of Quality Technology Vol. 12, No. 4,
# p. 214-219
#Define the response suface design as given in the paper and sort via
#Standard Order
fdo = rsmDesign(k = 3, alpha = 1.633, cc = 0, cs = 6)
fdo = randomize(fdo, so = TRUE)
#Attaching the 4 responses
y1 = c(102,120,117,198,103,132,132,139,102,154,96,163,116,153,133,133,140,142,
145,142)
y2 = c(900,860,800,2294,490,1289,1270,1090,770,1690,700,1540,2184,1784,1300,
1300,1145,1090,1260,1344)
y3 = c(470,410,570,240,640,270,410,380,590,260,520,380,520,290,380,380,430,
430,390,390)
y4 = c(67.5,65,77.5,74.5,62.5,67,78,70,76 ,70,63 ,75,65,71 ,70,68.5,68,68,69,
70)
response(fdo) = data.frame(y1, y2, y3, y4)[c(5,2,3,8,1,6,7,4,9:20),]
#setting names and real values of the factors
names(fdo) = c("silica", "silan", "sulfur")
highs(fdo) = c(1.7, 60, 2.8)
lows(fdo) = c(0.7, 40, 1.8)
#summary of the response surface design
summary(fdo)
#setting the desires
desires(fdo) = desirability(y1, 120, 170, scale = c(1,1), target = "max")
desires(fdo) = desirability(y2, 1000, 1300, target = "max")
desires(fdo) = desirability(y3, 400, 600, target = 500)
desires(fdo) = desirability(y4, 60, 75, target = 67.5)
desires(fdo)
#Have a look at some contourPlots
par(mfrow = c(2,2))
contourPlot(A, B, y1, data = fdo)
contourPlot(A, B, y2, data = fdo)
wirePlot(A, B, y1, data = fdo)
wirePlot(A, B, y2, data = fdo)
#setting the fits as in the paper
fits(fdo) = lm(y1 ~ A + B + C + A:B + A:C + B:C + I(A^2) + I(B^2) + I(C^2),
data = fdo)
fits(fdo) = lm(y2 ~ A + B + C + A:B + A:C + B:C + I(A^2) + I(B^2) + I(C^2),
data = fdo)
fits(fdo) = lm(y3 ~ A + B + C + A:B + A:C + B:C + I(A^2) + I(B^2) + I(C^2),
data = fdo)
fits(fdo) = lm(y4 ~ A + B + C + A:B + A:C + B:C + I(A^2) + I(B^2) + I(C^2),
data = fdo)
#fits(fdo)
#calculate the same best factor settings as in the paper using type = "optim"
optimum(fdo, type = "optim")
#calculate (nearly) the same best factor settings as in the paper using type = "grid"
optimum(fdo, type = "grid")
|
Loading required package: Rsolnp
Loading required package: MASS
Attaching package: 'qualityTools'
The following object is masked from 'package:stats':
sigma
Warning messages:
1: In `[<-`(`*tmp*`, i, value = <S4 object of class "doeFactor">) :
implicit list embedding of S4 objects is deprecated
2: In `[<-`(`*tmp*`, i, value = <S4 object of class "doeFactor">) :
implicit list embedding of S4 objects is deprecated
3: In `[<-`(`*tmp*`, i, value = <S4 object of class "doeFactor">) :
implicit list embedding of S4 objects is deprecated
Information about the factors:
A B C
low 0.7 40 1.8
high 1.7 60 2.8
name silica silan sulfur
unit
type numeric numeric numeric
-----------
StandOrd RunOrder Block A B C y1 y2 y3 y4
5 1 1 1 -1.000 -1.000 -1.000 103 490 640 62.5
2 2 2 1 1.000 -1.000 -1.000 120 860 410 65.0
3 3 3 1 -1.000 1.000 -1.000 117 800 570 77.5
8 4 4 1 1.000 1.000 -1.000 139 1090 380 70.0
1 5 5 1 -1.000 -1.000 1.000 102 900 470 67.5
6 6 6 1 1.000 -1.000 1.000 132 1289 270 67.0
7 7 7 1 -1.000 1.000 1.000 132 1270 410 78.0
4 8 8 1 1.000 1.000 1.000 198 2294 240 74.5
9 9 9 1 -1.633 0.000 0.000 102 770 590 76.0
10 10 10 1 1.633 0.000 0.000 154 1690 260 70.0
11 11 11 1 0.000 -1.633 0.000 96 700 520 63.0
12 12 12 1 0.000 1.633 0.000 163 1540 380 75.0
13 13 13 1 0.000 0.000 -1.633 116 2184 520 65.0
14 14 14 1 0.000 0.000 1.633 153 1784 290 71.0
15 15 15 1 0.000 0.000 0.000 133 1300 380 70.0
16 16 16 1 0.000 0.000 0.000 133 1300 380 68.5
17 17 17 1 0.000 0.000 0.000 140 1145 430 68.0
18 18 18 1 0.000 0.000 0.000 142 1090 430 68.0
19 19 19 1 0.000 0.000 0.000 145 1260 390 69.0
20 20 20 1 0.000 0.000 0.000 142 1344 390 70.0
$y1
Target is to maximize y1
lower Bound: 120
higher Bound: 170
Scale factor is: 1 1
importance: 1
$y2
Target is to maximize y2
lower Bound: 1000
higher Bound: 1300
Scale factor is: 1 1
importance: 1
$y3
Target is 500 for y3
lower Bound: 400
higher Bound: 600
Scale factor is: low = 1 and high = 1
importance: 1
$y4
Target is 67.5 for y4
lower Bound: 60
higher Bound: 75
Scale factor is: low = 1 and high = 1
importance: 1
composite (overall) desirability: 0.583
A B C
coded -0.0533 0.144 -0.872
real 1.1733 51.442 1.864
y1 y2 y3 y4
Responses 129.333 1300 466.397 67.997
Desirabilities 0.187 1 0.664 0.934
composite (overall) desirability: 0.58
A B C
coded 0.0 0.136 -0.817
real 1.2 51.361 1.892
y1 y2 y3 y4
Responses 130.660 1299.669 456.937 67.980
Desirabilities 0.213 0.999 0.569 0.936
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.