Optimization Techniques for Statisticians

Agricultural Statistics & Data Science · Time series, forecasting and modelling · also Optimization Techniques, Linear Programming, Mathematical Programming

10units
10chapters
5,405words
100practice questions

The optimisation theory statisticians use: linear programming with simplex and duality, transportation and assignment, integer and goal programming for farm and crop planning, non-linear optimisation with Kuhn-Tucker conditions, and the numerical optimisers inside likelihood estimation. The Agribusiness track teaches operations research for managers; this goes to the theory.

In the exams: AICE-JRF Ag Stat Unit 2 'linear programming: formulation, graphical, simplex, duality, transportation and assignment' (heavy); UPSC ISS Statistics III operations research (heavy, reported); ASRB NET Ag Stat (present)

Syllabus

  1. Linear programming: formulation and graphical solution
  2. Simplex method, Big-M and two-phase methods
  3. Duality and sensitivity analysis
  4. Transportation and assignment problems
  5. Integer programming: branch and bound
  6. Goal programming for multi-objective farm planning
  7. Non-linear programming: Lagrange multipliers and Kuhn-Tucker conditions
  8. Quadratic programming and risk programming (MOTAD)
  9. Dynamic programming
  10. Numerical optimisation: gradient, Newton and quasi-Newton methods

Study manual

Optimisation is finding the best value of an objective subject to constraints. Statisticians meet it in two ways. First, as a modelling tool in agricultural planning: choosing crop and livestock activities to maximise farm income within land, labour, water and capital limits, formulating least-cost feed rations, allocating irrigation water, transporting produce from farms to markets at least cost, and balancing income against risk. Second, as the computational engine of statistics itself: every maximum-likelihood estimate, least-squares fit, variance-component estimate and penalised regression is the solution of an optimisation problem, and understanding how optimisers work and fail is part of a statistician's craft.

The Agribusiness track's Operations Research subject teaches linear programming, transportation, assignment, networks, inventory, queues, decisions and games for managers. This subject covers the theory a statistician needs and refers to that subject for managerial applications and to the stochastic-processes subject for queues and Markov decision ideas. Its chapters are: linear programming formulation and graphical solution; the simplex method with Big-M and two-phase starts; duality and sensitivity analysis; transportation and assignment problems; integer programming and branch and bound; goal programming for multi-objective farm planning; non-linear programming with Lagrange multipliers and Kuhn-Tucker conditions; quadratic and risk programming including MOTAD; dynamic programming; and numerical optimisation by gradient, Newton and quasi-Newton methods, linked to the iterative maximum-likelihood algorithms of the estimation subject.

The ICAR AICE-JRF Agricultural Statistics paper lists linear programming (formulation, graphical method, simplex, duality, transportation and assignment) in Unit 2, which is where most examination questions come from; the Indian Statistical Service includes operations research in Statistics III; and ASRB examinations ask for formulation and interpretation. Questions are typically formulations, graphical solutions, simplex iterations, dual construction, initial transportation solutions and assignment by the Hungarian method. Worked numbers throughout are illustrative and were checked by computation, but real coefficients must come from local data.

1. Linear programming: formulation and graphical solution

Formulating a linear programme

A linear programme (LP) has decision variables, a linear objective function to maximise or minimise, and linear constraints. The standard maximisation form is: maximise z = c′x subject to Ax ≤ b and x ≥ 0. Formulation is the most important step and is where most practical errors occur: define each variable precisely with units (hectares of wheat, kilograms of maize in the ration), write the objective in consistent units (net return per hectare, cost per kilogram), and express every resource limit or requirement as an inequality or equation.

Example (farm plan): a farmer has 12 ha of land and 16 days of labour in a critical period. Wheat earns 40 (thousand rupees) per hectare and needs 2 labour-days per hectare; mustard earns 30 per hectare and needs 1 labour-day per hectare. With x hectares of wheat and y of mustard: maximise z = 40x + 30y subject to x + y ≤ 12 (land), 2x + y ≤ 16 (labour), x, y ≥ 0. Example (least-cost ration): choose kilograms of feeds to minimise cost subject to minimum protein and energy and maximum fibre; the diet problem was one of the first LPs solved.

LP assumes proportionality (returns and resource use scale linearly with activity levels), additivity, divisibility (fractional hectares allowed) and certainty (known coefficients). When these fail, integer, non-linear or stochastic programming is needed (later chapters).

