Practice Exam 2021
(About 6 of the following problems)
Code to solutions:
1. System Identification Theory
a) Suppose that we would like to identify a model, where the true system is given by
where is white noise with zero mean and unit variance. Suppose
that the input signal is a sinusoidal, and that you
estimate the parameters in a model of the form
using a standard least squares prediction error method. What are the estimates of and
when
?
b) In another scenario assume the true system is given by
with white noise of variance 1. Assume an identification experiment is carried out with an input
uncorrelated with
but with autocovariance
Calculate the asymptotic values of the estimates and
when
Are the estimates asymptotically correct? The model is of the correct form
.
Also determine the error variances and
of the parameter estimates for finite amount of data
.
c) Suggest another signal , also with variance 1 as in b, which gives lower error variances
and
.
2 System Identification Practice
The data for this problem are in the file sysid02.mat. Load the data into Matlab, inside it you will find input and output signals u and y (the sample time is ).
Use that data to construct one or more appropriate black-box models, choosing between ARX, OE, ARMAX and BJ structures of appropriate orders. For your best model report:
- plot of the fitted model vs validation data. (Hint: compare())
- parameter values and uncertainty
- residual analysis plot (resid)
- Bode plot (bode or bodeplot)
- poles and zeros (pzmap)
You can either use the systemIdentification GUI or do it with matlab code that you write.
3. Modeling, Modelica and DAE systems
Subproblems
Consider the electric circuit below driven by a current source of input current (and
is a voltage).
a) Write a DAE in the variables ,
, and
, with
as input.
[In 2021-22 we have skipped talking about the differentiability index, and therefore questions of the form b) and c) will not be given in Jan 2022-3. Therefore skip the next two subproblems.
b) What is the differentiability index of the DAE ?
c) Let and
. Show that the model can be written in the form
where is the
-derivative of
and
is the differentiability index. ]
d) If the current source is replaced by a voltage source (similar diagram, but with voltage as input), is it possible to write the system in state space form
(Note: different matrices
than in c)
You can assume that parameters and
are non-zero.
4. Supervised Learning - Practice and theory
The EEG data needed here is not included, so you cant solve this problem. The problem would be more detailed on the exam. Don't spend all the time trying to optimize performance.
The google colab notebook xxx loads data from an EEG experiment, measuring brain activity from persons looking on images on a computer screen. These images belong to 3 different categories, (denoted 0,1,2 in the data). It is known that the activities in the brain differ when processing images from these categories.
The EEG data has the following structure:
The data is split into a training set of X images which you should use to train your classifier and a test set of Y images which you should use to evaluate your algorithm.
a) Choose a good algorithm described in the course and train a classifier on the data. It is of course good if your algorithm gets a high performance, but your result will be judged mainly by your methodology, and how well you describe your method and result.
b) Describe how one could interpret the information one obtains from the singular value decomposition [U,S,V]=svd(A)
of the EEG data matrix A = (here follows a description of the matrix A). Say for instance that only 5 singular values are significantly larger then 0.
5. Causal Inference, Theory or Practice
The following DAG decscribes a linear Gaussian structural causal model, where we assume we do not know the parameters (the values on the edges).
The equations of the SCM are given by
where are normally distributed
random variables.
a) We are interested in estimating the causal effect from to
e.g. find
(which in this case is 11). Draw a figure indicating the updated DAG after an intervention has been made corresponding to this situation, .
b) If such an intervention is not practically possible, then describe how the causal effect from X to Y can be obtained from linear regression using available data. Determine which of these linear regressions will give the correct value
For the example this would mean that we find the correct coefficient
(asymptotically when the number of data points goes to infinity) from the least squares regression
c) Confirm your results numerically by generating a large amount of data points according to the true SCM and perform the three different linear regressions described in b. (Hint: In python you can use the ols command in the statsmodels package. You can also solve the problem in matlab).
6. Grey Box Identification
The following continuous time model describes the one dimensional position of a mobile robot. The input signal
to a motor generates a force
on the robot. The motor has a time constant
. The robot is initially at rest.
Parameters and
are unknown and should be estimated from output input data
a) Use the state and write the model on state space form
suitable for Grey-box identification.
b) Explain why all three parameters can not be identified from any output input data
.
b) The file problem6data.mat contains data sampled at
. (The data includes some noise.) Estimate the two parameters
assuming that the mass
is known.
7. Bayesian Estimation
Say we know data is drawn from a probability function
where are known functions, but where the parameter
is unknown and should be estimated.
a) Calculate the Fisher information and show that any bias-free estimator
needs to satisfy
(where we assume the integral exists)
b) Suggest a method to estimate from data
which works well when
(assuming
is different from
).