Advanced Modeling and Control
These tasks often rely on similarity measures, representation, and decomposition.
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 modelPresent value depends on past values in discrete time
General AR(n):
yt=c+i=1∑nαiyt−i+εt
Example for AR(2):
yt=c+α1yt−1+α2yt−2+εt
Properties of AR models
AR(2) in operator notation:
yt=c+α1yt−1+α2yt−2+εt
can be written as
(1+α1z−1+α2z−2)yt=c+εt
yt=1+α1z−1+α2z−2c+εt=A(z)c+εt
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−nk)+e(t) - A(q−1): polynomial in past outputs
- B(q−1): polynomial in past inputs
- nk: 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−nk)+C(q−1)e(t) - A(q−1): past outputs; B(q−1): past inputs (exogenous input)
- C(q−1): noise dynamics (MA part); nk: input delay
Integration differencing step
∇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
goodnessOfFit
compare(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