%% Week 2 Homework — Starter
% Simulate Nsim GDP paths; compute mean/variance of final GDP; plot histogram.
% Complete the TODO sections below.

clear; clc; close all;

% ---- parameters ----
G0    = 100;        % initial GDP
g     = 0.02;       % deterministic growth per period
sigma = 0.03;       % shock std dev
T     = 20;         % number of periods
Nsim  = 100;        % number of Monte Carlo simulations
seed0 = 123;        % base seed (for reproducibility)

% ---- storage for final GDP ----
finalGDP = nan(Nsim, 1);

% ---- simulations ----
for s = 1:Nsim
    % TODO: set a different seed per run to keep results reproducible and
    % call your function to simulate one path
    % HINT:seed0 + s;

    % TODO: store the final GDP for this simulation
end

% ---- statistics ----
% TODO: compute mean and variance of finalGDP (omit NaNs just in case)
%[...]
%[...]

% Optional: print to console
%[...]
%[...]

% ---- plot histogram ----
% TODO: plot a histogram of finalGDP and format the figure
%[...]
%[...]
%[...]
%[...]
%[...]
%[...]

% ---- save outputs ----
% TODO: save the figure as PNG and FIG
%[...]
%[...]

% TODO: optionally, save the workspace for reproducibility
%[...]
