Description Usage Arguments Details Value Note Author(s) References See Also Examples
Finds Locally Doptimal designs for Negative Binomial regression model which is defined as E(y) = λ(x) with Var(y) = σ^2λ(x)(1+(λ(x)/θ)), where y ~ NB(θ, λ(x)), λ(x) = a\exp(bx) and a, b and σ are unknown parameters.
1 2 
a 
initial value for paremeter a. 
b 
initial value for paremeter b. 
theta 
initial value for paremeter θ which is the number of successes in a sequence of Bernoulli trials, must be a Natural number. 
lb 
lower bound of design interval. 
ub 
upper bound of design interval. 
user.points 
(optional) vector of user design points which calculation of its Defficiency is aimed. Each element of 
user.weights 
(optional) vector of weights which its elements correspond to 
... 
(optional) additional parameters will be passed to function

prec 
(optional) a number, the maximal precision to be used for Defficiency 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 1e8). 
rseed 
(optional optimization parameter) a seed to initiate the random number generator, else system time will be used. 
While Defficiency is NaN
, an increase in the value of prec
can be beneficial to achieve a numeric value, however, can slow down the calculation speed.
Values of n.restarts
and n.sim
should be chosen according to the length of design interval.
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 
Defficeincy of user design, if 
To verify optimality of obtained design, derivate function (symmetry of Frechet derivative with respect to the xaxis) 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.
Ehsan Masoudi, Majid Sarmad and Hooshang Talebi
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, 292297.
RodriguezTorreblanca, C. RodriguezDiaz, J.M. (2007), Locally D and coptimal designs for Poisson and negative binomial regression models, Metrika, 66, 161172.
Kiefer, J. C. 1974, General equivalence theory for optimum designs (approximate theory), Ann. Statist., 2, 849879.
1 2 3 4 5 6 
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
Iter: 1 fn: 3.0350 Pars: 3.00000 0.81159
Iter: 2 fn: 3.0350 Pars: 3.00000 0.81159
Iter: 3 fn: 3.0350 Pars: 3.00000 0.81159
solnp> Completed in 3 iterations
$points
[1] 3.0000000 0.8115872
$weights
[1] 0.5 0.5
$det.value
[1] 20.80097
Iter: 1 fn: 3.0350 Pars: 0.81159 3.00000
Iter: 2 fn: 3.0350 Pars: 0.81159 3.00000
Iter: 3 fn: 3.0350 Pars: 0.81159 3.00000
solnp> Completed in 3 iterations
$points
[1] 3.0000000 0.8115872
$weights
[1] 0.5 0.5
$det.value
[1] 20.80097
$user.eff
[1] 0.06099
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.