Optimisation inside statistics

Several statistical procedures are themselves linear or non-linear programmes. Least absolute deviations (L1) regression, which minimises Σ|yᵢ − xᵢ′β| and is robust to outlying observations, is an LP: write each residual as the difference of two non-negative variables and minimise their sum. Quantile regression, used for modelling the lower tail of yields (yield gaps) or the upper tail of pest densities, is the same LP with asymmetric weights. Optimum allocation in stratified sampling (see Sampling Theory I) minimises the variance of the estimator for a fixed cost, a non-linear programme solved by Lagrange multipliers that gives Neyman allocation; with integer sample sizes and several variables of interest it becomes an integer or multi-objective programme. Optimal experimental designs (D-optimal, A-optimal) maximise a function of the information matrix over candidate design points. Recognising these structures lets a statistician use reliable, well-tested optimisation software instead of writing ad hoc iterations that may stop at poor solutions.

Graphical solution and special cases

With two variables the feasible region (all points satisfying the constraints) can be drawn. For linear constraints it is a convex polygon, and the fundamental theorem of linear programming states that if an optimum exists, it occurs at a vertex (corner point) of the feasible region. The graphical method draws the constraints, identifies the vertices and evaluates z at each, or slides the objective line (an iso-profit line) parallel to itself until it last touches the region.

In the farm example the vertices are (0, 0), (8, 0), (4, 8) and (0, 12), where (4, 8) is the intersection of x + y = 12 and 2x + y = 16. The objective values are 0, 320, 400 and 360, so the optimal plan is 4 ha of wheat and 8 ha of mustard, earning 400; both land and labour are fully used (binding constraints).

Special cases: the problem is infeasible if no point satisfies all constraints (conflicting requirements, such as a ration with more protein than any feed combination can supply within the weight limit); unbounded if the objective can increase without limit (usually a missing constraint); has alternative optima if the objective line is parallel to a binding edge (all points on the edge are optimal); and is degenerate if more constraints than necessary pass through an optimal vertex, which matters for the simplex method. Redundant constraints do not touch the feasible region and can be removed.

Remember

2. The simplex method

Standard form and the simplex iteration

The simplex method (Dantzig, 1947) moves from vertex to adjacent vertex of the feasible region, improving the objective at each step, until no improvement is possible. Inequalities are converted to equations: a slack variable is added to each ≤ constraint (unused resource) and a surplus variable subtracted from each ≥ constraint. A basic feasible solution sets n − m non-basic variables to zero and solves for the m basic variables; basic feasible solutions correspond to vertices.

For a maximisation problem in tableau form, each iteration: (1) chooses the entering variable, usually the one with the most negative coefficient in the objective row (zⱼ − cⱼ < 0), since increasing it raises z fastest per unit; (2) chooses the leaving variable by the minimum-ratio test, dividing the right-hand sides by the positive entries of the entering column and taking the smallest ratio, which keeps all variables non-negative; (3) pivots on the element at their intersection to obtain the new tableau. The solution is optimal when no objective-row coefficient is negative. In the farm example, starting from slacks s₁ = 12 and s₂ = 16, wheat (coefficient −40) enters, the ratios are 12/1 = 12 and 16/2 = 8, so labour's slack leaves; after one more iteration mustard enters and the optimum x = 4, y = 8, z = 400 is reached.

In detail, after the first pivot the labour row reads x + 0.5y + 0.5s₂ = 8, the land row 0.5y + s₁ − 0.5s₂ = 4, and the objective row z − 10y + 20s₂ = 320. Mustard now has the only negative coefficient (−10) and enters; the ratios are 4/0.5 = 8 (land) and 8/0.5 = 16 (labour), so land's slack leaves. Pivoting gives y = 8, x = 4 and an objective row with coefficients 20 for s₁ and 10 for s₂, all non-negative, so the solution is optimal. Those final coefficients of the slack variables are the shadow prices of land and labour, which is how duality appears inside the final tableau (Chapter 3).

Big-M, two-phase methods and degeneracy

When constraints are of the ≥ or = type, an obvious starting basis does not exist, and artificial variables are added to provide one. The Big-M method penalises artificial variables in the objective with a very large coefficient M (subtracted for maximisation, added for minimisation), so the simplex method drives them out of the basis. The two-phase method first minimises the sum of artificial variables (Phase I); if the minimum is zero, a feasible basis has been found and Phase II optimises the real objective from it; if the minimum is positive, the problem is infeasible. The two-phase method avoids the numerical problems of choosing M.

