# ldmm: Locally D-optimal designs for Michaelis-Menten model In LDOD: Finding Locally D-optimal optimal designs for some nonlinear and generalized linear models.

## Description

Finds Locally D-optimal designs for Michaelis-Menten model which is defined as E(y) = (ax)/(1+bx) or E(y) = (ax)/(b+x) or E(y) = "x/(a+bx) with Var(y) = σ^2, where a, b and σ are unknown parameters.

## Usage

 ```1 2``` ```ldmm(a, b, form = 1, lb, ub, user.points = NULL, user.weights = NULL, ..., n.restarts = 1, n.sim = 1, tol = 1e-8, prec = 53, rseed = NULL) ```

## Arguments

 `a` initial value for paremeter a. `b` initial value for paremeter b. `form` must be `1` or `2` or `3`. If `form = 1`, then E(y)=(ax)/(1+bx); if `form = 2`, then E(y)=(ax)/(b+x); if `form = 3` then E(y)=x/(a+bx). `lb` lower bound of design interval, must be greater than or equal to 0. `ub` upper bound of design interval. `user.points` (optional) vector of user design points which calculation of its D-efficiency is aimed. Each element of `user.points` must be within the design interval. `user.weights` (optional) vector of weights which its elements correspond to `user.points` elements. The sum of weights should be 1; otherwise they will be normalized. `...` (optional) additional parameters will be passed to function `curve`. `prec` (optional) a number, the maximal precision to be used for D-efficiency calculation, in bite. Must be at least 2 (default 53), see 'Details'. `n.restarts` (optional optimization parameter) number of solver restarts required in optimization process (default 1), see 'Details'. `n.sim` (optional optimization parameter) number of random parameters to generate for every restart of solver in optimization process (default 1), see 'Details'. `tol` (optional optimization parameter) relative tolerance on feasibility and optimality in optimization process (default 1e-8). `rseed` (optional optimization parameter) a seed to initiate the random number generator, else system time will be used.

## Details

While D-efficiency is `NaN`, an increase in `prec` can be beneficial to achieve a numeric value, however, it can slow down the calculation speed.

Values of `n.restarts` and `n.sim` should be chosen according to the length of design interval.

## Value

plot of derivative function, see 'Note'.

a list containing the following values:

 `points` obtained design points `weights` corresponding weights to the obtained design points `det.value` value of Fisher information matrix determinant at the obtained design `user.eff` D-efficeincy of user design, if `user.design` and `user.weights` are not `NULL`.

## Note

To verify optimality of obtained design, derivate function (symmetry of Frechet derivative with respect to the x-axis) will be plotted on the design interval. Based on the equivalence theorem (Kiefer, 1974), a design is optimal if and only if its derivative function are equal or less than 0 on the design interval. The equality must be achieved just at the obtained points.

## Author(s)

Ehsan Masoudi, Majid Sarmad and Hooshang Talebi

## References

Masoudi, E., Sarmad, M. and Talebi, H. 2012, An Almost General Code in R to Find Optimal Design, In Proceedings of the 1st ISM International Statistical Conference 2012, 292-297.

Dette, H., Melas, V.B., Wong, W.K. (2005). Optimal design for goodness-of-fit of the MichaelisMenten enzyme kinetic function. Journal of the American Statistical Association, 100:1370-1381.

Kiefer, J. C. (1974), General equivalence theory for optimum designs (approximate theory). Ann. Statist., 2, 849-879.

`cfisher`, `cfderiv` and `eff`.
 ```1 2 3 4 5 6 7 8 9``` ```ldmm(a = 1, b = 2, form = 1, lb = 0, ub =3) # \$points: 0.375 3.000 ldmm(a = 1, b = 2, form = 2, lb = 0, ub =3) # \$points: 0.8571428 3.0000000 ldmm(a = 1, b = 2, form = 3, lb = 0, ub =3) # \$points: 0.375 3.000 ## D-effecincy computation: ldmm(a = 1, b = 2, form = 3, lb = 0, ub =3, user.points = c(.5, 3, 2), user.weights = rep(.33, 3)) # \$user.eff: 0.83174 ```