Version: | 1.0.7 |
Date: | 2025-05-24 |
Title: | Bayesian Optimal Block Designs |
Author: | Dibaba Bayisa Gemechu [aut, cre], Legesse Kassa Debusho [aut], Linda Haines [aut] |
Maintainer: | Dibaba Bayisa Gemechu <diboobayu@gmail.com> |
Depends: | R (≥ 3.4.0), MASS, Matrix, igraph, tcltk |
License: | GPL-2 |
Description: | Computes Bayesian A- and D-optimal block designs under the linear mixed effects model settings using block/array exchange algorithm of Debusho, Gemechu and Haines (2018) <doi:10.1080/03610918.2018.1429617> and Gemechu, Debusho and Haines (2025) <doi:10.5539/ijsp.v14n1p50> where the interest is in a comparison of all possible elementary treatment contrasts. The package also provides an optional method of using the graphical user interface (GUI) R package 'tcltk' to ensure that it is user friendly. |
NeedsCompilation: | no |
Packaged: | 2025-05-24 21:38:12 UTC; dgemechu |
Repository: | CRAN |
Date/Publication: | 2025-05-24 22:00:06 UTC |
Bayesain optimal block designs
Description
The function Boptbd
is used to compute Bayesian A- or D-optimal block designs under the linear mixed effects model settings using array/block exchange algorithm of Debusho, Gemechu and Haines (2018) and Gemechu, Debusho and Haines (2025).
Usage
Boptbd(trt.N, blk.N, alpha, beta, nrep, brep, itr.cvrgval, Optcrit = "", ...)
## Default S3 method:
Boptbd(trt.N, blk.N, alpha, beta, nrep, brep, itr.cvrgval, Optcrit = "", ...)
## S3 method for class 'Boptbd'
print(x, ...)
## S3 method for class 'Boptbd'
summary(object, ...)
Arguments
trt.N |
integer, specifying number of treatments, |
blk.N |
integer, specifying number of blocks, |
alpha |
numeric, representing the shape parameter of beta distribution. |
beta |
numeric, representing the shape parameter of beta distribution. |
nrep |
integer, specifying number of replications of the optimization procedure. |
brep |
integer, specifying number of Monte Carlo samples from a prior beta distribution. |
itr.cvrgval |
integer, specifying number of iterations required for convergence during the block exchange procedure. |
Optcrit |
character, specifying the optimality criteria to be used. |
x |
the object to be printed. |
object |
an object of class |
... |
not used. |
Details
Boptbd
computes Bayesian optimal block designs
where the interest is in a comparison of all possible elementary treatment contrasts. Under the linear mixed effects model setting,
where the block effects are assumed to be random, the treatment information matrix (C-matrix) is dependent on the unknown parameter rho
(ratio of unknown
variance components of random error and block effects). A Bayesian optimal design extends the locally optimal approach by specifying a prior distribution for the parameter rho
. Boptbd
function computes Bayesian A-
and D-
optimal
block designs via calling of two sub-functions Baoptbd
and Bdoptbd
, respectively. Each function requires an initial connected block designs
generated using the function intcbd
.
The minimum value of trt.N
and blk.N
is 3 and trt.N
should be less than or equal to blk.N - 1
.
Boptbd
perform the block exchange procedure through deletion and addition of candidate block at a time and selects a
design with best block exchange with respect to the optimality criterion value. It uses the steps of Bueno Filho and Gilmour (2007) for numerical evaluation of the
Bayesian criterion values.
nrep
takes a value of greater than or equal to 2. However, to ensure optimality of the resultant design,
the nrep
should be greater than or equal to 10 and in addition, as trt.N
and blk.N
increase,
to ensure optimality of resultant design, it is advised to further increase the value of nrep
up to greater than or equal to 100. brep
takes a value of greater than or equal to 2.
As brep
value increase, the execution time to generate Bayesian optimal design increase.
itr.cvrgval
number of iterations during exchange procedure. It takes a value between 2 and blk.N
. It is used
to speedup the computer search time by setting how long should the user should wait for the exchange process to obtain any
different (if any) design than the one that was produced as the result of the preceding exchange of the current array in the initial
design with candidate array. This is mainly effective if blk.N
is very large. For example itr.cvrgval = 2
, means the
exchange procedure will jump to the next block test if the exchange of the two preceding blocks with candidate block results with the
same efficient designs. The function will not give error message if the users set itr.cvrgval > blk.N
and it will automatically
set itr.cvrgval = blk.N
. The smaller the itr.cvrgval
means the faster the exchange procedure is, but this will reduce the
chance of getting optimal block design and users are advised to set itr.cvrgval
closer to blk.N
.
Value
Returns the resultant Bayesian A- or D-optimal block design with its corresponding score value and parametric combination
saved in excel file in a temporary directory. In addition, the function Boptbd
displays the graphical layout of the resultant Bayesian
optimal block designs. Specifically:
call |
the method call. |
v |
number of treatments. |
b |
number of blocks |
alpha |
alpha value. |
beta |
beta value. |
nrep |
number of replications of the optimization procedure. |
itr.cvrgval |
number of iterations required for convergence during the exchange procedure. |
Optcrit |
optimality criteria. |
brep |
umber of Monte Carlo samples from a prior beta distribution. |
OptdesF |
a |
Optcrtsv |
score value of the optimality criteria |
file_loc , file_loc2 |
location where the summary of the resultant Bayesian optimal block design is saved in .csv format. |
equireplicate |
logical value indicating whether the resultant Bayesian optimal block design is equireplicate or not. |
vtrtrep |
vector of treatment replication of the resultant Bayesian optimal block design. |
Cmat |
the C-matrix or treatment information matrix of the Bayesian optimal block design. |
The graphical layout of the resultant Bayesain optimal block design.
NB: The function "Boptbd" also saves the summary of the resultant Bayesian optimal block design in .csv format in a temporary directory.
Furthermore, this function reports only one final optimal block design, however, there is a possibility
of more than one optimal block designs for a given parametric combination.
The function graphoptBbd
can be used to view and rearrange the graphical layout of the resultant
optimal block design on tcltk
window. Alternative to the function Boptbd
, a
GUI tcltk window can be used to generate Bayesain optimal block designs, see mmenuBbd
and fixparBbd
.
Author(s)
Dibaba Bayisa Gemechu, Legesse Kassa Debusho, and Linda Haines
References
Bueno Filho, J. S. de S., Gilmour, S. G. and Rosa, G. J. M. (2006). Design of microarray experiments for genetical genomics studies. Genetics, 174, 945-957
Debusho, L. K., Gemechu, D. B. and Haines, L. (2018). Algorithmic construction of optimal block designs for two-colour cDNA microarray experiments using the linear mixed effects model. Communications in Statistics - Simulation and Computation, https://doi.org/10.1080/03610918.2018.1429617.
Gemechu D. B., Debusho L. K. and Haines L. M. (2025). Algorithmic Construction of Bayesian Optimal Block Designs Using the Linear Mixed Effects Model. International Journal of Statistics and Probability. 14 (1), 1-50, DOI:10.5539/ijsp.v14n1p50.
Gemechu D. B., Debusho L. K. and Haines L. M. (2014). A-optimal designs for two-colour cDNA microarray experiments using the linear mixed effects model. Peer-reviewed Proceedings of the Annual Conference of the South African Statistical Association for 2014 (SASA 2014), Rhodes University, Grahamstown, South Africa. pp 33-40, ISBN: 978-1-86822-659-7.
See Also
Examples
##To obtain Bayesian A-optimal block design for the following treatment combintions:
trt.N <- 3 #Number of treatments
blk.N <- 3 #Number of blocks
alpha <- 0.1 #alpha value
beta <- 0.1 #beta value
nrep <- 5 #Number of replications
brep <- 5 #Number of Monte Carlo samples from a prior beta distribution, Beta(0.1, 0.1)
itr.cvrgval <- 6 #Number of iterations required during the exchange procedure
Optcrit <- "A" #Optimality criteria
Baoptbd_example <- Boptbd(trt.N = 3, blk.N = 3, alpha = 0.1, beta = 0.1, nrep = 5, brep = 5,
itr.cvrgval = 6, Optcrit = "A")
summary(Baoptbd_example)
Internal function
Description
This function is for internal usage only
Usage
## Computes Bayesian A-optimal block designs
## using block/array exchange algorithm
Baoptbd(trt.N, blk.N, alpha, beta, nrep, brep, itr.cvrgval)
## Computes Bayesian D-optimal block designs
## using block/array exchange algorithm
Bdoptbd(trt.N, blk.N, alpha, beta, nrep, brep, itr.cvrgval)
Arguments
trt.N |
integer, specifying number of treatments, |
blk.N |
integer, specifying number of arrays, |
alpha |
numeric, representing shape parameter of beta distribution. |
beta |
numeric, representing shape parameter of beta distribution. |
nrep |
integer, specifying number of replications of the optimization procedure. |
brep |
integer, specifying number of Monte Carlo samples from a prior beta distribution, Beta(alpha, beta). |
itr.cvrgval |
integer, specifying number of iterations required for convergence during the exchange procedure. See |
Details
These functions are handled via a generic function Boptbd
. Please refer to the Boptbd
documentation for details.
Author(s)
Dibaba Bayisa Gemechu, Legesse Kassa Debusho, and Linda Haines
References
Debusho, L. K., Gemechu, D. B. and Haines, L. (2018). Algorithmic construction of optimal block designs for two-colour cDNA microarray experiments using the linear mixed effects model. Communications in Statistics - Simulation and Computation, https://doi.org/10.1080/03610918.2018.1429617.
Gemechu D. B., Debusho L. K. and Haines L. M. (2025). Algorithmic Construction of Bayesian Optimal Block Designs Using the Linear Mixed Effects Model. International Journal of Statistics and Probability. 14 (1), 1-50, DOI:10.5539/ijsp.v14n1p50.
Gemechu D. B., Debusho L. K. and Haines L. M. (2014). A-optimal designs for two-colour cDNA microarray experiments using the linear mixed effects model. Peer-reviewed Proceedings of the Annual Conference of the South African Statistical Association for 2014 (SASA 2014), Rhodes University, Grahamstown, South Africa. pp 33-40, ISBN: 978-1-86822-659-7.
See Also
Computes the treatment information matrix
Description
The function cmatbd
computes the information matrix (C-matrix) for treatment effects under either the linear fixed effects model or the linear mixed effects model setting for a given block design of size 2.
Usage
cmatbd(trt.N, blk.N, theta, des)
Arguments
trt.N |
integer, specifying number of treatments, |
blk.N |
integer, specifying number of blocks, |
theta |
numeric, representing function of the ratio of random block variance and random error variance. It takes any value between 0 and 1, inclusive. |
des |
matrix, a |
Value
Returns a v x v
treatment information matrix (C-matrix).
Author(s)
Dibaba Bayisa Gemechu, Legesse Kassa Debusho, and Linda Haines
References
Debusho, L. K., Gemechu, D. B. and Haines, L. (2018). Algorithmic construction of optimal block designs for two-colour cDNA microarray experiments using the linear mixed effects model. Communications in Statistics - Simulation and Computation, https://doi.org/10.1080/03610918.2018.1429617.
Gemechu D. B., Debusho L. K. and Haines L. M. (2025). Algorithmic Construction of Bayesian Optimal Block Designs Using the Linear Mixed Effects Model. International Journal of Statistics and Probability. 14 (1), 1-50, DOI:10.5539/ijsp.v14n1p50.
Gemechu D. B., Debusho L. K. and Haines L. M. (2014). A-optimal designs for two-colour cDNA microarray experiments using the linear mixed effects model. Peer-reviewed Proceedings of the Annual Conference of the South African Statistical Association for 2014 (SASA 2014), Rhodes University, Grahamstown, South Africa. pp 33-40, ISBN: 978-1-86822-659-7.
See Also
Examples
##Information matrix
trt.N <- 3
blk.N <- 3
theta <- 0.2
des <- intcbd(trt.N = 4, blk.N = 3)
cmatbd(trt.N, blk.N, theta, des)
Sets parametric values
Description
The function fixparbd
creates a tcltk
widow that allows users to set or fix values for the parametric combinations to compute Bayesian optimal block designs.
Usage
fixparBbd(Optcrit)
Arguments
Optcrit |
character, specifying the optimality criteria to be used. |
Details
fixparBbd
creates a pop-up tcltk window that allows users to set
the parametric combinations to compute optimal or near-optimal block designs. The parameters include the number of treatments, number blocks,
alpha and betha value, number of replications of the optimization procedure nrep
, number of Monte Carlo samples brep
and number of iterations required during exchange procedure itr.cvrgval
.
Furthermore, on this window, the checkbox options that allow the users to choose whether or not they need to have the graphical
layout of the resultant Bayesian optimal block design and to print the summary of the resultant Bayesian optimal design on
R-console directly are available.
After setting all the required parametric combinations and selecting the algorithm of interest,
clicking on the search button on the set parametric combinations tcltk window, similar to the results that
can be obtained when using the function Boptbd
, the summary of the resultant Bayesian optimal
block design is also saved in a temporary directory in .csv format and it will also be displayed on R console with
graphical layout of the resultant Bayesian optimal block designs.
Value
The fixparBbd
function creates a pop-up tcltk window that allows users to set
the parametric combinations to compute Bayesian optimal block designs.
Author(s)
Dibaba Bayisa Gemechu, Legesse Kassa Debusho, and Linda Haines
See Also
Boptbd
, mmenuBbd
, tcltk
, TkWidgets
Creates the graphical layout of resultant optimal design
Description
The function graphoptBbd
creates the graphical layout of resultant Bayesian A-, or D-optimal block design on a separate pop-up GUI tcltk window.
Usage
graphoptBbd(trt.N, blk.N, alpha, beta, OptdesF, Optcrit)
Arguments
trt.N |
integer, specifying number of treatments, |
blk.N |
integer, specifying number of blocks, |
alpha |
numeric, representing parameter of beta distribution. |
beta |
numeric, representing parameter of beta distribution. |
OptdesF |
matrix, a |
Optcrit |
character specifying the optimality criteria to be used. Thus, |
Details
Detail discussions concerning the constructions of a graphs can be found in igraph
R package.
Value
Returns the graphical layout of the resultant Bayesian optimal block design 'OptdesF
' on a separate pop-up window. Furthermore, the function saves the graphical layout of the resultant Bayesain optimal block design in .pdf format in a temporary directory.
Note
When closing a pop-up window for graphical layout of the resultant designs (Graph plot), if the window is closed by
clicking on the red button with "X" sign (top-right), the warning message "Warning message: In rm(list = cmd,
envir = .tkplot.env):
object 'tkp ...' not found"
will occur in R-console irrespective of what command is executed next. To resolve this warning message, click
on "close
" menu that is located at the top-left of the graph plot pop-up window when closing this window.
Author(s)
Dibaba Bayisa Gemechu, Legesse Kassa Debusho, and Linda Haines
See Also
igraph
Examples
##To create the graphical layout of the D-optimal block design
##obtained using the treatment exchange algorithm for
trt.N <- 10 #Number of treatments
blk.N <- 10 #Number of blocks
alpha <- 0.1 #alpha value
beta <- 0.1 #beta value
OptdesF <- rbind(1:10, c(2:10,1)) #Bayesian A-optimal block design (loop design)
graphoptBbd(trt.N = 10, blk.N = 10, alpha = 0.1, beta = 0.1, OptdesF, Optcrit = "A")
Generates initial connected block design
Description
The function intcbd
generates a random initial connected block design for a given number of blocks b
of size k = 2
and the number of treatments v
.
Usage
intcbd(trt.N, blk.N)
Arguments
trt.N |
integer, specifying number of treatments, |
blk.N |
integer, specifying number of arrays, |
Value
Returns a 2 x b
connected block design with b
blocks of size k = 2
and number of treatments v
.
Author(s)
Dibaba Bayisa Gemechu, Legesse Kassa Debusho, and Linda Haines
References
Debusho, L. K., Gemechu, D. B., and Haines, L. M. (2018). Algorithmic construction of optimal block designs for two-colour cDNA microarray experiments using the linear mixed model.
Gemechu D. B., Debusho L. K. and Haines L. M. (2025). Algorithmic Construction of Bayesian Optimal Block Designs Using the Linear Mixed Effects Model. International Journal of Statistics and Probability. 14 (1), 1-50, DOI:10.5539/ijsp.v14n1p50.
Gemechu D. B., Debusho L. K. and Haines L. M. (2014). A-optimal designs for two-colour cDNA microarray experiments using the linear mixed effects model. Peer-reviewed Proceedings of the Annual Conference of the South African Statistical Association for 2014 (SASA 2014), Rhodes University, Grahamstown, South Africa. pp 33-40, ISBN: 978-1-86822-659-7.
See Also
Examples
#Initial connected block design for
trt.N <- 4 #Number of treatments
blk.N <- 4 #Number of blocks
intcbd(trt.N = 4, blk.N = 3)
Creates the main menu tcltk window
Description
Alternative to directly using the function Boptbd
on the R console, the function mmenuBbd
creates the main menu tcltk window with the list of two optimality criteria (A and D) for search of Bayesian optimal block designs.
Usage
mmenuBbd()
Details
The main menu window created using the function mmenuBbd
contains the list of two optimality criteria (the A- and D) for block designs that allows user to choose an optimality criterion of interest. The function
will then call for function fixpaBrbd
for further option regarding the setup of parametric combinations and output, see fixparBbd
documentation.
Author(s)
Dibaba B. Gemechu, Legesse K. Debusho, and Linda M. Haines