Degeneracy occurs when a basic variable takes the value zero (ties in the minimum-ratio test). A degenerate pivot does not change z, and in rare cases the method can cycle among bases indefinitely; anti-cycling rules such as Bland's smallest-index rule prevent this. Other signals in the tableau: an entering column with no positive entries means the problem is unbounded; a zero objective-row coefficient for a non-basic variable at the optimum means alternative optima exist; an artificial variable remaining positive at the end means infeasibility.

The simplex method is efficient in practice, usually needing a number of iterations of the order of a few times the number of constraints, though its worst case is exponential; interior-point methods, which move through the inside of the feasible region, are polynomial and are used alongside simplex in modern solvers for very large problems.

Remember

3. Duality and sensitivity analysis

The dual problem

Every LP (the primal) has a dual. For the primal: maximise c′x subject to Ax ≤ b, x ≥ 0, the dual is: minimise b′y subject to A′y ≥ c, y ≥ 0. Each primal constraint gives a dual variable and each primal variable a dual constraint; the dual of the dual is the primal. Equality constraints give unrestricted dual variables.

Duality theorems: weak duality says any feasible primal value is at most any feasible dual value (c′x ≤ b′y); strong duality says that if either problem has a finite optimum, so does the other, and the optimal values are equal. If the primal is unbounded the dual is infeasible. Complementary slackness: at the optimum, if a primal constraint is slack its dual variable is zero, and if a dual variable is positive its primal constraint is binding; similarly for primal variables and dual constraints.

For the farm example the dual is: minimise 12u + 16v subject to u + 2v ≥ 40 (wheat), u + v ≥ 30 (mustard), u, v ≥ 0. Both primal variables are positive, so both dual constraints are tight: u + 2v = 40 and u + v = 30 give v = 10 and u = 20, and 12 × 20 + 16 × 10 = 400 equals the primal optimum.

Shadow prices and sensitivity

The optimal dual values are shadow prices: the rate at which the optimal objective would increase per extra unit of each resource, within a range. In the farm plan, an extra hectare of land is worth 20 and an extra labour-day 10 (thousand rupees). These are the maximum prices the farmer should pay to rent land or hire labour, and the economic interpretation of duality is that resources are valued at their marginal contribution. A resource whose constraint is slack has a zero shadow price: more of it is worthless.

Sensitivity (post-optimal) analysis asks how far data can change before the optimal basis changes. Right-hand-side ranging gives the interval of each resource level over which its shadow price stays valid; objective-coefficient ranging gives the interval of each return over which the current plan stays optimal; and the reduced cost of a non-basic activity is how much its return would have to improve before it entered the plan. In the farm example, the plan (4, 8) stays optimal while the ratio of wheat to mustard returns stays between the slopes of the two binding constraints: 1 ≤ c_wheat/c_mustard ≤ 2, i.e. wheat's return between 30 and 60 with mustard at 30.

Because agricultural coefficients (yields, prices, input requirements) are uncertain, sensitivity analysis is essential: a plan that changes completely with a 5% change in a price is fragile. Parametric programming traces the solution as a coefficient varies continuously, producing supply response curves of the kind used in farm-level policy analysis. When uncertainty is central, the stochastic and risk programming of Chapter 8 is used. The dual simplex method, which keeps optimality while restoring feasibility, re-optimises efficiently after a resource level changes or a constraint is added.

Remember

4. Transportation and assignment problems

The transportation problem

The transportation problem ships a commodity from m sources with supplies aᵢ to n destinations with demands bⱼ at unit costs cᵢⱼ, minimising total cost: minimise ΣΣcᵢⱼxᵢⱼ subject to Σⱼxᵢⱼ = aᵢ, Σᵢxᵢⱼ = bⱼ, xᵢⱼ ≥ 0. It is balanced if total supply equals total demand; otherwise a dummy source or destination with zero costs absorbs the difference. A basic feasible solution has m + n − 1 positive allocations (one equation is redundant); fewer means degeneracy, handled by placing an ε allocation. Its special structure makes optimal solutions integral when supplies and demands are integers.

