You are on page 1of 5

MATLAB Assignment

EE800 - Stochastic Systems


Instructor: Dr. Fahd Ahmed Khan
Prepared by: Sami Ur Rehman

Assignment Task:
So far, we have covered a number of concepts in Stochastic system theory. Now, it is time to put
those concepts to some use. For this assignment you are required to analyze the data present in
the Drones Dataset excel file using the tools you have studied so far. The data presents a
number of stats of all the drone strikes in Pakistan till 2013. For more info on the
terms/abbreviations used in the file, refer to the notes section of the same file.
Using the dataset, produce atleast 3 analysis solutions. You may compute variance, covariance,
correlation, (conditional) expectations, (conditional and joint) probabilities, (conditional) PMFs
and whatever other statistical tool you deem appropriate in the analysis. Use as many as possible.
A sample case of just one of the many possible analysis is given below. You are required to do
this assignment in MATLAB.

Submission Guidelines:
1. You have to submit a PDF file which contains your plots, values and
comments (see sample analysis for reference).
2. You are also required to submit the MATLAB code files (separate file for
each analysis). Zip all the files into a single file with the filename as
YourName_RollNumber.zip
3. Email only the zip file to 14mseesrehman@seecs.edu.pk
If having any trouble understanding this assignment, direct all your queries to me.

Sample Analysis (Case 1):


Comparing the Number of Missiles fired (in a single drone strike) with the Number of People
Killed (in a single drone strike).
RV X = No. of Missiles fired (column S)
RV Y = Number of people reported killed (column V)

Analysis Tool 1 (Finding the Marginal Probabilities of X and Y):


Using the data in each column, we compute the probability of each outcome of X and Y, and
then use it to plot the individual PMFs.

PMF of X

PMF of Y

Analysis Tool 2 (Finding the Conditional Probabilities):


We calculate the conditional probabilities Pr{Y=y|X=x}. i.e. Given x missiles were fired in a
drone strike, the probability that y number of people were killed. We can then plot the
conditional PMFs. But, how will you find the conditional probabilities? Think hard before you
proceed.
In this particular scenario, the range of X is from 1-19. So, there will be a total of 19 conditional
PMFs. You may only plot one. The aim is only to test your understanding of the subject. As an
example, I have plotted the conditional PMF of Y given X=2. In order to check if your conditional
PMF is correct, the sum of probabilities for a given X (in this case X=2) will sum to 1.

Analysis Tool 3 (Joint PMF table):


With conditional probabilities computed, you can easily find the joint PMF table of X and Y.
Hint: Pr(X=x,Y=y) = Pr(Y=y|X=x).Pr(X=x)
Repeating this over all values of X and Y will give you the complete Joint PMF table.

Analysis Tool 4 (Statistical parameters):


A number of statistical parameters for this data were calculated and are listed below:
1.
2.
3.
4.
5.
6.
7.

Avg no. of missiles fired = E[X] = 3.57 missiles


Avg no. of people killed in a one drone strike = E[Y] = 9.69 people
Standard deviation of the data of no. of missiles fired = 2.40
Standard deviation of the data of no. of killed people = 8.64
Correlation between X and Y = 43.04
Covariance of X and Y = 8.4659
Correlation coefficient of X and Y = 0.4079

Comment on the value of the Correlation Coefficient. What does a lower/higher value indicate?

Analysis Tool 5 (Mutual Information): (optional)


Background:
To find the dependency of one variable X on another variable Y, we often use Correlation
between X and Y. Another tool often used in Information Theory is called the Mutual
Information I(X;Y). Mutual Information gives an idea of the common information in X and Y.
Mutual Information is given by,
I(X;Y) = H(X) + H(Y) H(X,Y)
Where,H(X) = Entropy of X, H(Y) = Entropy of Y, H(X,Y) = Joint Entropy of X and Y

Entropy of X or Y can be computed as:

Joint Entropy of X and Y can be computed as:

We just replace simple probabilities with joint probability values.

Use as Analysis Tool:


Compute H(X), H(Y) and H(X,Y). Use them to find the mutual information I(X;Y) for your case.

P.S. If anyone is interested in studying more () about Entropy related stuff, drop me an email
and I can send you a useful resource.

You might also like