Lecture Notes For A Course On System Identification, v2012: Kristiaan Pelckmans

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Lecture Notes for a course on System Identification, v2012

Kristiaan Pelckmans
2
Contents

I Basics of System Identification 11


1 Aim 13
1.1 Systems & Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2 The System Identification Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.3 A simple Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2 Least Squares Rules 25


2.1 Estimation by Optimizaztion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.2 Least Squares (OLS) estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2.1 Models which are Linear in the Parameters . . . . . . . . . . . . . . . . . . . 26
2.2.2 Ordinary Least Squares (OLS) estimates . . . . . . . . . . . . . . . . . . . . . 31
2.2.3 Ridge Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3 Numerical Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.3.1 Solving Sets of Linear Equations . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.3.2 Eigenvalue Decompositions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3.3 Singular Value Decompositions . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.3.4 Other Matrix Decompositions . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.3.5 Indirect Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.4 Orthogonal Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.4.1 Principal Component Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 42

3 Flavors of Dynamic Systems and Models 47


3.1 General Characterization of Dynamic Systems . . . . . . . . . . . . . . . . . . . . . . 47
3.2 LTI Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.2.1 Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.3 Useful Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.3.1 Disturbances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.3.2 Polynomial Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.3.3 Models for Timeseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.3.4 Stability and Minimal Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.4 Simulation and Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.5 Identifiability Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.5.1 Persistency of Exitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.5.2 Input Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

3
4 CONTENTS

4 Nonparametric Techniques 69
4.1 Transient Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.2 Frequency Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.3 A Correlation Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.4 Spectral Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4.5 Nonparameteric Techniques for Timeseries . . . . . . . . . . . . . . . . . . . . . . . . 75
4.5.1 Yule-Walker Correlation Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.5.2 Spectral Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

5 Stochastic Setup 79
5.1 Getting the Basics Right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.1.1 Events, Random variables and Derived Concepts . . . . . . . . . . . . . . . . 80
5.1.2 Continuous Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.1.3 Normal or Gaussian Distribution . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.1.4 Random Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.1.5 Stochastic Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.1.6 Interpretations of Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.2 Statistical Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.2.1 In All Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.2.2 Power and Limitations of ML . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.3 Least Squares Revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.4 Instrumental Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

6 Prediction Error Methods 101


6.1 Identification of an ARX model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.2 Optimal Prediction and PEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6.3 Statistical Analysis of PEM methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.4 Computational Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

7 Model Selection and Model Validation 113


7.1 Model Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
7.1.1 Cross-validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
7.1.2 Information Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
7.1.3 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
7.1.4 Testing LTI Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
7.2 Model Class Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.2.1 A Priori Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

8 Recursive Identification 123


8.1 Recursive Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
8.1.1 Real-time Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
8.1.2 Choosing Initial Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
8.1.3 An ODE Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.2 Other Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
8.2.1 Recursive Instrumental Variables . . . . . . . . . . . . . . . . . . . . . . . . . 130
8.2.2 Recursive Prediction Error Method . . . . . . . . . . . . . . . . . . . . . . . . 130
8.2.3 Recursive Pseudo-linear Least Squares . . . . . . . . . . . . . . . . . . . . . . 131
CONTENTS 5

8.2.4 Stochastic Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131


8.3 Model Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

II Advanced Topics 135

9 State Space Systems 137


9.1 State Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
9.1.1 State Space System - example 1 . . . . . . . . . . . . . . . . . . . . . . . . . 138
9.1.2 State Space System - example 2 . . . . . . . . . . . . . . . . . . . . . . . . . 140
9.1.3 Impulse Response to State Space System . . . . . . . . . . . . . . . . . . . . 141
9.2 Realization Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
9.2.1 Controllability and Observability . . . . . . . . . . . . . . . . . . . . . . . . . 142
9.2.2 Kalman-Ho Realization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
9.2.3 An Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
9.3 Stochastic Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
9.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

10 Subspace Identification 147


10.1 Deterministic Subspace Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
10.1.1 Deterministic Realization: IR2SS . . . . . . . . . . . . . . . . . . . . . . . . . 148
10.1.2 N4SID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
10.1.3 Variations on the Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
10.2 Stochastic Subspace Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
10.2.1 Stochastic Realization: Cov2SS . . . . . . . . . . . . . . . . . . . . . . . . . . 152
10.3 Further Work on Subspace Identification . . . . . . . . . . . . . . . . . . . . . . . . . 154
10.4 Implementations of Subspace Identification . . . . . . . . . . . . . . . . . . . . . . . 154

11 Design of Experiments 155

12 Nonlinear System Identification 157