Initial solutions come from the north-west corner rule (simple, ignores costs), the least-cost method, or Vogel's approximation method (penalty-based, usually near-optimal). Optimality is tested by the MODI (u-v) method: solve uᵢ + vⱼ = cᵢⱼ for the basic cells (with one uᵢ set to 0), compute reduced costs dᵢⱼ = cᵢⱼ − uᵢ − vⱼ for non-basic cells, and if any is negative, bring that cell in along a closed loop of basic cells, shifting the largest amount that keeps allocations non-negative. Applications include moving grain from procurement centres to warehouses, milk from collection centres to plants, and fertiliser from factories to districts.

Example: three procurement centres with 30, 40 and 30 tonnes supply three warehouses needing 20, 40 and 40 tonnes, with unit costs [[4, 6, 8], [5, 3, 7], [6, 4, 2]]. The north-west corner rule allocates 20 and 10 from centre 1, 30 and 10 from centre 2, and 30 from centre 3 to warehouse 3: five cells (m + n − 1 = 5) at a total cost of 360. The least-cost method starts with the cheapest cell (centre 3 to warehouse 3, cost 2) and reaches a total of 340, which MODI confirms is optimal: centre 1 sends 20 to warehouse 1 and 10 to warehouse 3, centre 2 sends 40 to warehouse 2, and centre 3 sends 30 to warehouse 3. Vogel's method usually starts even closer to the optimum, saving iterations on large problems.

The assignment problem

The assignment problem allocates n jobs to n agents (tractors to fields, inspectors to districts, varieties to test sites) one-to-one, minimising total cost or time. It is a transportation problem with all supplies and demands equal to 1, highly degenerate, and is solved efficiently by the Hungarian method: subtract each row's minimum from the row, then each column's minimum from the column; cover all zeros with the minimum number of lines; if n lines are needed, an optimal assignment exists among the zeros; otherwise subtract the smallest uncovered value from all uncovered entries, add it at line intersections, and repeat. Maximisation problems are converted by subtracting each entry from the largest; unbalanced problems get dummy rows or columns; forbidden assignments get very large costs.

Example: three tractors and three fields with costs [[9, 2, 7], [6, 4, 3], [5, 8, 1]]. Row reduction gives [[7, 0, 5], [3, 1, 0], [4, 7, 0]]; column reduction subtracts 3 from column 1, giving [[4, 0, 5], [0, 1, 0], [1, 7, 0]]. Three lines are needed, so an optimal assignment uses zeros: tractor 1 to field 2 (cost 2), tractor 2 to field 1 (6), tractor 3 to field 3 (1), total 9. There are n! = 6 possible assignments here; the Hungarian method avoids enumerating them, which matters because n! grows explosively.

Remember

5. Integer programming

When variables must be integers

Many decisions are indivisible: the number of tractors to buy, whether to build a storage shed (yes/no), how many animals to keep, which fields to irrigate. Integer programming (IP) adds integrality constraints to an LP; mixed-integer programming (MIP) restricts only some variables. Binary (0-1) variables model logical conditions: a fixed cost F incurred only if an activity x is used is written Fδ + cx with x ≤ Mδ and δ ∈ {0, 1}; either-or constraints, at most k of n options, and precedence conditions are written similarly.

Rounding the LP solution is not a reliable way to solve an IP: the rounded point may be infeasible or far from optimal. The LP relaxation (dropping integrality) gives a bound: for a maximisation problem its optimum is an upper bound on the IP optimum, and any integer-feasible solution gives a lower bound. The difference between the bounds, the integrality gap, measures how close a found solution is to optimal.

Branch and bound and cutting planes

Branch and bound solves the LP relaxation; if a variable xⱼ has a fractional value f, it branches into two subproblems with xⱼ ≤ ⌊f⌋ and xⱼ ≥ ⌈f⌉, solving the LP relaxation of each. A subproblem is fathomed (no further branching) if its LP is infeasible, if its LP solution is integral (a candidate, updating the best known integer solution, the incumbent), or if its LP bound is no better than the incumbent. The search continues until all branches are fathomed; the incumbent is then optimal. The efficiency depends on good bounds and on branching choices.

