1
desirability 패키지를 사용하여 최적화를 수행하기 위해 내 R 코드에 문제가 있습니다. this document에 내 작업을 기반으로합니다. 내가 오류 다음 최종 예측 명령을 실행할 때R 바람직 성 분석
library(desirability)
#Desirability function
##Function creation
Aldeh_ther<-function(x) ((1/(-0.4349834+(0.0150467*x[1])+(0.0086295*x[2])-(0.0000392*(x[1]^2))-(0.0000484*(x[1]*x[2]))))^(1/3))-1
Alcoh_ther<-function(x) ((0.00000251*x[1]^3)-(0.00162503*x[1]^2)+0.35051446*x[1]-24.3342493)^(1/15.625)-1+0*x[2]
Dim01_ther<-function(x) 0.084274-0.001068*x[1]+0.000003*x[1]^2+0*x[2]
Dim02_ther<-function(x) 0.074642-0.000942*x[1]+0.000003*x[1]^2+0*x[2]
Cim03_ther<-function(x) 0.131254852-(0.001122297*x[1])-(0.001068577*x[2])+(0.0000031092*x[1]*x[2])+(0.00000299178*(x[1]^2))+(0.00000534403*(x[2]^2))
LigAr_ther<-function(x) (1/(40041891907.4231*x[1]^(-1.375863404)-17274906.5300496))^(1/4.68)+0*x[2]
ArAld_ther<-function(x) 0.07063708-0.00072373*x[1]+0.0000023217*x[1]^2+0.0000015008*x[2]^2
ArVin_ther<-function(x) 0.04855352-0.00034407*x[1]+0.0004283*x[2]+0.0000013*x[1]^2+0.00000503*x[2]^2
Iso01_ther<-function(x) (1/(42.800123-0.108827*x[1]-0.468667*x[2]+0.002539*x[1]*x[2]))^(1/0.8)
Iso02_ther<-function(x) (1/(120151935.1-402916.2*x[1]-114490.7*x[2]))^(1/5)+0*x[2]
Ester_oxid<-function(x) 0.00501805*x[1]-0.000015595*x[1]^2-0.27959773+0*x[2]
Aldeh_oxid<-function(x) 0.00717424*x[1]+0.00455026*x[2]-0.000021871*x[1]*x[2]-0.000015255*x[1]^2-0.68899457
FFA_target<-function(x) 0.58079701-0.00573986*x[1]-0.00596008*x[2]+0.000019772*x[1]*x[2]+0.000015716*x[1]^2+0.000025474*x[2]^2
##Optimization algorithm
FFA_targetD<-dMax(0.0314, 0.3000)
Aldeh_therD<-dTarget(0, 0.021, 0.4)
Alcoh_therD<-dTarget(0, 0.013, 0.02)
Dim01_therD<-dTarget(0, 0.011, 0.02)
Dim02_therD<-dTarget(0, 0.009, 0.05)
Cim03_therD<-dTarget(0, 0.027, 0.07)
LigAr_therD<-dTarget(0, 0.044, 0.065)
ArAld_therD<-dTarget(0, 0.039, 0.06)
ArVin_therD<-dTarget(0, 0.034, 0.05)
Iso01_therD<-dMin(0, 0.03)
Iso02_therD<-dTarget(0, 0.056, 0.085)
Ester_oxidD<-dMin(0, 0.191435)
Aldeh_oxidD<-dMin(0, 0.07)
##Calculation of center point projected absorbances
predOutcomes<-c(FFA_target(c(212.5,50)), Aldeh_ther(c(212.5,50)), Alcoh_ther(c(212.5,50)), Dim01_ther(c(212.5,50)),
Dim02_ther(c(212.5,50)), Cim03_ther(c(212.5,50)), LigAr_ther(c(212.5,50)), ArAld_ther(c(212.5,50)),
ArVin_ther(c(212.5,50)), Iso01_ther(c(212.5,50)), Iso02_ther(c(212.5,50)), Ester_oxid(c(212.5,50)),
Aldeh_oxid(c(212.5,50)))
print(predOutcomes)
predict(FFA_targetD, predOutcomes[1])
predict(Aldeh_therD, predOutcomes[2])
predict(Alcoh_therD, predOutcomes[3])
predict(Dim01_therD, predOutcomes[4])
predict(Dim02_therD, predOutcomes[5])
predict(Cim03_therD, predOutcomes[6])
predict(LigAr_therD, predOutcomes[7])
predict(ArAld_therD, predOutcomes[8])
predict(ArVin_therD, predOutcomes[9])
predict(Iso01_therD, predOutcomes[10])
predict(Iso02_therD, predOutcomes[11])
predict(Ester_oxidD, predOutcomes[12])
predict(Aldeh_oxidD, predOutcomes[13])
overallD<-dOverall(FFA_targetD, Aldeh_therD, Alcoh_therD, Dim01_therD, Dim02_therD, Cim03_therD, LigAr_therD, ArAld_therD,
ArVin_therD, Iso01_therD, Iso02_therD, Ester_oxidD, Aldeh_oxidD)
print(overallD)
predict(overallD, predOutcomes)
나타납니다 :
내 코드는 다음입니다
예측 (overallD, predOutcomes) predict.dOverall (overallD, predOutcomes)에서 오류 : newdata의 열 수는 바람직 함 함수의 수와 일치해야합니다.
R의 새로운 기능이며 단일 응답 ANOVA 및 회귀를 수행 할 수 있었지만 실험 작업 영역을 결정하는 데 필요합니다. 최대 쿤에
희망 누군가가 나에게 도움이 될 수 있습니다