This function uses the Dynamic Programming (DP) solution procedure in solving the objective function for the univariate stratification problem. It calculates the objective function values using the brute-force algorithm and stores those values in the matrices and keeps a copy in my_env so that a global minimum could be obtained.
distr.optim(k, n, incf, minYk, maxYk, isFirstRun = TRUE, my_env)
returns the array filled with calculations of objective
function values
A numeric: number of strata
A numeric: is the distance*1000
A numeric: 10e-3 when k=1 and 10e-5 for k>=2
A numeric: index to access minimum elements in the matrix
A numeric: index to access maximum elements in the matrix
A boolean: TRUE/FALSE parameter
My environment my_env has various constants and calculations stored from earlier opeartions through various other functions
Karuna Reddy <karuna.reddy@usp.ac.fj>
MGM Khan <khan_mg@usp.ac.fj>