Week 7 Homework - Common Errors Summary

Document Date: Week 7 Homework Assessment
Purpose: Summary of recurring mistakes to present to students in class


πŸ“Š Overall Statistics

  • Total students assessed: 20
  • Passing (β‰₯50%): 18 students (90%)
  • Partial (<50%): 2 students
  • Incorrect submission: 1 student (wrong homework assignment)
  • Critical error frequency: Missing steady-state reference lines affected 15+ students

πŸ”΄ Critical Error #1: Missing Steady-State Reference Lines on Plots

Error Description:

Most students plotted the transition paths of k_t and y_t/A_t but did not include horizontal reference lines showing the steady-state levels for each scenario.

Wrong Implementation:

% Plot k_t for three scenarios
figure;
for i = 1:3
    n = scenarios(i,1);
    g = scenarios(i,2);
    [k, y, c, A] = simulate_growth_tech(alpha, s, delta, n, g, k0, A0, T);
    plot(1:T, k, 'LineWidth', 1.5); hold on;
end
xlabel('Time'); ylabel('k_t');
title('Transition paths of k_t');
legend('n=0,g=0','n=0.01,g=0.02','n=0.02,g=0.03');
% ❌ WRONG: No steady-state reference lines!

Correct Implementation:

% Plot k_t for three scenarios WITH steady-state lines
figure;
for i = 1:3
    n = scenarios(i,1);
    g = scenarios(i,2);
    [k, y, c, A] = simulate_growth_tech(alpha, s, delta, n, g, k0, A0, T);
    plot(1:T, k, 'LineWidth', 1.5); hold on;
    
    % Calculate and plot steady-state reference line
    k_star = (s / (delta + n + g + n*g))^(1/(1-alpha));
    yline(k_star, '--', sprintf('k* (n=%.2f, g=%.2f)', n, g), ...
        'LabelHorizontalAlignment','left');
end
xlabel('Time'); ylabel('k_t');
title('Transition paths of k_t');
legend('n=0,g=0','n=0.01,g=0.02','n=0.02,g=0.03','Location','best');
grid on;
% βœ… CORRECT: Steady-state lines included for visual comparison

Why This Is Critical:

  • Homework explicitly requires steady-state reference lines on both plots
  • Visual comparison of convergence paths to target levels
  • Demonstrates understanding of steady-state calculations
  • Makes it clear how different (n, g) combinations affect steady-state levels
  • Frequency: Affected 15+ students (most common error, ~75% of submissions)

πŸ”΄ Error #2: Missing Steady-State Summary Output

Error Description:

Many students calculated steady-state values but did not print them to the command window or create a summary table.

Wrong Implementation:

% Calculate steady states but don't print
for i = 1:3
    n = scenarios(i,1);
    g = scenarios(i,2);
    k_star = (s / (delta + n + g + n*g))^(1/(1-alpha));
    y_star = k_star^alpha;
    % ❌ WRONG: Values calculated but never displayed
end

Correct Implementation:

% Calculate and PRINT steady states
fprintf('\nSteady State Analysis:\n');
fprintf('=====================\n');
for i = 1:3
    n = scenarios(i,1);
    g = scenarios(i,2);
    k_star = (s / (delta + n + g + n*g))^(1/(1-alpha));
    y_star = k_star^alpha;
    
    fprintf('Scenario %d: n=%.3f, g=%.3f\n', i, n, g);
    fprintf('  Steady-state k* = %.4f\n', k_star);
    fprintf('  Steady-state (y/A)* = %.4f\n', y_star);
    fprintf('\n');
end
% βœ… CORRECT: Quantitative summary provided

Why This Matters:

  • Provides quantitative backing for interpretation
  • Makes it easy to compare steady-state levels across scenarios
  • Explicit homework requirement
  • Demonstrates understanding of steady-state calculations
  • Frequency: Affected 12+ students (~60% of submissions)

🟠 Error #3: Missing Steady-State Lines on y_t/A_t Plot

Error Description:

Some students added steady-state reference lines to the k_t plot but forgot to add them to the y_t/A_t plot.

Wrong Implementation:

% Plot k_t with steady-state lines βœ…
figure(1);
for i = 1:3
    [k, y, c, A] = simulate_growth_tech(...);
    plot(1:T, k); hold on;
    k_star = ...;
    yline(k_star, '--');  % βœ… Has steady-state line
end

% Plot y_t/A_t WITHOUT steady-state lines ❌
figure(2);
for i = 1:3
    [k, y, c, A] = simulate_growth_tech(...);
    plot(1:T, y./A); hold on;
    % ❌ WRONG: Missing yline for (y/A)*
end

Correct Implementation:

% Plot y_t/A_t WITH steady-state lines
figure(2);
for i = 1:3
    [k, y, c, A] = simulate_growth_tech(...);
    plot(1:T, y./A); hold on;
    
    % Calculate and plot steady-state for y/A
    k_star = (s / (delta + n + g + n*g))^(1/(1-alpha));
    yA_star = k_star^alpha;  % (y/A)* = k*^alpha
    yline(yA_star, '--', sprintf('(y/A)* (n=%.2f, g=%.2f)', n, g));
end
% βœ… CORRECT: Both plots have steady-state reference lines

Why This Matters:

  • Homework requires steady-state lines on both plots
  • Visual consistency across figures
  • Complete analysis of per-effective-worker variables
  • Frequency: Affected 8+ students (~40% of submissions)

🟠 Error #4: Figures Saved to Wrong Location

Error Description:

Saving figures to the root directory instead of a Figures/ folder.

Wrong Implementation:

figure;
plot(...);
saveas(gcf, 'k_paths.png');  % ❌ WRONG: Saves to current directory
saveas(gcf, 'yA_paths.png');

Correct Implementation:

% Create Figures folder if it doesn't exist
if ~exist('Figures','dir')
    mkdir('Figures');
end

figure;
plot(...);
saveas(gcf, fullfile('Figures', 'k_paths.png'));  % βœ… CORRECT
saveas(gcf, fullfile('Figures', 'yA_paths.png'));
% OR
exportgraphics(gcf, fullfile('Figures', 'k_paths.png'), 'Resolution', 300);

Why This Matters:

  • Organization: all figures in one location
  • Cleaner workspace
  • Easier to find and review figures
  • Professional code structure
  • Frequency: Affected 5-6 students (~25-30% of submissions)

🟠 Error #5: Incorrect or Incomplete Convergence Speed Discussion

Error Description:

Some students incorrectly stated that higher n and g slow down convergence, or did not explain the mechanism.

Wrong Interpretation:

% ❌ WRONG Interpretation:
% When g > 0, convergence becomes slower because the economy
% needs more time to adjust to the new steady state.

Correct Interpretation:

% βœ… CORRECT Interpretation:
% Higher n and g increase the effective depreciation rate
% (delta + n + g + n*g), which creates a stronger restoring
% force. This makes the economy converge FASTER to its steady
% state. The denominator (1+n)(1+g) in the law of motion
% increases the rate at which capital per effective worker
% adjusts toward k*.

Why This Matters:

  • Demonstrates understanding of the economic mechanism
  • Correct interpretation of the model dynamics
  • Shows comprehension of effective depreciation concept
  • Frequency: Affected 3-4 students (~15-20% of submissions)

🟑 Error #6: Re-running Function Instead of Storing Results

Error Description:

Calling simulate_growth_tech() multiple times for the same scenario instead of storing results and reusing them.

Inefficient Implementation:

% First loop: plot k_t
for i = 1:3
    [k, y, c, A] = simulate_growth_tech(...);
    plot(1:T, k); hold on;
end

% Second loop: plot y_t/A_t (re-runs function!)
for i = 1:3
    [k, y, c, A] = simulate_growth_tech(...);  % ❌ INEFFICIENT: Re-runs
    plot(1:T, y./A); hold on;
end

Efficient Implementation:

% Store results in arrays/cells
k_results = zeros(T, 3);
y_results = zeros(T, 3);
A_results = zeros(T, 3);

for i = 1:3
    [k, y, c, A] = simulate_growth_tech(...);
    k_results(:, i) = k;
    y_results(:, i) = y;
    A_results(:, i) = A;
end

% Reuse stored results for plotting
figure(1);
for i = 1:3
    plot(1:T, k_results(:, i)); hold on;
end

figure(2);
for i = 1:3
    plot(1:T, y_results(:, i) ./ A_results(:, i)); hold on;
end
% βœ… EFFICIENT: Function called once per scenario

Why This Matters:

  • More efficient code (avoids redundant calculations)
  • Demonstrates good programming practice
  • Easier to modify and extend
  • Frequency: Affected 4-5 students (~20-25% of submissions)