Example: maximise 5x + 4y subject to 6x + 4y ≤ 24, x + 2y ≤ 6, x, y integer and non-negative. The LP optimum is x = 3, y = 1.5, z = 21. Branching on y ≤ 1 gives x = 3.33, y = 1 (z = 20.67). Branching again on x: the subproblem x ≤ 3 gives the integer point (3, 1) with z = 19, an incumbent; the subproblem x ≥ 4 gives (4, 0) with z = 20, a better integer solution that becomes the incumbent. The other branch, y ≥ 2, has LP optimum x = 2, y = 2, z = 18, below 20, so it is fathomed. The integer optimum is (4, 0) with z = 20. Rounding the LP solution (3, 1.5) down gives (3, 1) with z = 19, feasible but not optimal: exactly the trap branch and bound avoids.

Cutting-plane methods (Gomory cuts) add linear constraints that remove the fractional LP optimum without removing any integer point; modern solvers combine branching and cutting (branch and cut). Integer programs are NP-hard in general, so very large farm or supply-chain models may be solved only approximately, with reported optimality gaps.

Remember

6. Goal programming for farm planning

Multiple objectives

Farm households rarely pursue a single objective. They want income, but also food security, low risk, limited borrowing, manageable labour peaks and soil conservation. Goal programming (Charnes and Cooper) handles several goals by setting a target level for each and minimising deviations from the targets. Each goal becomes a constraint with deviational variables: fᵢ(x) + dᵢ⁻ − dᵢ⁺ = gᵢ, where dᵢ⁻ ≥ 0 measures under-achievement and dᵢ⁺ ≥ 0 over-achievement. The objective minimises the unwanted deviations: under-achievement of an income goal, over-achievement of a borrowing or labour goal, both for a target that should be met exactly.

Example: a farmer wants income of at least 300 (thousand rupees) and family labour use of at most 20 days in the peak month. With activities x₁, x₂: 40x₁ + 30x₂ + d₁⁻ − d₁⁺ = 300 and 2x₁ + x₂ + d₂⁻ − d₂⁺ = 20, minimising w₁d₁⁻ + w₂d₂⁺ subject to the hard land constraint. The weights reflect the relative importance (and units) of the goals.

With the 12-ha land limit as a hard constraint, both goals can be met exactly here: for example x₁ = 4 and x₂ = 12 − 4 = 8 gives income 400 (over-achieving the income goal, which is not penalised) and labour 16 days (within the 20-day limit), so both unwanted deviations are zero. Goal programming becomes informative when goals conflict: if the income target were raised to 450, the farmer would have to choose between falling short on income and exceeding the labour limit, and the weights or priorities decide where the compromise falls. Reporting the solutions for several weightings shows the decision maker the trade-off explicitly instead of hiding it in a single answer.

Weighted and lexicographic goal programming

In weighted goal programming the objective is a weighted sum of normalised deviations; weights must account for different units (rupees versus days), usually by dividing each deviation by its target. In lexicographic (pre-emptive) goal programming goals are ranked by priority: the highest-priority deviations are minimised first, then lower priorities are minimised without worsening higher ones. Lexicographic goal programming can be solved as a sequence of LPs or by a modified simplex method.

Goal programming is satisficing rather than optimising: it seeks a plan that comes as close as possible to aspiration levels. Its results depend heavily on targets, weights and priorities, which should be elicited from the decision maker and varied in sensitivity analysis. Related multi-criteria methods include compromise programming (minimising distance to the ideal point where every objective is at its own optimum) and multi-objective programming that traces the efficient (Pareto) frontier, of which the income-risk frontier of the next chapter is a two-objective case. These methods are widely used in farm planning, watershed management and land-use allocation, where economic, social and environmental goals conflict.

Remember

7. Non-linear programming

Lagrange multipliers

Many agricultural optimisation problems are non-linear: yield responds to fertiliser with diminishing returns, costs rise more than proportionally, and risk is a quadratic function of activity levels. For maximising f(x) subject to equality constraints gᵢ(x) = bᵢ, the Lagrangian is L(x, λ) = f(x) − Σλᵢ[gᵢ(x) − bᵢ], and necessary conditions for an optimum are ∂L/∂xⱼ = 0 for all j and the constraints themselves. The multiplier λᵢ is the rate of change of the optimal value with respect to bᵢ: a shadow price, exactly as the dual variables of LP.