12.1 Deviations from the Superposition Principle . . . . . . . . . . . . . . . . . . . . . . . 157
12.2 Block-Structured Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
12.3 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
12.4 General Approximators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

13 Connections and Applications 159


13.1 Process Industry and Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
13.2 Applications of Adaptive Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
13.3 Applications in Information Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
13.4 Application in Statistical Sciences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
13.5 Machine Learning (ML) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
13.6 Computer Science and Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
6 CONTENTS

14 Problem Solving Sessions 163


14.1 Dynamic Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
14.1.1 Excercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
14.1.2 Excercises + solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
14.2 Statistical Aspects of Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
14.3 Prediction Error Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
14.4 Recursive Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

15 Computer Labs 193


15.1 Computer lab 1: Least Squares Estimation: dos and donts . . . . . . . . . . . . . . 193
15.1.1 Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
15.1.2 Dynamic Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
15.1.3 Nonparametric Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
15.2 Computer lab 2: Timeseries Modeling and Prediction . . . . . . . . . . . . . . . . . 198
15.2.1 A stochastic Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
15.2.2 Artificial Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
15.2.3 Real Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
15.3 Computer lab 3: System Identification Toolbox . . . . . . . . . . . . . . . . . . . . . 201
15.3.1 Setting up the Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
15.3.2 Nonparametric Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
15.3.3 Parametric Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
15.3.4 Model Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
15.3.5 The GUI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
15.3.6 The Question . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
15.4 Computer Lab 4: Recursive Identification . . . . . . . . . . . . . . . . . . . . . . . . 204
15.4.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
15.4.2 Recursive Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
15.4.3 A Simple Recursive Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
15.4.4 Tracking Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
15.4.5 Eect of the initial values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
15.4.6 Eect of the forgetting factor . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
15.5 Model Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
15.6 Extra: Estimation of Physical parameters . . . . . . . . . . . . . . . . . . . . . . . . 207
15.7 Computer Lab 5: Subspace Identification . . . . . . . . . . . . . . . . . . . . . . . . 208
15.7.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
15.7.2 MATLAB SI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
15.7.3 N4SID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
15.7.4 Timeseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

16 Project work: Description 211


16.1 General Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
16.2 Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
16.3 A report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
16.3.1 A report in LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
16.4 Presentation of the Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
CONTENTS

17 Project work: Case Studies 215


17.1 Identification of an Industrial Petrochemical Plant . . . . . . . . . . . . . . . . . . . 215
17.2 Identification of an Acoustic Impulse Response . . . . . . . . . . . . . . . . . . . . . 216
17.3 Identification of Financial Stock Markets . . . . . . . . . . . . . . . . . . . . . . . . . 217
17.4 Identification of a Multimedia stream . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
0.4pt0.4pt 0pt0 pt

7
CONTENTS

8
Abstract

System identification in a narrow sense is concerned with tasks of parameter estima-


tion based on observations originating from a dynamical system. System identification
in a broad sense deals with many subtleties coming up when designing, conducting and
interpreting results from such an experiment. The purpose of this text is to survey the
collection of ideas, insights, theorems, intuitions, language and practical experiences
which constitute the art of system identification. In this course we will guide you along
the basic methods and concepts, as well as show you the many connections to related
fields of applied science.

9
CONTENTS

10
Part I

Basics of System Identification

11
Chapter 1

Aim

Say we study an unknown dynamic system. How to design, conduct, process and
interpret the results from an experiment applied to this system such that we will get an
accurate model of its internal working?

This question expresses the goal of system identification techniques. The actual answer to this
question lies in how the dierent terms are translated mathematically. This course intends to
illustrate the spectrum of choices one can make here. In order to bootstrap this course, let us give
a working (intuitive) definition of those:

Unknown: Here we assume that a precise description of the system is not available. This might be as
(i) the system is too complex to derive completely from (physical) laws; (ii) the system might
behave dierent from what would be expected from a theoretical description (e.g. due to
aging, unaccounted eects, or conversion from continuous to discrete time); (iii) we only need
to have a good approximation of the system which serves our purpose well.

Dynamic System: The actual behavior relating input signal to output signal, often using a physical process. The
keyword dynamic is understood here as follows: output values depend on present as well as
past inputs given to the system.

Model: A mathematical representation of the studied system. Many dierent flavors of models exists
(see next chapter): this course will study mathematical models relating input and output
signals using equations. (Logic, software, language or intuition can be used alternatively).

Experiment: A datum collected when feeding the system with a predesigned input signal. This book will
often be concerned with signals taking continuous values in R. (Alternatively, values of signals
can be binary, categorical, strictly positive, or taking elements in other structured sets).

Design: How to choose the input signals in order to optimize the result of the overall analysis?

