Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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 ...

Suppose that a student has the option of enrolling for a

Suppose that a student has the option of enrolling for a single elective during a term. The student must select a course from a limited list of options: "English, " "History, " "Biology, " "Computer, " or "Math." Constru ...

Suppose that you have used some concept learning algorithm

Suppose that you have used some concept learning algorithm to learn a hypothesis h1 from some training data. You are interested in knowing the accuracy that the hypothesis can be expected to achieve on the underlying pop ...

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 ...

Assignmentafter the success of your robo-advice venture you

Assignment After the success of your robo-advice venture you decide to explore alternative sources of profitability for your company. You realize that Australian investors are often forced to chose between expensive acti ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

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 ...

Discrete optimisation- solve the following two problems

Discrete Optimisation - Solve the following two problems with both exhaustive enumeration and branch and bound - Problem 1 is a mixed integer linear optimisation problem (the problem has both discrete and continuous vari ...

Recitation problems -1 determine the highest real root of

Recitation Problems - 1. Determine the highest real root of f(x) = 2x 3 - 11.7x 2 + 17.7x - 5 using the Newton-Raphson method with at least four iterations. Start with an initial guess of x 0 = 3. 2. Determine the real r ...

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.

  • 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