🌍 Week 3 Homework β€” Feedback

Student: Simone Iudice
File: week3_homework_solution.m
Assignment: World Bank Real GDP & Growth (CSV version)


βœ… Overall Assessment

Result: βœ… Correct

The code reproduces the expected outputs from the reference solution:

  • The data are correctly loaded and cleaned.
  • Log GDP and growth rates are computed accurately.
  • Both figures (week3_rgdp_comparison.png and week3_rgdp_growth.png) match the assignment specification and the reference output.
  • The exported panel (clean_rgdp_panel.csv) is tidy, consistent, and correctly structured.

πŸ” Task-by-Task Check (Slides Tasks 1–8)

Task Description Status Notes
1 Import NY.GDP.MKTP.KD (real GDP, all countries) from CSV βœ… Uses detectImportOptions and readtable correctly.
2 Inspect and extract year/value pairs βœ… Correct string-to-numeric conversion; handles missing values properly.
3 Build tidy table (country/iso3, year, value) βœ… Data reshaped to long format; variable names clear.
4 Compute logs and annual growth βœ… Applies log(value) and diff(log(value))*100 grouped by country.
5 Verify US growth vs Week 1 βœ… US growth path matches reference pattern.
6 Plot Real GDP for selected countries + legend βœ… Figure week3_rgdp_comparison.png identical to reference (Spain, Italy, France, Germany).
7 Plot growth rates (subplots + average line) βœ… Figure week3_rgdp_growth.png includes subplots per country with mean line labels. Excellent implementation.
8 Export CSV panel with growth βœ… File clean_rgdp_panel.csv correctly exported.

πŸ“ˆ Numerical & Plot Consistency

  • Real GDP comparison: Line patterns and magnitudes perfectly match the reference plot. Axis labels, legend, and title are correct.
  • Growth plots: Each subplot displays correct country averages (2.11%, 1.46%, 1.88%, 1.71%) and consistent time series.
  • Data structure: clean_rgdp_panel.csv includes all required variables (CountryName, CountryCode, Year, RGDP, LogRGDP, GrowthYoY).

πŸ’¬ Style & Reproducibility

  • βœ… Clear structure: import β†’ clean β†’ compute β†’ plot β†’ export.
  • βœ… Code is fully reproducible (no hard-coded paths).
  • βœ… Comments and figure formatting show attention to detail.
  • ⚠️ Minor note: add semicolons at the end of assignment lines to avoid console clutter.

🧠 Optional Improvements

  • Add a short header comment in the script summarizing the workflow (e.g., β€œThis script builds a global real GDP panel and computes annual growth rates for selected countries.”).
  • Consider saving figures at a fixed size or resolution for consistent visual output.

🏁 Final Grade

Full marks.
Flawless execution of all tasks, matching both the structure and the expected outputs from the reference solution. Excellent clarity and reproducibility.