AEM 5451/EE 5251 PROBLEM SET 1 to 4 solutions

$100.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

AEM 5451/EE 5251 PROBLEM SET #1

Problem 1
Do problem 1.3 in your text.
Problem 2
Do problem 1.4 in your text.
Problem 3
Do problem 1.6 in your text.
Problem 4
Using the matrix inversion lemma, compute the inverse of the matrix P by hand.
P =


1 2 2
0 3 1
0 1 2


With MATLAB at your disposal, I know that computing the inverse of P is trivial. The
point here, however, is not simply computing the inverse of P. Rather, it is for you to
become comfortable with block matrices and the matrix inversion lemma. So, try expressing
P as sum/product of four matrices A, B, C and D such that the matrix inversion lemma
can be used to do the calculations easily by hand.
Problem 5
Do problem 3.13 in your text. Be sure to show your the form of your measurement matrix
H for each of the different models.

AEM 5451/EE 5251 PROBLEM SET #2

Problem 1
Do problem 2.5 in your text.
Problem 2
Do problem 2.10 in your text. In addition do the following:
h) Are X and Y independent? Show this by determining the marginal distributions
fX(x) and fy(y).
Problem 3
Number of Residents Number of Residents with
No Felony Conviction One or More Felony Convictions
Female Residents 359, 881 172, 742
Male Residents 340, 454 40, 854
You are visiting an island that is a prison colony for political prisoners from the dystopian
planet Tralfamador. When a political prisoner receives a guilty verdict in court, (s)he is
declared a felon and sent to the island along with their immediate family members. The
felony conviction statistics for the current residents of the island are given the table above.
Consider the following outcomes for a resident of the island picked at random: (1) M = male
resident;(2) F = female resident; (3) C = convicted felon; (4) I = no felony record. Using
the data given and assuming that relative frequencies are equal to probabilities, calculate the
following: P(M), P(F), P(C), P(I), P(M ∩I), P(F ∩I), P(M ∩ C), P(F ∩ C). Now using
Bayes’ rule answer the following questions. Be sure to check your answers using relative
frequencies computed from the given data.
a) What is the probability that a male resident of the island picked at random will be a
convicted felon?
b) What is the probability that a female resident of the island picked at random will be
a convicted felon?
c) What is the probability that an island resident picked at random is female, given that
that they are a convicted felon?
d) What is the probability that an island resident picked at random is male, given that
they are a convicted felon?
Problem 4
Do problem 3.9 in your text. This is the problem we kicked-off the course with and now you
have the tools to find its solution. HINT: Treat it as a recursive least squares problem.
Problem 5
Figure 1: A system with an unknown mathematical model.
This problem demonstrates the utility and power of a simple, least squares estimator.
You will use least squares to determine the mathematical model of an unknown dynamical
system. The system can be an unknown electrical circuit, for example, which you can
stimulate and then record its output (e.g., voltage-in-voltage out). Or alternately, it can
be a vehicle whose equations of motion your do not know. So your apply control inputs
(e.g., turn the vehicle right and left rapidly; accelerate and decelerate it, etc) and observe its
kinematic state (e.g., position, velocity, acceleration, etc). Such problems are called system
identification (or simply sysid) and they are a small part of what we know as machine
learning today.
Download the data file inoutdata.txt found on the assignment page. This data contains
the output from the unknown (or “blackbox”) system shown in Figure 1. The first column
of the data is the time tk, the second column is the input uk and the third column is the
output yek (that is, yk when vk = 0). The system dynamics and observation models are:
αk = F αk−1 + Guk−1
yk = ye+ vk = Cαk + vk
2
Suppose you know that the matrices F, G and H have the following form:
F =

−a1 1
−a2 0

, G =

b1
b2

, C =

1 0
Your job is to use least squares to estimate (or identify) the parameters or entries of F and
G. That is, generate an optimal estimate of:
x =

