multistageoptimal.nlm(N.upper, N.lower, corr, ini.value,
Budget, CostC, CostTv, N.fs, iterlim, alg)multistagegain.each.Budget/(CostC+sum(CostTv)+1).multistagegain.multistageoptimal.grid if detail = FALSE. However, the optimal number of candidates in each stage determined by the NLM algorithm is clearly not an integer, because the function uses a numerical algorithm, which depends on derivatives.nlm in package stats. It uses a Newton-type algorithm for searching the maximum of a multi-modal function. This algorithm depends heavily on the starting point, the maximum number of iterations and the numerical derivatives of $\Delta G$ and results in an accuracy less than four digits. For maximizing the selection gain, NLM algorithm will converge to the global maximum . A proper choice of the initial value is recommended.multistageoptimal.gridcorr=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
)
multistageoptimal.nlm(N.upper=rep(100,3), corr=corr, Budget=200, CostC=0.5, N.fs=5)Run the code above in your browser using DataLab