Assignment 4 SSP
Assignment 4 SSP
In the attachment, the gathered data using 2 cameras from the positions of a thrown ball are given.
To have access to the data, you should copy the attached mat file to your directory in Matlab and
type “load data assign 4”.
In the given data, tt1 and yy1 belong to the first camera, and tt2 and yy2 belong to the second
camera. For instance, if you type “plot(tt2, yy2,′ o−′ )” you can see the gathered data by the second
camera. In the following exercises, the vector of unknown parameters is θ = [g vy0 y0 ]T .
1. Apply the MLE algorithm separately to the data of each camera and find θ̂M L1 and θ̂M L2 ,
where θ̂M Li represents the estimation of θ using the data of ith camera. You should calculate
and plot θ̂M L as a function of time where in each time you use the information until that time.
2. Using the equations of MLE, explain that why in MLE the number of observations should be
at least as the number of unknowns.
3. Estimate the variance of measurement noise of each camera (using ML method) and show that
− −
they are σw2 1 = 1.23 ∗ 10 4 and σw2 2 = 6.04 ∗ 10 4 . You can use these values for the rest of this
assignment.
4. For each one of the estimates you obtained in exercise 1, find the variance of estimator as a
function of time, i.e. σθ̂2 (t). Using the calculated σθ̂2 , find the 95% confidence interval and
ML ML
add that to the figures you plotted in exercise 1 (95% confidence interval is the interval of ±2σ
around θ̂M L ).
Hint: The covariance of the estimation error in MLE can be calculated using the following
equation
2 σw2 1 0 · · · 0
σ − − 0 σ2 · · ·
−θ̂1 σ 2 − T −1
−1 w2 0
Qθ̂M L = = A Q A ; Q =
θ̂2 w w .. .. ... ..
− − σθ̂2
. . .
2
3 0 0 · · · σwn
where the elements of the main diagonal of Qθ̂M L represent the variance of unknown parameters.
In order to give you an idea how the solution should look like, I have plotted part of the results
of exercises 1 and 4 in the following figure.
5. Now consider the data of both cameras together and find and plot the estimate and confidence
intervals as functions of time (Data fusion).
6. Assuming the following PDFs as the prior distribution of the unknown parameters
− −
g ∼ N 9.81, 10 4 , vy0 ∼ N 4, 1 , y0 ∼ N 1, 10 4
find the MMSE estimates (separately for each camera) as a function of time, i.e. θ̂M M SE1 and
θ̂M M SE2 . Show that in this case we don’t need to wait to have observations at least as many
as the number of parameters.
7. Plot the new estimates in the same figures with the ML estimates and compare the results
(Part of the results is given in the following figure).
1
Maximum Likelihood Estimation applied to the data of first camera MMSE Estimation applied to the data of first camera
-7 -7
Estimation Estimation
-8 95% confidence interval -8 95% confidence interval
g m/s 2
g m/s 2
-9 -9
-10 -10
-11 -11
-12 -12
0 0.2 0.4 0.6 0.8 0 0.2 0.4 0.6 0.8
4.5 4.5
4 4
v0 m/s
v0 m/s
3.5 3.5
3 3
2.5 2.5
0 0.2 0.4 0.6 0.8 0 0.2 0.4 0.6 0.8
1 1
0.98 0.98
y0 m
y0 m
0.96 0.96
0.94 0.94
0.92 0.92
0 0.2 0.4 0.6 0.8 0 0.2 0.4 0.6 0.8
Time(s) Time(s)
8. Using the prior distributions given in the previous exercise, and by fusing the data of both cam-
eras find the MMSE estimate of the parameters (θ̂M M SE ). You should write your algorithm in
a recursive way such that it updates the the estimate and its variance each time a measurement
is received. Finally plot the estimate and confidence interval as a function of time.