我正在使用R中的OptimalDesign库来查找功能为“ od.AA”的d最优设计。我的物理约束是我必须使用一些固定点。
是否存在:
这是示例代码:
# Create the regressors matrix for the third-degree trigonometric model
# on a "partial circle".
F.trig <- F.cube(~I(cos(x1)) + I(sin(x1)) +
I(cos(2 * x1)) + I(sin(2 * x1)) +
I(cos(3 * x1)) + I(sin(3 * x1)),
-pi/2, pi/2, 200)
# Compute the D-, A-, and IV-optimal standardized approximate designs.
res.trig.D <- od.AA(F.trig, 1, alg = "doom", crit = "D",
graph=1:7, t.max=4)
它也将这些作为构成这些点的200个候选者的子集:
> F.trig[which(res.trig.D$w.best>0),]
(Intercept) I(cos(x1)) I(sin(x1)) I(cos(2 * x1)) I(sin(2 * x1)) I(cos(3 * x1)) I(sin(3 * x1))
1 1 6.123032e-17 -1.000000000 -1.0000000 -1.224606e-16 -1.836910e-16 1.00000000
22 1 3.254852e-01 -0.945547126 -0.7881187 -6.155232e-01 -8.385272e-01 0.54485968
58 1 7.832356e-01 -0.621724976 0.2269161 -9.739143e-01 -4.277781e-01 -0.90388380
59 1 7.929527e-01 -0.609283155 0.2575481 -9.662655e-01 -3.845058e-01 -0.92312256
100 1 9.999688e-01 -0.007893367 0.9998754 -1.578624e-02 9.997196e-01 -0.02367813
101 1 9.999688e-01 0.007893367 0.9998754 1.578624e-02 9.997196e-01 0.02367813
142 1 7.929527e-01 0.609283155 0.2575481 9.662655e-01 -3.845058e-01 0.92312256
143 1 7.832356e-01 0.621724976 0.2269161 9.739143e-01 -4.277781e-01 0.90388380
179 1 3.254852e-01 0.945547126 -0.7881187 6.155232e-01 -8.385272e-01 -0.54485968
200 1 6.123032e-17 1.000000000 -1.0000000 1.224606e-16 -1.836910e-16 -1.00000000
如果我要选择某个随机点(例如索引#83)作为“必须固定”,我该如何重新运行它,并获得包含该样本位置的更新的d最优集?
> F.trig[83,]
(Intercept) I(cos(x1)) I(sin(x1)) I(cos(2 * x1)) I(sin(2 * x1)) I(cos(3 * x1)) I(sin(3 * x1))
1.0000000 0.9620794 -0.2727697 0.8511934 -0.5248522 0.6757518 -0.7371292