Harold Zurcher’s dynamic considerations of engine replacement
Part of Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics.
Main Stam4Econ site | View this section in the book | Author: Fan Wang | DOI: 10.5281/zenodo.24696926
Date: 2026-11-30 | HTML | PDF | QMD
1 Harold Zurcher’s dynamic considerations of engine replacement
1.1 Relative costs of replacement and continuing operations
In “Optimal Replacement of GMC Bus Engines: An Empirical Model of Harold Zurcher” (Rust 1987), Rust develops a dynamic programming framework to analyze the decision-making process of bus engine replacement, which can be adapted to various binary choice scenarios in economics.
We present a simplified version of the model here.
State variable:
- \(x_t\) be the state variable at time \(t\) (e.g., mileage of the bus engine). There will be some \(V(x_t)\), representing the value of arriving in a period with state \(x_t\).
- HZ, importantly, does not know what \(x_{t+1}\) will be for sure, but just the distribution of random variable \(x_{t+1}\), which has the cumulative distribution function \(F(x_{t+1})\).
Choice variable:
- The decision problem at each time time \(t\) is \(i_t=0\) or \(i_t=1\), for keeping engine or replacing it. There will be a policy function \(i_t^*(x_t)\), which is the optimal decision rule for the state variable \(x_t\).
- Imagine this decision takes place at the very start of period \(t\), and maintenance cost is paid over the mileage accumulated from prior periods up to this point, \(x_t\). After maintenance or engine replacement, the bus will operate for the period either with a new engine or the old engine and incur new mileage, which will become \(x_{t+1}\) by the end of period \(t\) or the beginning of period \(t+1\).
- Normal maintenance (\(i_t =0\)):\(c(x_{t})\) period-specific cost of operation, a function of mileage \(x_t\).
- Replacement (\(i_t = 1\)): Sell the engine for \(\underline{P}\), buy new engine for \(\overline{P}\), which happen instantaneously, and begin maintenance operation under \(c(0)\), the cost of maintaining a new engine.
- Plausibly, replacement leads to higher costs in the current period, but lower costs going forward. It could also be that replacement cost is so low that HZ replaces the engine every period, or that replacement cost is so high that HZ never replaces the engine.
The engine maintenance cost facing HZ, given decision \(i_t\) and state \(x_t\), is:
\[ \text{cost}(x_t, i_t) = \text{MaintainCost}((1-i_t) x_t \mathrel{;} \theta) + i_t (\overline{P} - \underline{P}) \]
where \(\theta\) is a vector of parameters that govern the maintenance cost function. When \(i_t=1\), selling the old engine for \(\underline{P}\) and buying a new one for \(\overline{P}\) is a net cash outflow of \((\overline{P}-\underline{P})\).
Assume that the process for \(x_{t+1}\) is governed by the law of motion:
\[ x_{t+1} = \left(1-i_t\right) x_t + \epsilon_{t+1} \]
where \(\epsilon_{t+1}\) is the positive random mileage accumulated during period \(t\). Assume these shocks are independent and identically distributed across periods and independent of the current state and choice.
1.2 The decision problem to replace and value function
Suppose HZ aims to minimize the (present-value) expected cost of bus operations. Note that there are many other decisions related to running the bus company, but conditional on the routes, fleet of busses, and other factors, we are only focused on the engine replacement decision.
You can think about this from the perspective of minimizing the cost of running one bus forever, with engine replacement. We can replace the engine every 10 miles, every 100 miles, etc. What is the optimal threshold, given the uncertainty in mileage realization, and also given the cost function?
In reality, there might be an end of lifecycle for each bus, and we could solve this as a finite horizon problem, starting from the required date when the bus must be scraped. This is actually how we will solve the problem. But we will arrive at a “stationary” solution for an infinite horizon problem, not because a bus lasts forever, but because for much of a bus’s life of operation, its repair timeframe is short relative to the lifespan of the bus. Infinite horizon has one value function that applies to all periods (rather than period-specific value function in finite horizon problems).
The value function is:
\[ V(x) = \max \left( \begin{array}{c} - \text{cost}(x, 1) + \frac{1}{1+r} E_{\epsilon}V(\epsilon)\thinspace\thinspace ,\\ - \text{cost}(x, 0) + \frac{1}{1+r} E_{\epsilon_{t}} (V(x + \epsilon))\thinspace\\ \end{array} \right) \]
Alternatively, we can write this as
\[ V(x) = \max_{i \in \{0,1\}} - \text{cost}(x, i) + \frac{1}{1+r} E_{\epsilon} (V((1 - i)x + \epsilon)) \]
Now we can solve for \(i^*(x)\), the optimal decision rule for the state variable \(x\), and find the \(x^*\), the optimal threshold for replacing the engine.
1.3 Solving the infinite horizon problem backwards until convergence
How do we solve for this?
- As a general strategy, we start with some guess for \(V(x)\), call this \(V^0(x)\), and generally, this starting guess is that \(V(x) = 0\) for all \(x\).
- Then we solve the problem iterative “backwards”, find the \(V\) solution on the left-hand-side when on the right-hand-side, we have \(V^0\). Call this \(V^1(x)\). Think about the right-hand-side of the value function above as a “bellman operator”, denoted by \(T\), that takes a hypothesized value function, and spits out a new one:\(V^1(x) = T(V^0(x))\).
- We now put \(V^1(x)\) back into the right-hand-side, and solve for \(V^2(x)\):\(V^2(x) = T(V^1(x))\).
- Iterate until successive value functions are sufficiently close in the sup norm, for example, stop when \(\|V^{n+1}-V^n\|_{\infty}<\varepsilon\) for a chosen tolerance \(\varepsilon\). Under conditions that make the Bellman operator a contraction, the iterates converge to its unique fixed point \(V^*(x)=T(V^*)(x)\).
We have not discussed the integration of over the future values of \(x'\) given \(x\). This can have more or less complex structures depending on assumptions on the distribution of mileage realizations per period.
This contraction might or might not happen, for contraction to a fixed point, we want to avoid the value function from “exploding” as we iterate:
- Bounded current payoff: Over the domain of feasible \(x\) values we consider, the \(-cost(x,i)\) function needs to be “bounded”, meaning it cannot go to infinity for any \(x\) in the domain. If this is not the case, we might not be able to find a fixed point for the value function.
- Discounting: The discount factor \(\frac{1}{1+r}\) needs to be less than 1, which is the case if \(r > 0\). This ensures that future costs are discounted sufficiently, preventing the value function from exploding as we iterate and add subperiods up to infinity.
- Well defined expectation: The expectation operator \(E_{\epsilon}\) needs to be well-defined, meaning that the distribution of \(\epsilon\) should not lead to infinite expected values for the future value function.
1.4 Value function iteration from guess fo \(V^0(w)\)
With \(V^0(x)=0\) as an initial guess, the value function simplifies to:
\[ V^1(x) = \max_{i \in \{0,1\}} - \text{cost}(x, i) \]
This is also the last-period problem in a finite-horizon version, because there is no future value after the current period. Replacement may still be optimal if its net cost plus the new engine’s current maintenance cost is below the cost of operating the old engine. This does not imply that replacement is optimal every period; the comparison can change with mileage and the value of future operation.
Given \(V^1(x)\), the value function in the second to last period can be expressed as:
\[ V^2(x) = \max_{i \in \{0,1\}} - \text{cost}(x, i) + \frac{1}{1+r} E_{\epsilon} (V^1((1-i)x + \epsilon)) \]
We continue to iterate.