🟑 Error #7: Wrong Parameters

Error Description:

Using parameters that don’t match the homework specification.

Wrong Parameters:

T = 50;      % ❌ WRONG: Should be T = 80
k0 = 0.5;    % ❌ WRONG: Should be k0 = 3.1201

Correct Parameters:

T = 80;      % βœ… CORRECT: As specified in homework
k0 = 3.1201; % βœ… CORRECT: As specified in homework
A0 = 1;      % βœ… CORRECT
alpha = 0.4;
delta = 0.1;
s = 0.3;

Why This Matters:

  • Enables direct comparison with reference solutions
  • Ensures consistent results across students
  • Homework explicitly specifies these values
  • Frequency: Affected 2-3 students (~10-15% of submissions)

🟑 Error #8: Missing Interpretation or Incomplete Discussion

Error Description:

Not providing written comments addressing both homework questions, or providing incomplete interpretation.

Required Elements:

% Interpretation should address:
% 1. How do higher n and g affect steady-state levels
%    of k* and (y/A)* per effective worker?
% 2. What happens to convergence speed when g > 0?

Good Example:

% Interpretation:
% 1. Steady-state effects:
%    - Higher n and g increase the effective depreciation
%      term (delta + n + g + n*g), which reduces both
%      k* and (y/A)* per effective worker.
%    - Population growth dilutes capital across more workers.
%    - Technology growth increases effective labor, requiring
%      more capital to maintain the same capital per effective worker.
%
% 2. Convergence speed:
%    - Higher n and g increase convergence speed because
%      they raise effective depreciation, creating a stronger
%      restoring force toward steady state.
%    - The denominator (1+n)(1+g) in the law of motion
%      accelerates adjustment.

Why This Matters:

  • Explicit homework requirement
  • Demonstrates understanding of economic mechanisms
  • Shows ability to interpret model results
  • Frequency: Affected 2-3 students (~10-15% of submissions)

🟑 Error #9: Function Embedded in Script Instead of Separate File

Error Description:

Defining simulate_growth_tech as a nested function or at the end of the main script instead of in a separate .m file.

Acceptable but Not Ideal:

% Main script
clear; close all; clc;
% ... parameters ...

% Function defined at end of script
function [k, y, c, A] = simulate_growth_tech(...)
    % ... function body ...
end
% ⚠️ ACCEPTABLE but not ideal - should be separate file

Preferred:

% Main script: week7_homework.m
clear; close all; clc;
% ... parameters ...
% Calls simulate_growth_tech.m (separate file)

% Separate file: simulate_growth_tech.m
function [k, y, c, A] = simulate_growth_tech(...)
    % ... function body ...
end
% βœ… PREFERRED: Separate, reusable function file

Why This Matters:

  • Better code organization
  • Function can be reused across scripts
  • Easier to test and debug
  • Matches homework structure expectations
  • Frequency: Affected 2-3 students (~10-15% of submissions)

πŸ“ Good Practices Observed

βœ… Excellent Implementations:

  1. Complete steady-state overlays: Several students included yline on both plots with proper labels
  2. Comprehensive summaries: Many students printed steady-state values in formatted tables
  3. Efficient code: Several students stored results and reused them for plotting
  4. Professional figure management: Most students saved figures properly in Figures/ folder
  5. Clear interpretation: Many students provided thorough, well-structured interpretation comments

βœ… Strong Code Organization:

  • Separate function files (simulate_growth_tech.m)
  • Good documentation and comments
  • Proper preallocation of arrays
  • Organized output with formatted fprintf statements
  • Cell arrays or matrices for storing multiple scenario results

βœ… Good Mathematical Understanding:

  • Correct steady-state formula: k* = (s / (delta + n + g + n*g))^(1/(1-alpha))
  • Proper understanding of effective depreciation concept
  • Correct interpretation of convergence speed mechanisms
  • Recognition that higher n and g reduce steady-state levels but increase convergence speed

βœ… Outstanding Features:

  • Some students included half-life convergence analysis
  • Comprehensive output with steady-state comparisons
  • Professional figure styling with proper labels, legends, and grid
  • Multiple figure formats (PNG and PDF) saved
  • Bonus analysis (e.g., convergence speed plots)

🎯 Key Teaching Points for Class Discussion

