Ask MATLAB Expert

APPLIED STOCHASTIC PROCESSES

LAB - DISCRETE RANDOM VARIABLES

Objective

To become familiar with histograms and various families of discrete random variables.

Lab Description

Histograms are graphical representations of the distribution of data. A normalized histogram, thus, should provide an estimate of the probability distribution of the outcomes of an experiment. Generating the histogram for discrete data can be as easy as running an experiment several times and counting the number of occurrences of each outcome. In this lab you will generate random sequences responding to several families of random variables, and plot their histograms to compare them to the actual PMFs.

A. Consider the discrete Uniform(l,k) random variable. Do the following:

1. Generate the PMF of the uniform(l,k) distribution for, say, l = -12, k = 4 (use the book as reference if these parameters don't mean anything to you).

2. Obtain the expected value and the variance (i.e. theoretical values) for the corresponding PMF.

3. Generate an N-point vector, say x, of random numbers that have a uniform distribution. Choose a reasonable size for N, and explain your choice.

4. Calculate the sample mean and the sample variance of the vector you generated in step 3. Note that these should approximate the values you found in step 2.

5. In the same figure, plot the following three things (in that order):

a. The first 100 values of the random vector you generated.
b. The PMF of the distribution.
i. The title of this subplot should state the type of distribution and the parameters used.
ii. The title should also show the mean and variance you obtained in step 2.
iii. The mean should be indicated with a vertical, red line, of width 3.
c. The histogram you generated form the random vector.
i. The title of this subplot should show the sample mean and sample variance you calculated in step 4.
The scales of the horizontal and vertical axes of the second and third subplots should be identical.

An example of what I am looking for is shown in the next page.

6. Repeat steps 1-5 for other two other values of l and k.

B. Repeat part A for:
a. Geometric(p) random variable
b. Binomial(n, p) random variable
c. Pascal(k, p) random variable
d. Poisson(α) random variable

Note: for each random variable you should test at least three different parameters (of your choice).

1916_Random variable.jpg

To generate a title for the whole figure (not shown in the figure in the previous page, you may use the function suplabel.m. This function is not part of any Matlab release, and is attached in Appendix A.

To create strings that have variables and text, you can use the num2str() function. An example is shown below:

tt = ['Uniform(',num2str(k), ',' num2str(l), ') RV, m=', ... num2str(m), ', v=', num2str(v)];

Note that three dots at the end of a line are used to extend a command into the next line.

You can embed greek letters in Matlab titles and labels by typing a backward slash followed by the greek letter. For example, \Sigma for Σ and \sigma for σ. Use _ and ^ for subscripts and superscripts, respectively. For example \sigma_X^2 generates σX2.

Deliverables:

You should turn in, via email, at least the following 4 items in a single, cohesive PDF document:

1. Explanation of the code you used to generate the random data.

2. All plots requested, with the corresponding very well documented Matlab code you used to obtain them. Of course I only need one sample Matlab code for each of the distributions. For example, if you did ranges [-12, 4], [4,10], and [2,12] for the uniform distribution, I only need to see Matlab code for one of the three.

3. Analysis/discussion of your code/results.

Attachment:- Lab.rar

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M92677776
  • Price:- $55

Priced at Now at $55, Verified Solution

Have any Question?


Related Questions in MATLAB

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Assignment -we have daily gridded rainfall data of 40 years

Assignment - We have daily gridded rainfall data of 40 years and structure of the dataset is like below; Lat = [6.5:0.25:38.5]; Lon = [66.5:0.25:100]; Rainfall (135x129x365x40) (Lon, Lat, days, years). Now, we looking fo ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Question 1 manipulate spectral imagehyperspectral images

Question 1. Manipulate spectral image Hyperspectral images can be seen as a generalisation of normal colour images such as RGB images. In a normal RGB colour image, there are 3 channels, i.e. channels for red colour, gre ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Assignment matlab programmingusing appropriate matlab

Assignment: MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As