R: Locally D-optimal designs for Inverse Quadratic model
ldiq
R Documentation
Locally D-optimal designs for Inverse Quadratic model
Description
Finds Locally D-optimal designs for Inverse Quadratic regression model which is defined as E(y)=ax/(b+x+cx^2) or E(y)=x/(a+bx+cx^2) with Var(y) = σ^2, where a, b, c and σ are unknown parameters.
must be 1 or 2. If form = 1, then E(y)=ax/(b+x+cx^2); if form = 2, then E(y)=x/(a+bx+cx^2).
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
For each form of Inverse Quadratic model, the parameters must satisfy specific conditions:
if form = 1
a,b,c>0, 2√(bc)>1,
if form = 2
a,c>0, |b|<√(ac),
for more details see Dette and Kiss (2009).
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.
Kiefer, J. C. (1974), General equivalence theory for optimum designs (approximate theory). Ann. Statist., 2, 849-879.
See Also
cfisher, cfderiv and eff.
Examples
ldiq(a = 17 , b = 15, c = 9, form = 1, lb = 0, ub = 15)
# $points: 0.4141466 1.2909896 4.0242083
## D-effecincy computation
ldiq(a = 17 , b = 15, c = 9, form = 2, lb = 0, ub = 15, user.points = c(10,2,4),
user.weights = c(.33, .33, .33)) # $user.eff: 0.18099
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(LDOD)
Loading required package: Rsolnp
Loading required package: Rmpfr
Loading required package: gmp
Attaching package: 'gmp'
The following objects are masked from 'package:base':
%*%, apply, crossprod, matrix, tcrossprod
C code of R package 'Rmpfr': GMP using 64 bits per limb
Attaching package: 'Rmpfr'
The following objects are masked from 'package:stats':
dbinom, dnorm, dpois, pnorm
The following objects are masked from 'package:base':
cbind, pmax, pmin, rbind
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LDOD/ldiq.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ldiq
> ### Title: Locally D-optimal designs for Inverse Quadratic model
> ### Aliases: ldiq
> ### Keywords: optimal design Invesre Quadratic equivalence theorem
>
> ### ** Examples
>
> ldiq(a = 17 , b = 15, c = 9, form = 1, lb = 0, ub = 15)
Iter: 1 fn: 31.6295 Pars: 1.29106 4.02466 0.41416
Iter: 2 fn: 31.6295 Pars: 1.29100 4.02429 0.41415
solnp--> Completed in 2 iterations
$points
[1] 0.4141496 1.2910030 4.0242887
$weights
[1] 0.3333333 0.3333333 0.3333333
$det.value
[1] 1.834341e-14
> # $points: 0.4141466 1.2909896 4.0242083
>
> ## D-effecincy computation
> ldiq(a = 17 , b = 15, c = 9, form = 2, lb = 0, ub = 15, user.points = c(10,2,4),
+ user.weights = c(.33, .33, .33)) # $user.eff: 0.18099
Iter: 1 fn: 47.4638 Pars: 1.37432 5.62444 0.33582
Iter: 2 fn: 47.4638 Pars: 1.37437 5.62470 0.33582
solnp--> Completed in 2 iterations
$points
[1] 0.3358194 1.3743703 5.6247017
$weights
[1] 0.3333333 0.3333333 0.3333333
$det.value
[1] 2.436331e-21
$user.eff
[1] 0.18099
>
>
>
>
>
> dev.off()
null device
1
>