# NOT RUN {
library(MixOptim)
saPred<-function(x) 17.3359 * x[1] + 30.7765 * x[2] + 20.0501 * x[3] + 0.7506 * x[1] * x[2] +
(-6.3443 * x[1] * x[3]) + (-5.9291 * x[2] * x[3]) +(-25.3093 * x[1] * x[2] * x[3])
pvPred<-function(x) 0.884640 * x[1] + 0.789863 * x[2] + 0.825016 * x[3] +
(-0.108964 * x[1] * x[2]) + 0.107167 * x[1] * x[3] + (-0.005220 * x[2] * x[3]) +
1.625246 * x[1] * x[2] * x[3]
funcoes <- c(saPred, pvPred)
saD<-dMin(16.8293856, 31.41170555) #minimun value
pvD<-dMax(0.7796004, 0.9019796) #maximum value
overallD<-dOverall(saD, pvD)
a <- mixtureOptim(funcoes, overallD, 3, step = 0.05, plot = TRUE)
a$bestComposition
# next line will generate a ggplot/patchwork grid
#desirabilityPlot(funcoes, a$plotData, a$bestComposition, list(saD, pvD), c("min", "max"))
# }
Run the code above in your browser using DataLab