1. Steady-State Reference Lines

  • Always include yline overlays on both k_t and y_t/A_t plots
  • Calculate steady states using: k* = (s / (delta + n + g + n*g))^(1/(1-alpha))
  • Use (y/A)* = k*^alpha for output per effective worker
  • Label lines clearly to identify each scenario
  • Makes convergence paths visually comparable to target levels

2. Steady-State Summary Output

  • Always print steady-state values using fprintf or create a table
  • Provides quantitative backing for interpretation
  • Makes it easy to compare across scenarios
  • Demonstrates understanding of calculations

3. Convergence Speed Interpretation

  • Higher n and g increase convergence speed (not decrease)
  • Mechanism: higher effective depreciation creates stronger restoring force
  • The denominator (1+n)(1+g) in the law of motion accelerates adjustment
  • This is counterintuitive but mathematically correct

4. Code Efficiency

  • Store simulation results in arrays/cells during first loop
  • Reuse stored results for plotting instead of re-running function
  • More efficient and demonstrates good programming practice

5. File Organization

  • Create Figures/ directory at start of script with mkdir guard
  • Always save figures to Figures/ folder, not current directory
  • Use fullfile() for cross-platform compatibility
  • Save in appropriate formats (PNG, PDF, or both)

6. Complete Interpretation

  • Address both homework questions explicitly:
    1. How n and g affect steady-state levels per effective worker
    2. What happens to convergence speed
  • Use per-effective-worker perspective for conclusions
  • Explain the economic mechanisms, not just state results

πŸ“ˆ Grade Distribution Summary

  • βœ… More than 50% Correct: 18 students (90%)
  • ⚠️ Partial <50% Correct: 2 students (10%)
  • ❌ Incorrect/Incomplete: 1 student (wrong homework assignment)

Most common grade: βœ… (Passing)

Key takeaway: Most students demonstrated solid understanding of the Solow model with technological change and population growth. The most common issue was missing steady-state reference lines on plots (~75% of submissions), followed by missing steady-state summary output (~60%). Overall performance was strong, with 90% of students passing the homework. The main areas for improvement are visual completeness (steady-state lines) and quantitative summaries.


πŸ’‘ Recommendations for Future Classes

  1. Emphasize steady-state reference lines - Make it explicit that BOTH plots need yline overlays
  2. Provide example of complete plots - Show template with steady-state lines clearly marked
  3. Highlight steady-state summary requirement - Provide structure/guidelines for fprintf output
  4. Clarify convergence speed mechanism - Explain why higher n and g increase (not decrease) convergence speed
  5. Include file organization checklist - Ensure Figures/ folder creation and proper saving
  6. Encourage result storage - Show efficient pattern of storing and reusing simulation outputs
  7. Provide interpretation template - Give structure for addressing both homework questions

πŸ“š Excellent Submission Examples

Outstanding Features Observed:

  1. Complete Visual Analysis:
    • Steady-state lines on both plots with clear labels
    • Professional figure styling with proper formatting
    • Both PNG and PDF formats saved
    • High-quality figures with grid and legends
  2. Comprehensive Quantitative Summary:
    • Formatted fprintf output with steady-state values
    • Comparison tables across scenarios
    • Clear presentation of results
  3. Excellent Interpretation:
    • Directly addresses both homework questions
    • Thoughtful discussion of economic mechanisms
    • Correct understanding of convergence speed
    • Clear explanation of steady-state effects
  4. Advanced Features:
    • Half-life convergence analysis (observed in some submissions)
    • Bonus convergence speed plots
    • Comprehensive formatted output tables
    • Efficient code with stored results

πŸ”„ Comparison with Previous Weeks

Week 5 vs Week 6 vs Week 7:

  • Week 5: More critical algorithmic errors (bisection function value updates) - 81% pass rate
  • Week 6: Errors more about completeness (timing, plots) - 100% pass rate
  • Week 7: Errors primarily about visual completeness (steady-state lines) and summaries - 90% pass rate
  • Week 7 students demonstrated good understanding of model economics but need improvement on presentation completeness
  • Week 7 errors are easier to fix (add lines, print values) vs Week 5’s fundamental algorithm issues

Common theme across weeks:

  • Missing deliverables (figures, summaries, lines) rather than fundamental errors
  • Good understanding of core concepts but incomplete implementation
  • Need for better attention to homework requirements checklist