Study Vault Search notes, aliases and full text
Graph
LectureMSIAI-written · proofread

VL01 Introduction

What a model is and why we identify one, the notation used throughout the script, and the resistance estimation example in which three plausible estimators converge to three different values.

Script ch. 1.0–1.2Held Source msi

1.0Introduction: Models and Why We Need Them#

The course aims to enable us to create models that help predict the behaviour of systems. The focus is on dynamic system models, i.e. systems that evolve over time (Script p. 9). A good model gives access to powerful engineering tools:

  • prediction of future behaviour (e.g. weather forecasting),
  • control and optimisation of technical systems, through feedback control or intelligent input design.

The course is about the process of obtaining such models. It builds on three fields: systems theory, statistics and optimisation.

Course roadmap (script):

  1. Identification methods for static models and their statistical properties, with refreshers on statistics and optimisation (Part I–II).
  2. Modelling of dynamic systems and identification of their parameters (Part III).

Model Predictive Control (MPC)#

1.1Mathematical Notation#

Source: Script pp. 9–10.

Sets, vectors, matrices#

SymbolMeaning
R\mathbb{R}, R+\mathbb{R}_+, R++\mathbb{R}_{++}reals, non-negative reals, positive reals
Z\mathbb{Z}, N\mathbb{N}integers, naturals including zero (N=Z+\mathbb{N} = \mathbb{Z}_+)
Rn\mathbb{R}^n, Rn×m\mathbb{R}^{n\times m}vectors of dimension nn; matrices with nn rows and mm columns
Sn\mathbb{S}^nsymmetric matrices, {A∈Rn×n∣A=A⊤}\{A \in \mathbb{R}^{n\times n} \mid A = A^\top\}
A≽0A \succcurlyeq 0, A≻0A \succ 0A∈SnA \in \mathbb{S}^n positive semi-definite / positive definite (all eigenvalues ≥0\geq 0 / >0> 0)
A≽BA \succcurlyeq Bmatrix inequality: A−B≽0A - B \succcurlyeq 0
  • All vectors are column vectors by default: Rn=Rn×1\mathbb{R}^n = \mathbb{R}^{n\times 1}.
  • Concatenation: for x∈Rnx \in \mathbb{R}^n, y∈Rmy \in \mathbb{R}^m, (x,y)(x, y) is shorthand for [xy]=[x⊤,y⊤]⊤∈Rn+m\begin{bmatrix} x \\ y \end{bmatrix} = [x^\top, y^\top]^\top \in \mathbb{R}^{n+m}.
  • Intervals: [a,b][a,b] closed, (a,b)(a,b) open, [a,b)[a,b) half-open (contains aa, not bb).

Norms#

  • ∥x∥\|x\|: an arbitrary norm. ∥x∥2\|x\|_2: the Euclidean norm, ∥x∥22=x⊤x\|x\|_2^2 = x^\top x.
  • Weighted Euclidean norm with Q≻0Q \succ 0: ∥x∥Q2=x⊤Qx\|x\|_Q^2 = x^\top Q x.
  • ∥x∥1=∑i=1n∣xi∣\|x\|_1 = \sum_{i=1}^n |x_i|, and ∥x∥∞=max⁡{∣x1∣,…,∣xn∣}\|x\|_\infty = \max\{|x_1|, \dots, |x_n|\}.
  • Matrix norms are the induced operator norms unless stated otherwise. The Frobenius norm is ∥A∥F2=trace⁡(AA⊤)=∑i=1n∑j=1mAij2\|A\|_F^2 = \operatorname{trace}(AA^\top) = \sum_{i=1}^n \sum_{j=1}^m A_{ij}^2.

Derivatives#

For f:Rn→Rmf : \mathbb{R}^n \to \mathbb{R}^m:

With this convention the first-order Taylor expansion reads

f(x)=f(xˉ)+∇f(xˉ)⊤(x−xˉ)+o(∥x−xˉ∥).f(x) = f(\bar x) + \nabla f(\bar x)^\top (x - \bar x) + o(\|x - \bar x\|).

Logic#

A⇒BA \Rightarrow B: “if AA then BB”. A⇔BA \Leftrightarrow B: “AA if and only if BB”, also written “AA iff BB”.

Indices, time series and estimates#

NotationMeaning
x=[x1,x2,…,xn]⊤x = [x_1, x_2, \dots, x_n]^\topcomponents of x∈Rnx \in \mathbb{R}^n
x1:N∈RNx_{1:N} \in \mathbb{R}^Na vector whose length grows with time, x1:N=[x1,…,xN]⊤x_{1:N} = [x_1, \dots, x_N]^\top
x[N]∈Rnx^{[N]} \in \mathbb{R}^na vector of fixed dimension that has been recursively updated up to time step NN (superscript in square brackets)
R^\hat Ran estimate of RR
RtrueR_\text{true}the true value of RR
R^N\hat R_Nthe estimate of RR given the first NN measurements

1.2A Simple Example: Resistance Estimation#

Source: Script pp. 10–12, taken from Schoukens (2013).