Process: In which shape should the signals be (pre-)processed before submitting to analysis?

Interpret: In what sense is the identified model accurate and reliable, and which results might be due
to unknown disturbances, noisy measurements or artificial model structures?

13
1.1. SYSTEMS & MODELS

In a specific sense, system identification is concerned with coming with an accurate model given
the input-output signals recorded during working of the studied system.
Hence, it becomes plain that system identification is closely related to other fields of math-
ematical modeling. We mention here the various domains concerned with parameter estimation
including statistical inference, adaptive filtering and machine learning. Historically, system identi-
fication originates from an engineering need to form models of dynamical systems: it then comes
as no surprise that traditionally emphasis is laid on numerical issues as well on system-theoretical
concerns.
Progress in the field has much been reinforced by introducing good software to execute the
various algorithms. This makes the methodology semi-automatic: that is a user needs still have
a conceptual overview on what is to be done, but the available software tools take care of most
technical details. In this course, the use of the MATLAB System Identification toolbox is discussed
in some detail.
System Identification as a field came only in existence in the 60s, while its roots can be traced
back to the Least Squares techniques, other techniques of statistical inference. The field however
originated from an engineering need to have good models for use in automatic control. Modern
system identification is often attributed to the work of Astrom and Bohlin [1], while contemporary
system identification is often associated to the work as reviewed in Ljung [4] or Soderstrom and
Stoica [5]. The latter work will be the basis of this course.

1.1 Systems & Models

Figure 1.1: As a medical doctor you get to study the human body. As a doctor you work with an
internal representation (=model) of how the body (=system) works.

14
1.1. SYSTEMS & MODELS

Definition 1 (System or Model) The overall behaviors you get to study is referred to as the
system. The internal (mental) representation you as an researcher use in order to study the system,
is called the model.

(a) (b)

(c)

Figure 1.2: (a) Schematic representation of a stirred thank process. (b) representation of a speech
apparatus. (c) Example of a generated acoustic signal with two dierent filters shaped by intention
(k versus a)

Let us begin by describing some of the systems which are being studied in the context of this
course.
Stirred Thank: The following is a prototypical example in the context of process control. Consider a bio-
chemical reactor, where two dierent substances go in via respective pipelines. Both inflows
comes at a certain flow-rate and have a certain concentration, either of which can be controlled
by setting valves. Then the substances interacts inside the stirred tank, and the yield is
tapped from the tank. Maybe the aim of such process is to maximize the concentration of
the yield at certain instances. A mathematical approach to such automatic control however
requires a mathematical description of the process of interest. That is, we need to set up
equations relating the setting of the valves and the output. Such model could be identified by
experimenting on the process and compiling the observed results into an appropriate model.
Speech: Consider the apparatus used to generate speech in the human. In an abstract fashion, this

15
1.1. SYSTEMS & MODELS

can be seen as a white noise signal generated by the glottis. Then the mouth are used to filter
this noise into structured signals which are perceived by an audience as meaningful. Hence,
this apparatus can be abstracted into a model with unknown white noise input, a dynamical
system shaped by intention, and an output which can be observed. Identification of the filter
(dynamical system) can for example be used to make a artificial speech.

Lateron in this course, you will be asked to study how techniques of system identification can be
applied in a range of dierent applications.

Industrial: The prototypical example of an engineering system is an industrial plant which is fed by an
inflow of raw material, and some complicated process converts it into the desired yield. Often
the internal mechanism of the studied process can be worked out in some detail. Nevertheless,
it might be more useful to come up with a simlpler model relating input-signals to output-
signals directly, as it is often (i) easier (cheaper) to develop, (ii) is directly tuned to our need,
and (iii) makes abstraction of irrelevant mechanisms in the process, and (iv) might better
handle the unforeseen disturbances.

Figure 1.3: Illustrative examples: (a) A petrochimical plant. (b) An application of a model for
acoustic signals. (c) An example of an econometric system. (d) Signals arising from TV can be
seen as coming from a system.

Acoustic: The processing of acoustical signals can be studied in the present context. Let us for example
study the room which converts an acoustic signal (say a music signal) into an acoustic signal
augmented with echo. It is then often of interest to compensate the signal sent into the room
for this eect, so as to clean the perceived signal by the audience. In this example, the room
is conceived as the dynamical system, and it is of interest to derive a model based on acoustic
signals going into the room, and the consequent signals perceived by an audience.

Econometric: The following example is found in a financial context. Consider the records of the currency
exchange rates. This multivariate time-series is assumed to be driven by political, socio-
economic or cultural eects. A crude way to model such non-measurable eects is as white
noise. Then the interesting bit is how the exchange rates are interrelated: how for example a
injection of resources in one market might alter other markets as well.

