Package 'Boptbd'

Title: Bayesian Optimal Block Designs
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> 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.
Authors: Dibaba Bayisa Gemechu [aut, cre], Legesse Kassa Debusho [aut], Linda Haines [aut]
Maintainer: Dibaba Bayisa Gemechu <[email protected]>
License: GPL-2
Version: 1.0.5
Built: 2024-11-27 06:28:13 UTC
Source: CRAN

Help Index


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

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, v.

blk.N

integer, specifying number of blocks, b.

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. Optcrit takes the letter "A" and "D" for Bayesian A- and D-optimal block designs, respectively.

x

the object to be printed.

object

an object of class "Boptbd".

...

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 2 x b obtained Bayesain optimal block design.

Optcrtsv

score value of the optimality criteria 'Optcrit' of the resultant Bayesian optimal block design 'OptdesF'.

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

mmenuBbd, fixparBbd, intcbd

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, v.

blk.N

integer, specifying number of arrays, b.

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 Boptbd documentation for details.

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

Boptbd


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, v.

blk.N

integer, specifying number of blocks, b.

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 2 x b block design with b blocks of size k = 2 and v treatments.

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

Boptbd, fixparBbd, intcbd

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. Optcrit takes the letter "A" and "D" for Bayesian A- and D- optimal block designs, respectively.

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, v.

blk.N

integer, specifying number of blocks, b.

alpha

numeric, representing parameter of beta distribution.

beta

numeric, representing parameter of beta distribution.

OptdesF

matrix, a 2 x b obtained Bayesian optimal block design.

Optcrit

character specifying the optimality criteria to be used. Thus, Optcrit takes the letter "A" and "D" for Bayesian A- and D-optimal block designs, respectively.

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, v.

blk.N

integer, specifying number of arrays, b.

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

Boptbd, cmatbd

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)