Goal: estimate the resistance RR of a resistor from repeated measurements of current iki_k and voltage uku_k, k=1,…,Nk = 1, \dots, N. The experiment is repeated to increase accuracy. Because of measurement noise, every pair (uk,ik)(u_k, i_k) is different.

msi, PDF page 10
msi, PDF page 10

By Ohm’s law u=Riu = Ri. A single measurement gives R^[1]=u1/i1\hat R^{[1]} = u_1 / i_1. Many measurements should reduce the effect of noise. The question is how to combine them.

msi, PDF page 11
msi, PDF page 11

Fig. 1.2 shows the measurements as noisy time series. Fig. 1.3 shows them in the uu–ii plane: without noise all points would coincide, but in reality they are spread out.

1.2.1Simple Approach (SA)#

Average the single-measurement estimates:

R^SA[N]=1N∑k=1Nukik(1.1)\hat R^{[N]}_\text{SA} = \frac{1}{N} \sum_{k=1}^N \frac{u_k}{i_k} \tag{1.1}

As a function of NN it seems to converge (Fig. 1.4, top). But does it converge to the right value?

1.2.2Error-in-Variables (EV)#

First average voltages and currents separately, then divide:

R^EV[N]=1N∑k=1Nuk1N∑k=1Nik(1.2)\hat R^{[N]}_\text{EV} = \frac{\frac{1}{N}\sum_{k=1}^N u_k}{\frac{1}{N}\sum_{k=1}^N i_k} \tag{1.2}

The name comes from the estimator of the same name treated later. It also converges (Fig. 1.4, middle), but to a different value than SA.

1.2.3Least Squares (LS)#

Choose RR so that the model prediction R ikR\, i_k matches the measured voltage uku_k as well as possible in the squared sense:

R^LS[N]=arg⁡min⁡R∈R∑k=1N(R ik−uk)2(1.3)\hat R^{[N]}_\text{LS} = \arg\min_{R \in \mathbb{R}} \sum_{k=1}^N (R\, i_k - u_k)^2 \tag{1.3}

R^LS[N]=1N∑k=1Nuk ik1N∑k=1Nik2(1.4)\phantom{\hat R^{[N]}_\text{LS}} = \frac{\frac{1}{N}\sum_{k=1}^N u_k\, i_k}{\frac{1}{N}\sum_{k=1}^N i_k^2} \tag{1.4}
ProofDerivation of (1.4) (left as an exercise in the script)

Let f(R)=∑k=1N(R ik−uk)2f(R) = \sum_{k=1}^N (R\, i_k - u_k)^2. Setting the derivative to zero:

f′(R)=2∑k=1N(R ik−uk) ik=2(R∑kik2−∑kukik)=!0  ⟹  R∗=∑kukik∑kik2.f'(R) = 2 \sum_{k=1}^N (R\, i_k - u_k)\, i_k = 2\Big(R \sum_k i_k^2 - \sum_k u_k i_k\Big) \overset{!}{=} 0 \;\Longrightarrow\; R^* = \frac{\sum_k u_k i_k}{\sum_k i_k^2}.

Dividing numerator and denominator by NN gives (1.4). Since f′′(R)=2∑kik2>0f''(R) = 2\sum_k i_k^2 > 0 (unless all ik=0i_k = 0), ff is strictly convex and R∗R^* is the unique minimiser.

msi, PDF page 12
msi, PDF page 12

LS also converges (Fig. 1.4, bottom), but to yet another value. Least squares is very powerful, especially with more than one unknown parameter, and the course uses it constantly.

Takeaway#

EstimatorFormulaCombines the data by
SA1N∑kukik\frac{1}{N}\sum_k \frac{u_k}{i_k}averaging the ratios
EV∑kuk∑kik\frac{\sum_k u_k}{\sum_k i_k}taking the ratio of the averages
LS∑kukik∑kik2\frac{\sum_k u_k i_k}{\sum_k i_k^2}minimising the squared voltage residuals

All three look reasonable and all three converge as N→∞N \to \infty, yet to three different limits. At least two of them must be wrong. Which one, if any, is correct cannot be decided by looking at the data. It requires the statistical properties of estimators, which are based on probability theory (Chapter 2).

Open Questions#

  • MPC vs. reinforcement learning, “online vs. offline”: which side is which? The usual framing is that MPC solves an optimisation online at every time step, while RL typically learns a policy offline. This isn’t in the script; check the recording.
  • Under what noise assumptions would LS be the right estimator? Presumably when only uku_k is noisy (σi=0\sigma_i = 0); see Script §2.5.

Concepts#

  • Mathematical notation of the course: ∇f\nabla f as transposed Jacobian, x1:Nx_{1:N} vs. x[N]x^{[N]}, hat for estimates
  • Model / dynamic system model: what MSI wants to identify
  • Model Predictive Control: motivating application of models
  • Estimator: a rule mapping measurements to a parameter estimate
  • Resistance estimation example: running example comparing SA, EV and LS
  • Error-in-Variables estimator: ratio of averages
  • Least Squares estimator: minimiser of the sum of squared residuals

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only