Calculate the sample mean and the sample variance

Assignment Help MATLAB Programming
Reference no: EM131849417

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

Verified Expert

MATLAB based stochastic analysis using different methods. we have used 4 types of pdf generation in this work.The main part is finding PMF and related plots. A final report is submitted with theory, program and plots.

Reference no: EM131849417

Questions Cloud

Explain the adaptive and maladaptive aspects of behaviors : Research a behavior that represents risky behaviors as children emerge from middle childhood to adolescence. Discuss the individual, cultural, and environmental
Consider the concept of economic treaties : In considering the international realm, let's consider the concept of economic treaties. Specifically, let's think about an organization like the Eutopean Union
Concepts of economic treaties : Are joining the EU?ns thathat aretions t like the EuIn considering the international realm, let's consider the concepts of economic treaties.
Elite and pluralist views on democracy : Compare and contrast the elite and pluralist views on democracy and provide an argument for why one view is more accurate than the other.
Calculate the sample mean and the sample variance : ENGR 383 – APPLIED STOCHASTIC PROCESSES - To become familiar with histograms and various families of discrete random variables - DISCRETE RANDOM VARIABLES
What is the expected rate of return on the overall portfolio : What is the expected rate of return on the overall portfolio? What is the investment proportion, y?
Describe the operational definitions : Develop a research idea based on the topic you selected. Using the outline below, state the Hypothesis, describe the Operational Definitions and select.
What happened to the parliamementary government in the uk : What could the effect be on the UK? What happened to the parliamementary government in the UK?
Why is the ocean central to the lives of pacific islanders : Explain how the worldviews of Pacific Islanders are shaped by their environment? Why is the ocean central to the lives of Pacific Islanders?

Reviews

inf1849417

4/3/2018 4:59:20 AM

will do all assignments of this term with you, you will have a week to finish each The solution is having the Pascal part. you do not need to review your work, i dont need references in this assignment just summary please add. I am impressed with your fast service.

len1849417

2/5/2018 5:08:55 AM

we have more than a week, I will try another website if you give unreasonable price like you usually do. NOTE: I expect your lab report in PDF format, and your code (i.e. a “.m” file with instructions to use it). Finally, you need to demonstrate your working code (at least a couple of plots for each RV) to the instructor to get credit for the lab. Signature page must be turned in with your report.

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd