Learn R Programming

selectiongain (version 2.0.22)

multistageoptimum.grid: Function for optimizing multi-stage selection with grid algorithm for a given correlation matrix

Description

This function is used to calculate the maximum of $\Delta G$ with given correlation matrix by grid search algorithm.

Usage

multistageoptimum.grid(Vg, corr, 
num.grid=NA, width=NA, Budget, CostProd=rep(0,length(N.upper)),
CostTest=rep(1,length(N.upper)),Nf, 
detail=FALSE,alg=GenzBretz(),fig=FALSE,N.upper, N.lower)

Arguments

Vg
is true breeding value. The default value is 1.
corr
is the correlation matrix of y and X, which is introduced in function multistagecorr. The correlation matrix must be symmetric and positive-definite. Before starting the calculations, the user is recommended to check the correlation matrix.
num.grid
is the number of equally distanced points which divided the axis of $x_1$ into $num.grid_i-1$ intervals and there are $\prod_i(num.grid_i)$ grids in a n dimensional hyper cube. If the grid point is more than the maximum number of certain stage i, then th
width
is the width between the equally distanced points. The default value is NA.
Budget
contains the value of total budget.
CostProd
contains the initial costs of producing or identifying a candidate in each stage
CostTest
contains a vector with length n reflecting the cost of evaluating a candidate in the tests performed at stage i, i=1,...,n. The cost might vary in different stages.
Nf
is the number of final selected candidates.
detail
is the control parameter to decide if the result of all the grids will be given or only the maximum. The default value is FALSE.
alg
is used to switch between two algorithms. If alg = GenzBretz(), which is by default, the quasi-Monte Carlo algorithm from Genz (2009) will be used. If alg = Miwa(), the program will use the Miwa algorithm (Mi et. al., 2009), whic
fig
is the control parameter to decide if a figure of contour plot will be saved in the default folder. The default value is FALSE.
N.upper
is the vector of upper limits of number of candidates X.
N.lower
is the vector of lower limits of number of candidates X.

Value

  • If $\texttt{detail}$ = FALSE, the output of this functions is a vector with the optimal number of candidates in each stage ($\textbf{N}$) and the maximum $\Delta G$. Otherwise, the result for all the grid points, which have been calculated, will be exported as a table.

References

A. Genz and F. Bretz. Computation of Multivariate Normal and t Probabilities. Lecture Notes in Statistics, Vol. 195, Springer-Verlag, Heidelberg, 2009. A. Genz, F. Bretz, T. Miwa, X. Mi, F. Leisch, F. Scheipl and T. Hothorn. mvtnorm: Multivariate normal and t distributions. R package version 0.9-9995, 2013. G.M. Tallis. Moment generating function of truncated multi-normal distribution. Journal of the Royal Statistical Society, Series B, 23(1):223-229, 1961. W.G. Cochran. Improvent by means of selection. In: Proceedings Second Berkeley Symposium on Math Stat Prof, pp449-470, 1951. X. Mi, T. Miwa and T. Hothorn. Implement of Miwa's analytical algorithm of multi-normal distribution, R Journal, 1:37-39, 2009.

See Also

selectiongain()

Examples

Run this code
corr=matrix( c(1,       0.3508,0.3508,0.4979,
               0.3508  ,1,     0.3016,0.5630,
               0.3508,  0.3016,1     ,0.5630,
               0.4979,  0.5630,0.5630,1), 
              nrow=4  
)

Budget=200

multistageoptimum.grid( Vg=1, num.grid=11, corr=corr, Budget=Budget,
 CostProd=c(0.5,0,0), CostTest=c(0.5,1,1),Nf=5,
 N.upper=rep(Budget,3), N.lower=rep(1,3))

Run the code above in your browser using DataLab