Multimedial: Finally, consider the sequence of images used to constitute a cartoon on TV say. Again,
consider the system driven by signals roughly modeling meaning, and outputting the values
projected in the dierent pixels. It is clear that the signals of neighboring pixels are inter-
related, and that the input signal is not as high-dimensional as the signals projected on the
screen.

16
1.2. THE SYSTEM IDENTIFICATION PROCEDURE

1.2 The System Identification Procedure


Let us sketch a prototypical example of the dierent steps taken in a successful system identification
experiment. The practical way to go ahead is typically according to the following steps, each one
raising their own challenges:
1. Description of the task. What is a final desideratum of a model? For what purpose is it to
be used? How will we decide at the end of the day if the identified model is satisfactory? On
which properties to we have to focus during the identification experiments?
2. Look at initial Data. What sort of eects are of crucial importance to capture? What are
the challenges present in the task at hand. Think about useful graphs displaying the data.
Which phenomena in those graphs are worth pinpointing?
3. Nonparametric analysis. If possible, do some initial experiments: apply an pulse or step to
the system, and look at the outcome. Perhaps a correlation or a spectral analysis are possible
as well. Look at where random eects come in. If exactly the same experiment is repeated
another day, how would the result dier? Is it possible to get an idea of the form of the
disturbances?
4. Design Experiment. Now that we have acquired some expertise of the task at hand, it is
time to set up the large identification experiment. At first, enumerate the main challenges
for identification, and formalize where to focus on during the experiment. Then design an
experiment so as to maximize the information which can be extracted from observations made
during the experiment. For example. make sure all the dynamics of the studied system are
sufficiently excited. On the other hand, it is often paramount to make sure that the system
remains in the useful operation mode throughout the experiment. That is, it is no use to
inject the system with signals which do not apply in situations where/when the model is to
be used.
5. Identify model. What is a good model structure? What are the parameters which explain
the behavior of the system during the experiment.
6. Refine Analysis: It is ok to start o with a hopelessly naive model structure. But it is
then paramount to refine the model structure and the subsequent parameter estimation in
order to compensate for the eects which could not be expressed in the first place. It is for
example common practice to increase the order of the dynamical model. Is the noise of the
model reflecting the structure we observe in the first place, or do we need more flexible noise
models? Which eects do we see in the data but are not captured by the model: time-varying,
nonlinear, aging, saturation,... ?
7. Verify Model: is the model adequate for the purpose at hand? Does the model result in
satisfactory results as written down at the beginning? Is it better than a naive approach? Is
the model accurately extracting or explaining the important eects? For example, analyze
the residuals left over after subtracting the modeled behavior from the observed data. Does it
still contain useful information, or is it white? Implement the model for the intended purpose,
thus it work satisfactory?
A flowchart of the typical system identification experiment is shown in Fig. (1.2.a). The identifi-
cation procedure can be compared to an impedance meter (see Fig. (1.2.b)) which measures the

17
1.3. A SIMPLE EXAMPLE

impedance of a system by comparing the current measured at input with the corresponding voltage
at the output line of a system. Similarly, system identification tries to figure out the dynamics of a
system by relating input signal to corresponding output, i.e. from observed input-output behavior.

(a) (b)

1.3 A simple Example


The code of a simple identification experiment in MATLAB is given. The task is to identify a model
for a hairdryer. This system fans air through a tube which is heated at the inlet. The input signal
u(t) reflects the power of the heating device. The output signal y(t) reflects the temperature of the
air coming out. The data used for identification is displayed as follows.
>> load dryer2
>> z2 = [y2(1:300) u2(1:300)];
>> idplot(z2, 200:300, 0.08)

18
1.3. A SIMPLE EXAMPLE

(c) (d)

(e) (f)

(g) (h)

Figure 1.4:

19
1.4. NOTATION

At first, the structural properties of the system are displayed using nonparametric tools as follows

>> z2 = dtrend(z2);
>> ir = cra(z2);
>> stepr = cumsum(ir);
>> plot(stepr)

Inspection of those properties suggest the following parametric model relating input to output
signals.
y(t) + a1 y(t 1) + a2 y(t 2) = b1 u(t 3) + b2 u(t 4) (1.1)
Here {a1 , a2 , b1 , b2 } are to be estimated based on the collected data as given before.

>> model = arx(z2, [2 2 3]);


