%% ARIMA Model

% Create data for ARIMA Model

data = readtable("iron_ore.xlsx");

t = data.Date(:);
price = data.Price(:);

figure
plot(t,price,'-','DisplayName','Iron Ore Price')
legend, grid 

%

% ARIMA model

mdl1 = arima(1,1,1);
mdl2 = arima(2,1,0);

estMdl1 = estimate(mdl1,price);
estMdl2 = estimate(mdl2,price);

y1 = simulate(estMdl1,length(price));
y2 = simulate(estMdl2,length(price));

figure();
plot(t, price, 'k', 'LineWidth',1.2); hold on
plot(t, y1, 'b--', 'LineWidth',1.2);
plot(t, y2, 'r-.', 'LineWidth',1.2);

grid on
xlabel('Time');
ylabel('Price');
title('Data and ARIMA Models Comparison');
legend({'Observed data','ARIMA model 1','ARIMA model 2'}, ...
       'Location','best','Box','off');