
Advanced Modeling and Control







These tasks often rely on similarity measures, representation, and decomposition.
flowchart TD
A["Time series data"]
B["Structural model<br/>(equation / TF)"]
C["Data-driven model<br/>(neural network)"]
D["Outcomes<br/>• Simulation<br/> • Forecasting<br/>• Pattern recognition"]
A --> B
A --> C
B --> D
C --> D
%% IBM Carbon color tokens
%% Blue 60, Green 60, Purple 60, Magenta 60, Gray 90 text
classDef data fill:#65489d,stroke:#65489d,color:#ffffff;
%% color=['#65489d', '#388ecc', '#105e5d', '#9f1d54', '#4d1013']
class A data;
class B data;
class C data;
class D data;
%% Subtle thicker links, orthogonal/top-down feel
linkStyle default stroke:#525252,stroke-width:2px
Pros: interpretability, extrapolation
Cons: need detailed knowledge
Pros: flexible, captures complex patterns
Cons: less interpretable, may overfit

Transfer Functions as a Starting Point
ar(data, order) estimates AR model
Present value depends on past values in discrete time
General AR(n):
y_t = c + \sum_{i=1}^n \alpha_i y_{t-i} + \varepsilon_t
Example for AR(2):
y_t = c + \alpha_1 y_{t-1} + \alpha_2 y_{t-2} + \varepsilon_t
Properties of AR models
AR(2) in operator notation:
y_t = c + \alpha_1 y_{t-1} + \alpha_2 y_{t-2} + \varepsilon_t
can be written as
(1 + \alpha_1 z^{-1} + \alpha_2 z^{-2}) y_t = c + \varepsilon_t
y_t = \frac{c + \varepsilon_t}{1 + \alpha_1 z^{-1} + \alpha_2 z^{-2}} \,=\, \frac{c + \varepsilon_t}{A(z)}
Interpretation
The AR model acts like a filter that takes in random noise and produces the series.
The filter has only poles (all-pole system), so the effect of a shock gradually fades but never ends completely (infinite impulse response, IIR).
In contrast, some models have responses that die out completely after a fixed time (finite impulse response, FIR).
In-class Activity 2
Fit an AR model to Australia COVID-19 infection data (Australia_covid_cases.xlsx) and evaluate order selection.
ARX: Autoregressive with Exogenous Input
Exogenous Input
👉 Exogenous input = something external you can measure and that drives the system.
Why ARX?
A(q^{-1}) y(t) = B(q^{-1}) u(t-n_k) + e(t)
- A(q^{-1}): polynomial in past outputs
- B(q^{-1}): polynomial in past inputs
- n_k: input delay
- e(t): noise
m = arx(data, [na nb nk])
where na = AR order, nb = input order, nk = input delay.
A(q^{-1}) y(t) = C(q^{-1}) e(t)
- A(q^{-1}): polynomial in past outputs
- C(q^{-1}): polynomial in past noise (MA part); e(t): white noise
m = arima(p,0,q)
where p = AR order, q = MA order.
Use estimate(m, data) to fit.
A(q^{-1}) y(t) = B(q^{-1}) u(t-n_k) + C(q^{-1}) e(t)
- A(q^{-1}): past outputs; B(q^{-1}): past inputs (exogenous input)
- C(q^{-1}): noise dynamics (MA part); n_k: input delay
Integration differencing step
\nabla y(t) = y(t) - y(t-1)
Makes the series stationary before ARMA modeling

m = arima(p,d,q)
p = AR order; d = number of differences (integration order); q = order of MA part
Many possible models → need criteria to choose the best one
Avoid overfitting (too complex) and underfitting (too simple)
Common criteria
Best practice
In MATLAB
goodnessOfFitcompare(data, model1, model2, ...) → compare fit visuallyaic, fpe → return information criteriaresid(data, model) → check residuals📌 Different models suit different needs — forecasting, simulation, or understanding system dynamics.
Advanced Modeling and Control