Example: maximise xy subject to x + y = 10. L = xy − λ(x + y − 10); ∂L/∂x = y − λ = 0, ∂L/∂y = x − λ = 0, so x = y = λ = 5 and the maximum is 25. Increasing the constraint to 10.1 raises the optimum by about λ × 0.1 = 0.5 (exactly 5.05² = 25.5025). Second-order conditions, based on the bordered Hessian, distinguish maxima from minima. Example in production: maximise output y = 50N − 0.25N² (kg/ha, N in kg/ha) less fertiliser cost; with grain price p and nitrogen price w, the profit-maximising rate solves p(50 − 0.5N) = w, i.e. N* = 100 − 2w/p: the economic optimum lies below the yield-maximising rate of 100 kg/ha whenever fertiliser has a cost.

Kuhn-Tucker conditions

With inequality constraints gᵢ(x) ≤ bᵢ, the Karush-Kuhn-Tucker (KKT) conditions for a maximum are: stationarity, ∇f(x) = Σμᵢ∇gᵢ(x); primal feasibility, gᵢ(x) ≤ bᵢ; dual feasibility, μᵢ ≥ 0; and complementary slackness, μᵢ[gᵢ(x) − bᵢ] = 0, so a multiplier can be positive only if its constraint binds. Under a constraint qualification (for example linear constraints, or Slater's condition), the KKT conditions are necessary for a local optimum. For a concave objective and convex feasible region (convex programming) they are also sufficient, and any local optimum is global. LP is the special case in which the KKT conditions reduce to primal feasibility, dual feasibility and complementary slackness.

Example: maximise f = 10x − x² subject to x ≤ 3. Unconstrained, the maximum is at x = 5, which violates the constraint, so the constraint binds: x = 3 and stationarity 10 − 2x = μ gives μ = 4 ≥ 0, satisfying KKT. If the constraint were x ≤ 7, it would be slack, μ = 0 and x = 5. Convexity matters: with non-convex problems, such as many likelihoods for mixture models, the KKT conditions identify only local optima, and global optimisation needs multiple starts or specialised methods. Penalty and barrier methods, sequential quadratic programming and interior-point algorithms are the standard numerical approaches to constrained non-linear programmes.

A statistical example ties this chapter to sampling theory. To minimise the variance Σ Wₕ²Sₕ²/nₕ of a stratified mean subject to a total sample size Σnₕ = n, the Lagrangian gives −Wₕ²Sₕ²/nₕ² + λ = 0, so nₕ ∝ WₕSₕ: Neyman allocation. With a cost constraint Σcₕnₕ = C instead, nₕ ∝ WₕSₕ/√cₕ. When the formulas give more units than a stratum contains, or less than two, the constraint nₕ ≤ Nₕ (or nₕ ≥ 2) becomes binding and the KKT conditions show how the remaining sample is reallocated among the other strata.

Remember

8. Quadratic and risk programming

Expected income-variance (E-V) programming

Farm returns are uncertain, and a plan that maximises expected income may carry unacceptable risk. Markowitz's portfolio theory, applied to farm planning, chooses activity levels x to minimise the variance of income x′Σx (Σ the covariance matrix of activity returns per unit) subject to expected income c′x ≥ E and the resource constraints. Repeating this for a range of E traces the efficient E-V frontier: plans with the least variance for each level of expected income. A risk-averse farmer chooses a point on the frontier according to their risk preferences, for example by maximising E − (α/2)V with risk-aversion coefficient α. The problem is a quadratic programme (QP): a quadratic objective with linear constraints, solved by Wolfe's modification of the simplex method or modern QP solvers; since Σ is positive semi-definite, the problem is convex and its KKT conditions are sufficient.

Diversification works through covariances: combining crops whose returns are not perfectly correlated reduces income variance below the weighted average of their variances, which is why mixed cropping and crop-livestock systems persist as risk management. The covariance matrix is estimated from time series of activity returns (gross margins per hectare over years), so the statistical quality of those estimates (short series, trends, structural change) directly affects the plan.

MOTAD and related LP approximations

Hazell's MOTAD (minimisation of total absolute deviations, 1971) replaces variance by the mean absolute deviation of income, which can be minimised by linear programming. Using T years of observed activity returns cₜⱼ, define for each year the deviation of total income from its mean, Σⱼ(cₜⱼ − c̄ⱼ)xⱼ, split it into positive and negative parts, and minimise the sum of negative deviations (half the total absolute deviation) subject to expected income ≥ E and the resource constraints. Repeating for a range of E gives an E-A frontier. For normally distributed income the mean absolute deviation is √(2/π) ≈ 0.80 of the standard deviation, so the population standard deviation can be estimated from the mean absolute deviation by multiplying by √(π/2) ≈ 1.25 (with a small-sample correction in Hazell's original formula).

