Aopt | R Documentation |

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

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

`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. |

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

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

```
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)
my_design$val
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.