Skip to contents

Calculate the A-optimal design under the second-order Least squares estimator

Usage

Aopt(N, u, tt, FUN, theta, num_iter = 1000)

Arguments

N

The number of sample points in the design space.

u

The discretized design space.

tt

The level of skewness between 0 to 1 (inclusive). When tt=0, it is equivalent to compute the A-optimal design under the ordinary least squares estimator.

FUN

The function to calculate the derivative of the given model.

theta

The parameter value of the model.

num_iter

Maximum number of iteration.

Value

A list that contains 1. Value of the objective function at solution. 2. Status. 3. Optimal design

Details

This function calculates the A-optimal design and the loss function under the A-optimality. The loss function under A-optimality is defined as the trace of the inverse of the Fisher information matrix

Examples

poly3 <- function(xi, theta){
  matrix(c(1, xi, xi^2, xi^3), ncol = 1)
}
Npt <- 101
my_design <- Aopt(N = Npt, u = seq(-1, +1, length.out = Npt),
   tt = 0, FUN = poly3, theta = rep(0,4), num_iter = 2000)
round(my_design$design, 3)
#>     location weight
#> 1      -1.00  0.161
#> 10     -0.82  0.001
#> 11     -0.80  0.001
#> 12     -0.78  0.001
#> 13     -0.76  0.002
#> 14     -0.74  0.002
#> 15     -0.72  0.002
#> 16     -0.70  0.002
#> 17     -0.68  0.002
#> 18     -0.66  0.002
#> 19     -0.64  0.002
#> 20     -0.62  0.002
#> 21     -0.60  0.002
#> 22     -0.58  0.002
#> 23     -0.56  0.002
#> 24     -0.54  0.002
#> 25     -0.52  0.002
#> 26     -0.50  0.001
#> 27     -0.48  0.001
#> 28     -0.46  0.001
#> 34     -0.34  0.308
#> 68      0.34  0.308
#> 74      0.46  0.001
#> 75      0.48  0.001
#> 76      0.50  0.001
#> 77      0.52  0.002
#> 78      0.54  0.002
#> 79      0.56  0.002
#> 80      0.58  0.002
#> 81      0.60  0.002
#> 82      0.62  0.002
#> 83      0.64  0.002
#> 84      0.66  0.002
#> 85      0.68  0.002
#> 86      0.70  0.002
#> 87      0.72  0.002
#> 88      0.74  0.002
#> 89      0.76  0.002
#> 90      0.78  0.001
#> 91      0.80  0.001
#> 92      0.82  0.001
#> 101     1.00  0.161
my_design$val
#> [1] 32.92169