MOTAD's advantages are that it needs only LP software, handles many activities, and uses the observed joint distribution of returns without estimating a covariance matrix. Target MOTAD instead penalises shortfalls below a target income, closer to farmers' concern with failing to meet obligations, and chance-constrained programming requires that a resource or income constraint holds with a stated probability, which under normality becomes a deterministic constraint involving the mean and standard deviation. Safety-first criteria and stochastic programming with recourse (decisions before and after uncertainty is resolved) extend these ideas. All of them depend on the assumption that past variability represents future risk, which climate and market changes can undermine.

Remember

9. Dynamic programming

Stages, states and the principle of optimality

Dynamic programming (DP), developed by Bellman, solves problems that can be broken into a sequence of decisions (stages) in which each decision changes the state of the system. Bellman's principle of optimality: an optimal policy has the property that, whatever the initial state and decision, the remaining decisions form an optimal policy for the state resulting from the first decision. This gives a recursion: fₙ(s) = max over decisions d of [rₙ(s, d) + fₙ₊₁(T(s, d))], where fₙ(s) is the best value obtainable from stage n in state s, rₙ the immediate return and T the state transition. Solving backwards from the last stage gives the optimal policy for every state.

Example (resource allocation): 4 units of irrigation water are to be divided among three crops with returns (for 0, 1, 2, 3, 4 units) of crop A: 0, 5, 9, 12, 14; crop B: 0, 4, 8, 11, 13; crop C: 0, 6, 10, 12, 13. Working backwards, f_C(w) is crop C's return; f_BC(w) = max over k of [B(k) + f_C(w − k)]; and f_ABC(4) = max over k of [A(k) + f_BC(4 − k)]. The maximum total return is 19, reached by several allocations (for example 1 unit to A, 1 to B and 2 to C, giving 5 + 4 + 10; or 2 to A, 1 to B and 1 to C, giving 9 + 4 + 6). The recursion finds the optimal value and all optimal policies while evaluating far fewer combinations than complete enumeration once the problem is larger, and it reveals alternative optima that a single 'best' answer would hide.

Applications and limitations

DP suits sequential decisions under constraints: allocating water through a season as reservoir storage changes (the state is storage), deciding each year whether to replace a tractor (the state is its age), managing a herd's culling and replacement, and choosing harvest timing. With uncertainty, stochastic dynamic programming maximises expected value, with the state transition given by probabilities; Markov decision processes, with states, actions, transition probabilities (as in the Markov chains of the stochastic-processes subject) and rewards, are solved by value iteration or policy iteration. Optimal pest-control and irrigation-scheduling rules under random weather are classic agricultural applications.

The main limitation is the curse of dimensionality: the number of states grows exponentially with the number of state variables, so problems with several continuous states (storage in several reservoirs, stocks of several crops) quickly become intractable; discretisation, approximation of the value function and simulation-based methods are used. DP also underlies many statistical algorithms: the Viterbi algorithm for hidden Markov models, optimal sequence alignment in bioinformatics, and changepoint detection.

Remember

10. Numerical optimisation

Gradient and Newton methods

Statistical estimation is optimisation: maximum likelihood maximises a log-likelihood, least squares minimises a sum of squares, and penalised methods add penalty terms. Most such problems have no closed form and are solved iteratively. Gradient (steepest-ascent or descent) methods move in the direction of the gradient, θₖ₊₁ = θₖ + αₖ∇ℓ(θₖ), with a step size αₖ chosen by a line search; they need only first derivatives and are robust far from the optimum but converge slowly (linearly), zig-zagging in long narrow valleys of the objective, as happens when parameters are highly correlated.

Newton's method uses second derivatives: θₖ₊₁ = θₖ − H(θₖ)⁻¹∇ℓ(θₖ), with H the Hessian matrix. Near the optimum it converges quadratically (the number of correct digits roughly doubles per iteration), but each step needs the Hessian, which may be expensive or not negative definite far from the maximum, so steps can go the wrong way; modifications (step halving, adding a multiple of the identity to H as in the Levenberg-Marquardt method) make it reliable. Newton-Raphson and Fisher scoring for maximum likelihood (see the estimation subject) are Newton methods with the observed or expected information as −H; Gauss-Newton for non-linear least squares approximates the Hessian by J′J, with J the Jacobian of the residuals.

