distr.optim: Dynamic programming for a distribution

View source: R/distr.optim.R

distr.optimR Documentation

Dynamic programming for a distribution

Description

Carries out the dynamic programming (DP) solution of the stratification problem, written as a mathematical programming problem (MPP), for an assumed distribution.

Usage

distr.optim(k, n, incf, minYk, maxYk, isFirstRun = TRUE, my_env)

Arguments

k

A numeric: number of strata

n

A numeric: is the distance*1000

incf

A numeric: 10e-3 when k=1 and 10e-5 for k>=2

minYk

A numeric: index to access minimum elements in the matrix

maxYk

A numeric: index to access maximum elements in the matrix

isFirstRun

A boolean: TRUE/FALSE parameter

my_env

My environment my_env has various constants and calculations stored from earlier opeartions through various other functions

Details

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.

Value

returns the array filled with calculations of objective function values

Author(s)

Karuna Reddy <karuna.reddy@auckland.ac.nz>
MGM Khan <mgm.khan@usp.ac.fj>


stratifyR documentation built on Nov. 13, 2026, 9:06 a.m.