Marginal

Dynamic Optimization

Optimizing over time, the core method of modern macroeconomics: multi-period choice, the Bellman equation, value function iteration, stochastic dynamic programming, job search and investment under uncertainty, continuous-time discounting, the Hamiltonian, the Keynes–Ramsey rule, the Ramsey–Cass–Koopmans model and Tobin's q.

17 lessons in 2 units

Start your free trial14 days free. No card needed.
What you'll learn

17 lessons, one small step at a time

Each lesson states its goal, then works up to it in short steps with practice after each. A placement test at the start skips what you already know.

Dynamic Programming

9 lessons
  1. Multi-period optimizationApply the Euler condition between two periods, spend lifetime wealth optimally, and trace the whole optimal consumption path.
  2. The Bellman equationIdentify the state, choice and value function of a dynamic program, and solve the cake-eating problem by guessing and verifying the value function.
  3. Value function iterationRun value function iteration, bound the remaining error when it stops, and iterate a small problem by hand.
  4. Euler equations via BellmanDerive the Euler equation from the Bellman equation with the envelope theorem, and compute consumption growth with log and with CRRA utility.
  5. Stochastic dynamic programmingCompute expected continuation values from transition probabilities, update the value of each state, and explain how policies depend on both the endogenous state and the shock.
  6. Job search as a dynamic programCompute the value of waiting in McCall's search model, decide whether to accept a wage offer, and find the reservation wage.
  7. Optimal stoppingDecide whether to stop now or wait one more period, apply the Wicksell rule, and recognize stopping problems, including the secretary problem.
  8. NPV of a perpetual projectCompute the NPV of a perpetual project that starts producing now or later.
  9. Investment under uncertaintyValue the option to wait on an irreversible investment, decide whether to invest now or wait, and find the investment threshold.

Optimal Control

8 lessons
  1. Continuous-time discountingValue continuous flows with exponential discounting, convert between continuous and yearly rates, and value perpetual and growing flows.
  2. The HamiltonianApply the Hamiltonian's first-order condition and costate equation, and interpret the costate as a shadow price.
  3. The Keynes–Ramsey ruleCompute the marginal product of capital, and derive and apply the Keynes–Ramsey rule for consumption growth.
  4. The Hotelling ruleSet up the Hotelling problem with a Hamiltonian, show that the scarcity rent rises at the interest rate, and explain why the rule must hold.
  5. The modified golden ruleFind the steady-state capital of the Ramsey model from the modified golden rule, and compare it with the golden rule.
  6. The Ramsey–Cass–Koopmans modelRead the Ramsey model's two equations and phase diagram, compute steady-state consumption, follow the saddle path, and predict the responses to shocks and policy.
  7. Transversality conditionsTell whether a debt path violates the no-Ponzi condition, and explain what transversality conditions rule out.
  8. Adjustment costs & Tobin's qCompute the investment rate from Tobin's q under adjustment costs, infer q from investment, and distinguish marginal from average q.
Sample lesson

Multi-period optimization

Goal: Apply the Euler condition between two periods, spend lifetime wealth optimally, and trace the whole optimal consumption path.

Saving for retirement, paying down a mortgage, running down a stock of oil: many economic decisions spread choices over time. The simplest case, a consumer with a fixed lifetime budget, already shows the central condition of dynamic optimization.

We will apply the Euler condition, spend lifetime wealth, and finish with the whole path.

Step 1: The Euler condition

Maximize Σβt ln ct subject to a lifetime budget Σct/(1 + r)t = W. The Lagrangian's first-order conditions, βt/ct = μ/(1 + r)t, link consumption in adjacent periods:

ct+1 = β(1 + r)·ct

Consumption rises over time exactly when the reward for waiting, 1 + r, outweighs impatience, 1/β, that is when β(1 + r) > 1; if β(1 + r) = 1 the path is flat. Example: β = 0.9 and r = 0 make consumption fall 10% a period: 500, 450, 405. A more patient consumer, with a higher β, chooses consumption that grows faster.

Step 2: Spending lifetime wealth

With log utility, the present value of each period's consumption is ct/(1 + r)t = βtc₀, so the present values are proportional to βt, and the budget gives

c₀ = W ÷ (1 + β + β² + … + βT−1)

Example: three periods with β = 0.5, r = 0 and W = 700 give c₀ = 700/1.75 = 400. As T → ∞, the sum is 1/(1 − β), so c₀ = (1 − β)·W: each period you consume a fixed fraction of remaining wealth. With β = 0.95 and W = 2,000, that is 100.

Step 3: The whole path

Combining the two: find c₀ from lifetime wealth, then grow it by β(1 + r) each period. In the three-period example, c₀ = 400 and consumption halves each period: 400, 200, 100, which uses up exactly the 700. The last period's consumption shows how far the path tilts: with β(1 + r) above 1 it would be the largest, not the smallest.

In the app, each step ends with practice questions, new ones every time, and the lesson comes back later in spaced reviews.

Start Dynamic Optimization

Lessons that need something you haven't learned yet bring it in first, from any course.

Start your free trial14 days free. No card needed.