Week 8 Homework Feedback: Felice Urciuoli
Week 8 Homework Feedback: Felice Urciuoli
Assignment: Dynamic Programming & Value Function Iteration with Population Growth
Week: 8
Date: Week 8 Assessment
⚠️ Overall Assessment
Result: ⚠️ Partial <50% Correct
This submission has a critical error: the consumption matrix is missing the (1+n) factor required for population growth. Line 16 computes cons = f + (1 - delta)*kgrid - kgrid', which is the formula for the model without population growth (n=0). The homework explicitly requires implementing the model with population growth n>0, where the consumption matrix must be cons = f + (1 - delta)*kgrid - (1+n)*kgrid'. As a result, the entire VFI computation, policy function, and simulations are for the wrong model. However, the code structure, VFI algorithm, parameter experiments, and visualization are well-implemented, showing good understanding of the computational methods. The submission demonstrates effort and technical competence, but solves the wrong economic problem. Additionally, there is no population growth parameter (n) defined anywhere in the code. The submission needs to be corrected to include the (1+n) factor and define n>0.
Task-by-Task Check
❌ Task 1: Correct Consumption Matrix with (1+n) Factor
Status: ❌ CRITICAL ERROR
- Line 16:
cons = f + (1 - delta)*kgrid - kgrid'; - WRONG: This is the formula for n=0 (no population growth)
- CORRECT: Should be
cons = f + (1 - delta)*kgrid - (1+n)*kgrid'; - Missing: No population growth parameter
nis defined in the code - This error affects all subsequent computations
✅ Task 2: Value Function Iteration Implementation
Status: ✅ Correct Algorithm (Wrong Model)
- Lines 27-36: Proper VFI loop structure
- Correct maximization:
max(util(i,:) + beta * V') - Proper convergence criterion
- BUT: Solving the wrong model (n=0 instead of n>0)
❌ Task 3: Convergence History Storage
Status: ⚠️ Partial
- Line 24:
V_history = []is initialized - Line 35:
V_history(:, iter) = Vstores each iteration - BUT: Stores ALL iterations, which may be memory-intensive
- Better to store selected iterations (e.g., every 10th iteration)
✅ Task 4: Policy Function Extraction
Status: ✅ Correct (Wrong Model)
- Line 30: Extracts policy indices:
[Vnew(i), pol_ind(i)] = max(...) - Line 38: Maps to policy function:
k_policy = kgrid(pol_ind) - BUT: Policy function is for n=0 model, not n>0
✅ Task 5: Policy Function Plot with 45° Line
Status: ✅ Correct Visualization (Wrong Model)
- Lines 48-56: Policy function plot with 45° line
- Proper formatting and labels
- BUT: Shows policy for n=0 model, not n>0
✅ Task 6: Capital Path Simulation
Status: ✅ Correct Algorithm (Wrong Model)
- Lines 58-67: Simulates capital path using policy function
- Uses interpolation correctly
- BUT: Uses policy function from n=0 model
❌ Task 7: Consumption Path Simulation
Status: ❌ Missing
- Capital path is simulated, but consumption path is not computed or plotted
- Should compute:
c_t = f(k_t) + (1-δ)k_t - (1+n)k_{t+1} - Consumption path plot is missing
✅ Task 8: Capital Path Plot
Status: ✅ Correct (Wrong Model)
- Lines 69-72: Plots capital path
- Proper labels and formatting
- BUT: Path is for n=0 model
❌ Task 9: Consumption Path Plot
Status: ❌ Missing
- Consumption path is never computed or plotted
- This is a required deliverable
✅ Task 10: Parameter Experiments
Status: ✅ Correct Structure (Wrong Model)
- Lines 74-88: Loops over β ∈ {0.90, 0.95, 0.99} and α ∈ {0.25, 0.30, 0.40}
- Uses helper function
vfi_oncefor each combination - Well-structured parameter experiments
- BUT: All experiments are for n=0 model (missing population growth)
✅ Task 11: Policy Functions for Different Calibrations
Status: ✅ Correct (Wrong Model)
- Lines 78-87: Plots policy functions for different (β, α) combinations
- Shows 45° line for steady-state visualization
- BUT: All for n=0 model
❌ Task 12: Capital Paths for Different Calibrations
Status: ❌ Missing
- Parameter experiments compute policy functions but do not simulate or plot capital paths
- Should simulate k_t for each (β, α) combination and plot them
⚠️ Task 13: Value Function Convergence Plot
Status: ⚠️ Partial
- Lines 40-46: Attempts to plot convergence
- Line 42:
step = max(1, floor(iter/5))tries to subsample - Issue: Stores ALL iterations, which may cause memory issues for long convergence
- Plot may show too many lines or run out of memory
- Better to store selected iterations explicitly
❌ Task 14: Figure Saving to Figures/ Directory
Status: ❌ Missing
- Figures are created but never saved to disk
- No
mkdir('Figures')orsaveas/exportgraphicscalls - Figures are only saved as .fig files in submission folder (not in Figures/ directory)
⚠️ Task 15: Interpretation Comments
Status: ⚠️ Partial
- Lines 92-101: Good interpretation of β effects on savings
- Missing: Interpretation of α effects
- Missing: Interpretation of population growth (n) effects (because n is not implemented)
- Missing: Discussion of how n affects steady state
Task Summary: 6/15 tasks fully correct, 6 tasks incorrect/missing, 3 tasks partial. Critical error in Task 1 affects all subsequent tasks.
Grade: ⚠️ (6/15 = 40% < 50% correct, but > 0%)
Technical Implementation
Critical Error:
-
Missing (1+n) Factor: The consumption matrix does not include the (1+n) factor required for population growth. This is the most critical requirement of the homework. The entire submission solves the n=0 model instead of the n>0 model.
-
Missing Population Growth Parameter: No variable
nis defined anywhere in the code. The homework requires n>0 (typically n=0.01).
Strengths:
- Good Code Structure: Well-organized with helper function for parameter experiments
- Proper VFI Algorithm: The VFI implementation itself is correct (just solving wrong model)
- Parameter Experiments: Good structure for looping over β and α values
- Helper Function: Clean use of
vfi_oncefunction for experiments
Issues:
- Wrong Economic Model: Entire submission is for n=0 model, not n>0 as required
- Missing Consumption Path: Consumption is never computed or plotted
- Missing Capital Paths for Experiments: Parameter experiments don’t simulate/plot capital paths
- Figure Saving: Figures not saved to Figures/ directory
- Convergence Plot Issues: Stores all iterations, which may cause memory problems
Style & Clarity
Strengths:
- Good Organization: Clear structure with helper function
- Comments: Some helpful comments in Italian
- Clean Code: Well-formatted and readable
Areas for Improvement:
- Missing Documentation: No comments explaining the population growth implementation (because it’s missing)
- Incomplete Interpretation: Missing discussion of α and n effects
- Figure Management: Need to save figures properly
Visual Output Assessment
Issues:
- Wrong Model Visualized: All plots show results for n=0 model, not n>0
- Missing Consumption Plot: Consumption path is never plotted
- Missing Capital Paths for Experiments: Parameter experiments don’t show transition dynamics
- Figures Not Saved: Figures exist but are not saved to Figures/ directory (only .fig files in submission)
What’s Present:
- Value function plot
- Policy function plot with 45° line
- Capital path plot (for baseline, not experiments)
- Policy functions for different (β, α) combinations
Suggestions for Improvement
- Fix Consumption Matrix (CRITICAL): Add population growth parameter and correct the consumption matrix:
n = 0.01; % Population growth rate cons = f + (1 - delta)*kgrid - (1+n)*kgrid'; % CORRECT formula - Add Consumption Path: Compute and plot consumption path:
cpath = zeros(T,1); for t = 1:T-1 cpath(t) = kpath(t)^alpha + (1-delta)*kpath(t) - (1+n)*kpath(t+1); end figure; plot(1:T, cpath); xlabel('Time'); ylabel('c_t'); -
Add Capital Paths for Parameter Experiments: For each (β, α) combination, simulate and plot the capital path to show how different calibrations affect transition dynamics.
- Fix Convergence Plot: Store selected iterations instead of all:
V_history = []; store_iter = [1, 5, 10, 25, 50, 100]; while diff > tol % ... VFI update ... if ismember(iter, store_iter) V_history(:,end+1) = V; end end - Save Figures Properly: Create Figures/ directory and save all plots:
if ~exist('Figures','dir'), mkdir('Figures'); end exportgraphics(gcf, 'Figures/figure_name.png', 'Resolution', 300); - Add Interpretation Comments: Include discussion of:
- How α affects steady state (higher α → higher k*)
- How n affects steady state (higher n → lower k* due to dilution)
- Comparison of effects
Summary
Felice’s submission has a critical error: the consumption matrix is missing the (1+n) factor required for population growth, and no population growth parameter (n) is defined. As a result, the entire submission solves the n=0 model instead of the n>0 model as required. However, the code structure, VFI algorithm, and parameter experiments are well-implemented, showing good technical understanding. Additionally, the submission is missing the consumption path plot, capital paths for parameter experiments, and proper figure saving. 6/15 tasks fully correct (40% < 50%), but the critical error in Task 1 means the core requirement is not met. The submission demonstrates effort and computational competence, but solves the wrong economic problem. The submission needs to be corrected to include population growth (define n>0 and add (1+n) factor in consumption matrix) before it can fully meet requirements. Once corrected, the code structure and parameter experiments show good understanding of VFI implementation.