>> model = sett(model,0.08);
>> u = dtrend(u2(800:900));
>> y = dtrend(y2(800:900));
>> yh = idsim(u,model);
>> plot([yh y]);

The dynamics of this estimated model are characterized as the poles and zeros of the system. This
is given as

>> zpth = th2zp(model);


>> zpplot(zpth);

The transfer function corresponding to the estimated model, and derived from the non-parametric
method is compared as follows

>> gth = th2ff(model);


>> gs = spa(z2); gs = sett(gs,0.08);
>> bodeplot([gs gth]);

Many open questions on the studied system remain after this simple analysis. For example Is
the estimated model accurate enough (model validation)?, Is the model structure as given in eq.
(1.1) appropriate? If we can freely choose the input signals, what would the optimal inputs be
(experiment design)?, . . . .

1.4 Notation
Hardly any non-mathematician will admit that mathematics has a cultural and aes-
thetic appeal, that it has anything to do with beauty, power or emotion. I categorically
deny such cold and rigid view. [N.Wiener, 1956]

Mathematical manuscripts tend to scare people away because of their intrinsic technical nota-
tion. However, mathematical notation is carefully crafted over the years to express ideas, inventions,
truths, intuitions and reasonings of exact sciences better than any spoken language could do. Sim-
ilar to spoken languages, mathematical notation comes in many dierent dialects, obstructing the
fluent interaction between dierent groups of researchers. Dialects may dier in subtle issues as e.g.

20
1.4. NOTATION

the use of capital symbols for certain quantities or in indexing systems, or in capital dierence as
the use of operators versus explicit representations of transforms. As for any compiler, ideas might
not work out properly if the syntax is not as intended. As such, it really pays o to get familiar
with dierent notational conventions.
In this course we adapt the following notation.

(Constant): A constant quantity will be denoted as a lower-case letter in an equation. For example scalars
(e.g. c, a, b), indices (as e.g. i, j, k, n, . . . ), functions (as e.g. f, g, . . . ) and so on.
(Vector): A vector - an array of scalars taking value in Rd - is denoted as a boldface lowercase letter
(e.g. a, b, c, . . . ).

(Matrix): A matrix - a tableau of scalars taking values in Rnd - is denoted as a boldface capital letters
(e.g. A, B, M,)
(Random variable): Random quantities will be noted as capital letters in equations. Random quantities need a
proper stochastic setting to be well-defined (see chapter 4), in practice they can be recognized
as they can take dierent values (realizations).

(Set): Sets of elements are denoted using curled brackets: e.g. {a, b, c} is a set of three constant
values. Sets are referred to using mathbb letters, e.g. R, N, C, . . . .
(Operator): An operator is a mapping of a function to another. An operator is denoted as a calligraphic
letter, e.g. L : {f } ! {f } is a mapping from the set of functions into the same set.

(Reserved): In order to ease notational load, a number of symbols connect (in this course) to a given
meaning. An overview of those is given in Table (1.1).

Symbol Type Meaning


R, N, C Set Set of real, integer or complex values.
n Scalar Number of observations.
Vector Unknown parameters of the problem to be estimated.
Scalar Delay of the model/system.
i, j = 1, . . . , n Index Index ranging over the n observations.
p
i Imaginary number i= 1
d Scalar Order of Input Response, or dimension.
u, u function and vector Continuous and discrete input signal.
y, y function and vector Continuous and discrete output signal.
, n Operator An estimate, that is f and fn are both an estimate of the quantity f .

Table 1.1: Enumeration of symbols taking a fixed meaning in this text.

21
1.4. NOTATION

22
Bibliography

[1] K.J. Astrom and P. Eykho. System Identification A Survey. Automatica 7(2), pp. 123162,
1971.

[2] B.D.O. Anderson and J.B. Moore. Optimal Filtering. Prentice-Hall, 1979.
[3] G. Box and G. Jenkins. Time Series Analysis: Forecasting and Control . Prentice-Hall, 1987.
[4] L. Ljung. System Identification, Theory for the User. Prentice Hall, 1987.
[5] T. Soderstrom. and P. Stoica. System Identification. Prentice-Hall Englewood Clis, 1989.

[6] K. Astrom and B. Wittenmark. Adaptive Control. Addisson-Wesley, 1994.


[7] P.J.. Brockwell and R.A. .Davis. Time series: theory and methods. Springer, 1987.
[8] P. Overschee and B.. Moor. Subspace Identification for Linear Systems: Theory & Implemen-
tation. Kluwer, 1996.

[9] P. Stoica and R. Moses. Spectral analysis of signals. Prentice-Hall, 2005.

23
BIBLIOGRAPHY

24

You might also like