试验设计及数据挖掘技术课程总练习完美修订版.docx
《试验设计及数据挖掘技术课程总练习完美修订版.docx》由会员分享,可在线阅读,更多相关《试验设计及数据挖掘技术课程总练习完美修订版.docx(15页珍藏版)》请在冰豆网上搜索。
![试验设计及数据挖掘技术课程总练习完美修订版.docx](https://file1.bdocx.com/fileroot1/2022-12/16/cd606e1d-a095-40e4-a3a0-ef213a19eddb/cd606e1d-a095-40e4-a3a0-ef213a19eddb1.gif)
试验设计及数据挖掘技术课程总练习完美修订版
课程总练习
一、试验设计
全面试验法
单因素多次试验法
正交设计法
均匀设计法
配方均匀设计法
调优均匀设计法
三次均匀设计法
二、数据挖掘技术
2.1逐步回归分析建模
线性模型
二次模型
高次模型
混合模型
2.2最优化计算寻优
网格优法法
蒙特卡罗优化法
均匀设计优化法
数论序贯优化法
2.3交互作用Y值等高线图分析
三、验证试验
1、均匀设计试验方案的构造
已知一试验有四个因素,他们的试验范围及因素水平如下:
X1:
1~12;X2:
200~350;X3:
10~20;X4:
2000~4000
表1、因素水平表
NO.
1
2
3
4
5
6
7
8
9
10
11
12
X1
1
2
3
4
5
6
7
8
9
10
11
12
X2
200
250
300
350
X3
10
12
14
16
18
20
X4
2000
2200
2400
2600
2800
3000
3200
3400
3600
3800
4000
(1)给出12拟水平的因素水平表
参考答案
表1B、因素拟水平表
NO.
1
2
3
4
5
6
7
8
9
10
11
12
X1
1
2
3
4
5
6
7
8
9
10
11
12
X2
200
200
200
250
250
250
300
300
300
350
350
350
X3
10
10
12
12
14
14
16
16
18
18
20
20
X4
2000
2200
2400
2600
2800
3000
3200
3400
3600
3800
4000
2000
(2)给出12拟水平的试验方案
参考答案
表1C、U12(124)试验方案表
NO.
1
2
3
4
5
6
7
8
9
10
11
12
1
1
2
3
4
5
6
7
8
9
10
11
12
X1
1
2
3
4
5
6
7
8
9
10
11
12
6
6
12
5
11
4
10
3
9
2
8
1
7
X2
250
350
250
350
250
350
200
300
200
300
200
300
7
8
3
11
6
1
9
4
12
7
2
10
5
X3
16
12
20
14
10
18
12
20
16
10
18
14
9
10
7
4
1
11
8
5
2
12
9
6
3
X4
3800
3200
2600
2000
4000
3400
2800
2200
2000
3600
3000
2400
2、回归分析建模
请对表2的数据进行逐步回归分析
表2、试验方案及结果
No.
X1
X2
X3
X4
X5
Y
1
15
40
35
70
160
538
2
20
60
65
110
150
456
3
25
100
20
50
140
472
4
30
20
50
110
130
420
5
35
40
80
50
120
614
6
40
80
20
90
160
557
7
45
100
50
30
150
682
8
50
20
80
90
140
562
9
55
60
35
30
130
560
10
60
80
65
70
120
550
(1)、用一次模型,要求数据中心化处理,寻找出最好的回归方程。
模型:
Y=A0+A1X1+A2X2+A3X3+A4X4+A5X5
>回归分析结果:
I=1B=1.97557894736842F=3.67396503815582
I=3.0359********F=8.04474411017923
I=4B=-2.05065789473684.024*********
I=5B=3.43498245614035.0875********
BO=541.1F=7.57031378775752R=.926434933430933S=38.7528855745076FO=1.54
>回归方程:
Y*=541.1+(1.97557894736842)*(X1-37.5)+(2.03590643274854)*(X3-50)+(-2.05065789473684)*(X4-70)+(3.43498245614035)*(X5-140)
----------------------------------------------------------------------------
(2)、用一次模型加上交叉项,要求数据中心化处理,寻找出最好的回归方程,并且剔除不显著项从而寻找出最好的回归方程。
模型:
Y=A0+A1X1+A2X2+A3X3+A4X4+A5X5+A6X1X2+A7X1X3+A8X1X4+A9X1X5
+A10X2X3+A11X2X4+A12X2X5+A13X3X4+A14X3X5+A15X4X5
>回归分析结果:
I=1B=1.97557894736842F=162.670156787581
I=3.0359********F=356.192770515776
I=4B=-2.05065789473684F=753.797654882556
I=5B=3.43498245614035F=402.362944012816
I=13B=-6.04761904761905E-02F=217.382287390022
BO=548.357142857143F=311.625798693041R=.998718875359091S=5.8239496670483FO=1.54
------------------------
>回归方程:
Y*=548.357142857143+(1.97557894736842)*(X1-37.5)+(2.03590643274854)*(X3-50)+(-2.05065789473684)*(X4-70)+(3.43498245614035)*(X5-140)+(-6.04761904761905E-02)*(X3-50)*(X4-70)
----------------------------------------------------------------------------
(3)、用二次模型,要求数据中心化处理,寻找出最好的回归方程。
模型:
Y=A0+A1X1+A2X2+A3X3+A4X4+A5X5+A6X1^2+A7X2^2+A8X3^2+A9X4^2+A10X5^2
----------------------------------------------------------------------------
>回归分析结果:
I=1B=1.97557894736842F=6.178********97
I=3.0359********F=13.5277381511204
I=4B=-2.05065789473684F=28.6282545246892
I=5B=3.43498245614035F=15.281221290476
I=10B=.118571428571429F=4.40781133983083
BO=517.385714285714F=11.0655254856918R=.965700670950976S=29.8846083845136FO=1.54
>回归方程:
Y*=517.385714285714+(1.97557894736842)*(X1-37.5)+(2.03590643274854)*(X3-50)+(-2.05065789473684)*(X4-70)+(3.43498245614035)*(X5-140)+(.118571428571429)*(X5-140)^2
----------------------------------------------------------------------------
(4)、用二次模型加上交叉项,要求数据中心化处理,寻找出最好的回归方程。
模型:
Y=A0+A1X1+A2X2+A3X3+A4X4+A5X5+A6X1^2+A7X2^2+A8X3^2+A9X4^2
+A10X5^2+A11X1X2+A12X1X3+A13X1X4+A14X1X5
+A15X2X3+A16X2X4+A17X2X5+A18X3X4+A19X3X5+A20X4X5
----------------------------------------------------------------------------------------------------
>回归分析结果:
I=1B=1.97557894736842F=162.670156787581
I=3.0359********F=356.192770515776
I=4B=-2.05065789473684F=753.797654882556
I=5B=3.43498245614035F=402.362944012816
I=13B=-6.04761904761905E-02F=217.382287390022
BO=548.357142857143F=311.625798693041R=.998718875359091S=5.8239496670483FO=1.54
>回归方程:
Y*=548.357142857143+(1.97557894736842)*(X1-37.5)+(2.03590643274854)*(X3-50)+(-2.05065789473684)*(X4-70)+(3.43498245614035)*(X5-140)+(-6.04761904761905E-02)*(X3-50)*(X4-70)
(5)、用二次模型加上交叉项,要求数据中心化处理,并且剔除不显著项从而寻找出最好的回归方程。
模型:
Y=A0+A1X1+A2X2+A3X3+A4X4+A5X5+A6X1^2+A7X2^2+A8X3^2+A9X4^2
+A10X5^2+A6X1X2+A7X1X3+A8X1X4+A9X1X5+A10X2X3+A11X2X4+A12X2X5
+A13X3X4+A14X3X5+A15X4X5
--------------------------------------------------------------------------------
>回归分析结果:
I=1B=1.97557894736842F=162.670156787581
I=3.0359********F=356.192770515776
I=4B=-2.05065789473684F=753.797654882556
I=5B=3.43498245614035F=402.362944012816
I=13B=-6.04761904761905E-02F=217.382287390022
BO=548.357142857143F=311.625798693041R=.998718875359091S=5.8239496670483FO=1.54
>回归方程:
Y*=548.357142857143+(1.97557894736842)*(X1-37.5)+(2.03590643274854)*(X3-50)+(-2.05065789473684)*(X4-70)+(3.43498245614035)*(X5-140)+(-6.04761904761905E-02)*(X3-50)*(X4-70)
--------------------------------------------------------------------------------
II、对方程各项进行F检验
f1=1,f2=8,F0.01=11.3,F=162>>F0.01=11.3,各项通过a=0.01
III、对整个方程(或者总方程)进行F检验
f1=6-1=5,f2=10-5-1=4,F0.01=15.5,F=311.6>>F0.01=15.5,总方程通过...
3、最优化计算
(1)用网格优化法对下列的方程进行单指标优化计算求出最大值及其对应的参数,并列出原程序
Y=34.9272+1.1785×10-3*(X2-120)^2+9.5338×10-2*(X1-6.2)*(X2-120)
+5.0045×10-3*(X2-120)*(X3-30)
X1:
5.0~7.4;X2:
40~200;X3:
20~40,实验中Y的最大值为38.09
OptionExplicit
PublicSubYHLX1()
10DimGAsInteger,JAsInteger
20DimZM,S1,S2,S3,X1,X2,X3,Y,Y1,Y2
30DimWSAsWorksheet,WFAsWorksheetFunction
40SetWS=Application.ActiveSheet:
SetWF=Application.WorksheetFunction
50ZM=WS.Cells(8,2):
G=WS.Cells(8,4)
60S1=(7.4-5.0)/G:
S2=(200-40)/G:
S3=(40-20)/G
70J=1
80ForX1=5.0To7.4+S1/2StepS1
85ForX2=40To200+S2/2StepS2
90ForX3=20To40+S3/2StepS3
100Y1=34.9272+1.1785e-3*(X2-120)^2
110Y2=9.5338e-2*(X1-6.2)*(X2-120)+5.0045e-3*(X2-120)*(X3-30)
120Y=Y1+Y2
130IfY140remIfY>ZMThenZM=Y
150WS.Cells(8,7)="TheResultsofOptimization"
160WS.Cells(8+J,6)="X1=":
WS.Cells(8+J,7)=X1
165WS.Cells(8+J,8)="X2=":
WS.Cells(8+J,9)=X2
170WS.Cells(8+J,10)="X3=":
WS.Cells(8+J,11)=X3
180WS.Cells(8+J,12)="Y=":
WS.Cells(8+J,13)=Y
190J=J+1
200NextX3,X2,X1
210End
EndSub
X1=
5
X2=
40
X3=
20
Y=
55.62565
X1=
5
X2=
40
X3=
20.95238
Y=
55.24435
X1=
5
X2=
40
X3=
21.90476
Y=
54.86306
X1=
5
X2=
40
X3=
22.85714
Y=
54.48176
X1=
5
X2=
40
X3=
23.80952
Y=
54.10047
X1=
5.114286
X2=
40
X3=
20
Y=
54.75399
X1=
5.114286
X2=
40
X3=
20.95238
Y=
54.37269
X1=
7.285714
X2=
200
X3=
39.04762
Y=
54.37269
X1=
7.285714
X2=
200
X3=
40
Y=
54.75399
X1=
7.4
X2=
200
X3=
36.19048
Y=
54.10047
X1=
7.4
X2=
200
X3=
37.14286
Y=
54.48176
X1=
7.4
X2=
200
X3=
38.09524
Y=
54.86306
X1=
7.4
X2=
200
X3=
39.04762
Y=
55.24435
X1=
7.4
X2=
200
X3=
40
Y=
55.62565
(2)用蒙特卡罗法对下列的方程进行单指标优化求出最逼近理论值的最优参数,并列出原程序
Y=34.9272+1.1785×10-3*(X2-120)^2+9.5338×10-2*(X1-6.2)*(X2-120)
+5.0045×10-3*(X2-120)*(X3-30)
X1:
5.0~7.4;X2:
40~200;X3:
20~40,实验中Y的最大值为38.09
PublicSubYHLX2()
10DimIAsLong
20DimZM,S1,S2,S3,X1,X2,X3,Y,Y1,Y2,A1,A3
30DimGAsLong,NAsLong
40DimWSAsWorksheet,WFAsWorksheetFunction
50SetWS=Application.ActiveSheet:
SetWF=Application.WorksheetFunction
60ZM=WS.Cells(8,2):
N=WS.Cells(8,4):
G=10*N
70S1=(7.4-5.0)/N:
S2=(200-40)/N:
S3=(40-20)/N
80J=1
90ForI=1ToG
100A1=Int(N*Rnd
(1))
105A2=Int(N*Rnd
(1))
110A3=Int(N*Rnd
(1))
120X1=5+A1*S1
125X2=40+A2*S2
130X3=20+A3*S3
140Y1=34.9272+1.1785E-3*(X2-120)^2+9.5338E-2*(X1-6.2)*(X2-120)
150Y2=5.0045E-3*(X2-120)*(X3-30)
160Y=Y1+Y2
170IfY180remIfY>ZMThenZM=Y
190WS.Cells(8,7)="TheResultsofOptimization"
200WS.Cells(8+J,6)="X1=":
WS.Cells(8+J,7)=X1
205WS.Cells(8+J,8)="X2=":
WS.Cells(8+J,9)=X2
210WS.Cells(8+J,10)="X3=":
WS.Cells(8+J,11)=X3
220WS.Cells(8+J,12)="Y=":
WS.Cells(8+J,13)=Y
230J=J+1
240NextI
250End
EndSub
X1=
5.047232
X2=
40.352
X3=
20.0408
Y=
55.12662
X1=
7.398512
X2=
199.2736
X3=
39.5028
Y=
55.16135
X1=
7.390592
X2=
199.6096
X3=
39.8456
Y=
55.35509
X1=
5.033888
X2=
40.0416
X3=
20.0252
Y=
55.34255
X1=
5.013632
X2=
40.0192
X3=
20.3096
Y=
55.391
X1=
5.021648
X2=
40.928
X3=
20.278
Y=
55.02587
X1=
5.03288
X2=
40.0832
X3=
20.068
Y=
55.31857
X1=
5.025968
X2=
40.3744
X3=
20.368
Y=
55.14987
X1=
7.379504
X2=
199.9424
X3=
39.1788
Y=
55.12057
4、配方均匀设计
(1)一个饲料的配方由四种主要的成分组成,根据试验条件的允许和精度的要求,需要选择UM21(214)表来安排试验,请用相应的软件生成该配方试验方案表。
I、用U21生成UM21(214)
No.
X1
X2
X3
X4
1
0.712315209
0.094190098
0.050677
0.142818
2
0.585086733
0.015092839
0.19991
0.19991
3
0.508065927
0.178961183
0.231004
0.081969
4
0.449678792
0.033794876
0.504228
0.012298
5
0.401592
0.240791
0.076632
0.280985
6
0.360195
0.055746
0.264217
0.319842
7
0.323557
0