Quasi-Newton, derivative-free and practical points

Quasi-Newton methods build an approximation to the Hessian (or its inverse) from successive gradients, avoiding second derivatives while converging much faster than gradient methods (superlinearly). The BFGS update is the most widely used, and L-BFGS stores only a few vectors, suiting problems with many parameters. Derivative-free methods such as the Nelder-Mead simplex (unrelated to the LP simplex method) move a geometric simplex by reflection, expansion and contraction; they are useful for non-smooth objectives but slow and unreliable in high dimensions. Stochastic gradient methods, which use random subsets of the data at each step, dominate large-scale machine learning.

Practical points for statisticians: scale parameters so that they are of similar magnitude; use good starting values (moment estimates); impose constraints by transformation (estimate log σ instead of σ, logit p instead of p) so that an unconstrained optimiser can be used; check convergence by several criteria (gradient near zero, small change in parameters and objective); try several starting points when the objective may be multimodal (mixture models, some non-linear growth curves); and confirm that the Hessian at the solution is negative definite, since its inverse provides the standard errors. Reports of 'the model did not converge' usually point to over-parameterisation, poor scaling or parameters on a boundary (variance components at zero, probabilities at 0 or 1) rather than to the optimiser itself.

A one-parameter illustration: for Poisson counts with total T = 30 in n = 10 observations, the log-likelihood in λ is 30 log λ − 10λ. Newton's method from λ₀ = 2 gives λ₁ = 2 − (30/2 − 10)/(−30/4) = 2.667, then 2.963, then 2.9995, converging quadratically to the MLE 3. Reparameterising as η = log λ makes the log-likelihood 30η − 10e^η, concave everywhere, and Newton's method from any start converges without the risk of stepping to negative λ, an example of how a good parameterisation helps an optimiser.

Remember

What the exams ask

How it is used, across a career

As a student

A student must formulate LPs from word problems, solve two-variable problems graphically, carry out simplex iterations with slack, surplus and artificial variables, write duals and read shadow prices, find initial and optimal transportation solutions, solve assignments by the Hungarian method, branch and bound small integer programmes, set up goal programmes, apply Lagrange and KKT conditions, write DP recursions and explain how Newton and quasi-Newton methods compute MLEs. AICE-JRF Unit 2 and ISS papers test these directly.

Five years in

A statistician five years into work at a research institute or agribusiness builds farm-planning and least-cost ration models, transportation models for procurement and distribution, and risk-programming models of crop choice from time series of gross margins; reads shadow prices and sensitivity ranges to advise on land renting or labour hiring; and, on the statistical side, diagnoses non-convergence of likelihood and mixed-model fits by rescaling, reparameterising and changing optimisers.

Twenty-five years in

A senior statistician with twenty-five years of experience designs optimisation-based decision tools for institutions: regional crop-planning and water-allocation models, procurement and storage logistics for public food systems, and risk-management tools for farmer advisory services. Such a statistician insists on validating input coefficients, on sensitivity and scenario analysis, and on communicating that model optima are conditional on assumptions about prices, yields and risk.

PhD, twenty-five years in

A PhD with long experience develops optimisation methods and their statistical foundations: stochastic and robust programming for agricultural planning under climate uncertainty, multi-objective models for sustainability trade-offs, efficient algorithms for large penalised and mixed-model likelihoods, and dynamic programming for sequential decisions in pest and water management. Such a researcher proves convergence and optimality properties, benchmarks algorithms and supervises doctoral students.

Written from

Proofs and full simplex tableaux are sketched rather than given step by step. Not covered in depth: network-flow algorithms, interior-point methods, stochastic programming with recourse, robust optimisation, heuristics and metaheuristics (genetic algorithms, simulated annealing), and optimisation for machine learning beyond a mention. Managerial operations research (inventory, queues, decision trees, games, CPM/PERT) is in the Agribusiness track's Operations Research subject. Coefficients in worked examples are illustrative, not regional data. Statistical tables are not reproduced; questions state the values they need.

Original practice questions written to the syllabus and pattern of the exams named in each question's examTags. They are not past papers and do not reproduce any board's questions. Every numerical answer was computed with a script; the values needed are stated in the question.

Practise it, and prove it

These notes are free to read here, with no account.

What the Laisha app adds:

Free for ten days, then a subscription. We would rather write that here than have you find it later.

Open Laisha →