a1 a2 b1 b2
T
You will proceed to do this as follows:
a) Write out the measurement equation for your estimator in the form
ye = Hx
where ye is the error-free sensor measurement (i.e., case when v = 0). Clearly identifying
the entries in ye and H. This is by far the most challenging part of the problem. HINT:
Try to relate yk to yk−1, yk−2, . . . , uk−1, uk−2, . . . and so using an autoregrsive moving
average (ARMA) model. If you do not know what an ARMA model is, look it up.1
b) Estimate the state vector using normal least squares.
c) Note that error-free yek is not available to you in practice. Instead you will use some
sensor to measure an error corrupted version denoted yk. Use the MATLAB command
randn to simulate the sensing process as follows:
yk = yek + 0.1 ∗ randn(N, 1)
where N is the number of data points in yek you are using for the estimation process.
d) Use the history of yek you generated and uk to generate an estimate of x.
e) Repeat the estimation process but now use a less noisy sensor whose output yk is given
by:
yk = yek + +0.001 ∗ randn(N, 1)
Does the value of x change appreciably?
f) Comment on how you would validate the accuracy of the estimate you generated.
1As of the moment I was writing this homework set (September 5, 2020), the Wikipedia Article on ARMA
is rather verbose and hard to follow. You can read it to learn what an ARMA model is but I would suggest
looking elsewhere to learn about ARMA.
3

AEM 5451/EE 5251 PROBLEM SET #3

Problem 1
Do Problem 4.4 in your text. The point of this problem is to show you how to convert a
continuous-time model (as you would derive from laws of physics) to a discrete-time model
you can simulate on a computer. It is based on the example on page 20 of the text. You will
have to do all the calculations by hand because we expect your answers to be in terms of
k, i and T (the sampling interval). You can check your answer using MATLAB’s command
c2d(A,B), for example, for a specific T.
Problem 2
The purpose of this problem is to drive home the concepts of state prediction and covariance
propagation. To that end, let us consider the following dynamic system:
x˙ = w, E [w] = 0, E [w(t)w(τ )] = Qcδ (t − τ ), Qc = 1
a) Write down the A and B matrix for the state-space realization of this system.
b) Calculate the F and G matrices for the discrete version of this system when the sampling interval is T = 1 seconds.
c) Evaluate the discrete process noise covariance Q.
d) Simulate the system for 0 ≤ t ≤ 50 seconds with T = 1 seconds. Since σwk =

Q, you
an generate a history for wk in MATLAB as follows:
>> T = 1;
>> t = 0:T:50;
>> N = length(t);
>> w_k = sqrt(Q)*randn(N,1);
The output of your simulation will be a history of xk for k = 0, 1, 2, . . . , N − 1 where
x0 = 0. Repeat this simulation 100 times and plot. Plot all 100 of the time series on
the same graph of tk vs. xk. Now that you have 100 different traces, calculate the
ensemble standard deviation at tk = 5, tk = 25 and tk = 50 seconds. What you just
did is called a Monte Carlo simulation.1
e) Now calculate the state prediction error covariance assuming you have perfect knowledge of the state (no uncertainty in the estimate) at k = 0. Plot the +σ and −σ on
the same graph as the one in part (d) above. What are the values of σ at tk = 5 and
tk = 10 seconds? This is called covariance analysis.
f) If you did things correctly, the standard deviation estimated by the Monte Carlo simulation should be very close to those predicted by the covariance analysis. So, now
imagine that you are highly-paid consultant (because you took AEM 5451/EE 5251)
and asked to design an estimator for a system that is going to be used in a safetycritical application (e.g., medical device design, commercial aviation, nuclear power
generation, etc). You must prove that the uncertainty in your state estimate is very
small. Which approach would you use–Monte Carlo or covariance analysis? Why?
Problem 3
Do problem 5.9 in your text including the following additional question:
c) Is your solution in part a) consistent with your understanding or engineer’s intuition
about how Kalman Filters should work? Why or why not? What about your answer in part
b)?
Problem 4
Do problem 5.11 in your text. Note that part c) of this problem is asking you the same
thing that you were asked in Problem 2, d) & e). The term “theoretical standard deviation”
means the standard deviation you would calculate by doing a covariance analysis.
Problem 5
Do problem 9.17 in your text. In this problem you are designing a smoother for the system
you worked with in Problem 4 above.
Problem 6
A rather common problem that appears regularly in signal processing is that of estimating
the total phase ϕk = 2πf tk + θ. The frequency of the signal f is known and, thus, the
1The Monte Carlo technique was develop in the 1940s associated with the Manhattan Project; the program
to build the first atomic bomb. The simulation method can be viewed as gambling with random number
generators and, hence, the moniker Monte Carlo which comes from the contemporary, famous gambling
destination located in Monaco. Las Vegas did not become synonymous with gambling until much after
the Manhattan Project was over. Otherwise the simulation technique might have been called Las Vegas
simulation.
2
dynamic model is ˙ϕ = 2πf. The measurement model relates a measurement of its amplitude
yk to ϕk as follows:
yk = sin ϕk + vk, vk ∼ N(0, Rk)
This is a nonlinear measurement model. What we want to show in this problem is how a
nonlinear measurement model results in a predicted measurement ˆyk with a distribution that
is very different from that of a priori one or that of the measurement y.
a) Derive an analytical expression for fYb (y) sin ϕ when ϕ ∼ U(0, π)?
b) Determine E(Yb) and σ
2
Yb when ϕ ∼ U(0, π).
c) Using MATLAB draw 10,000 samples of ϕ and run a simple Monte Carlo experiment to
generate samples of ˆy. Using the generated data approximate E(Yb) and σ
2
Yb
(you can use
the MATLAB commands mean and var). Also plot a histogram-based approximation
of fY (y). To do this, use the hist command in MATLAB (use at least 50 bins with
hist). How well do the Monte Carlo results for E(Yb), σ
2
Yb
and fYb (y) sin ϕ agree to the
analytical results?
d) Use the analytical approach or a Monte Carlo simulation (your choice) to determine
E(Yb), σ
2
Yb
and fYb (y) sin ϕ when ϕ ∼ N(0, 1). Which approach did you use (analytical
or Monte Carlo)? Why?
3

AEM 5451/EE 5251 PROBLEM SET #4

Problem 1
A rather common problem that appears regularly in signal processing is that of estimating the
total phase ϕk = 2πf tk + θ. The frequency of the signal f is known and, thus, the dynamic model
is ˙ϕ = 2πf. The measurement model relates a measurement of its amplitude yk to ϕk as follows:
yk = sinϕk + vk = ŷk + vk, vk ∼ N(0, Rk)
This is a nonlinear measurement model. What we want to show in this problem is how a nonlinear
measurement model results in a predicted measurement ˆyk with a distribution that is very different
from that of a priori one or that of the measurement y. For what follows, ignore the measurement
noise and just focus on the random variable ϕk.
a) Derive an analytical expression for fŶ (y) when ϕ ∼ U(0, π)?
b) Using the pdf you derived in (a), determine E(Ŷ) and σ
2
Ŷ when ϕ ∼ U(0, π).
c) Using MATLAB draw 10,000 samples of ϕ and run a simple Monte Carlo experiment to
generate samples of ˆy. Using the generated data approximate E(Ŷ) and σ
2

(you can use the
MATLAB commands mean and var). Also plot a histogram-based approximation of fY (y).
To do this, use the histogram command in MATLAB (use at least 50 bins with histogram
and the option ‘Normalization’ set to ‘pdf’). How well do the Monte Carlo results for
E(Ŷ), σ
2

and fŶ (y) agree to the analytical results?
d) Use the analytical approach or a Monte Carlo simulation (your choice) to determine E(Ŷ),
σ
2

and fŶ (y) when ϕ ∼ N(0, 1). Which approach did you use (analytical or Monte Carlo)?
Why?
Problem 2
Do Problem 13.3 in your text.
Problem 3
Do Problem 14.4 in your text.
Problem 4
Do Problem 15.2 in your text.
Problem 5
Do Problem 15.1 in your text.
Problem 6
Do 15.15 in your text.
2