# Histograms the matlab hist command produces a

• Notes
• 3

This preview shows page 1 - 3 out of 3 pages.

Histograms The Matlab hist command produces a histogram. This is a representation of the empirical density function. In a histogram, a sequence of bins is established. For each value in a set of data, the number of times that data points fall in a bin is counted. In the Matlab hist command, the histogram is plotted automatically. To see an example of how the histogram works, type the following in Matlab: x = randn(1,1000); % create a vector of 1000 Gaussian random number hist(x,20); % plot the histogram with 20 bins hist(x,100); % plot the histogram with 100 bins Estimating mean and covariance Given a sequence of vector observations x 1 , x 2 , . . . , x N , where each vector is a column vector of length n drawn independently and identically distributed 1

Subscribe to view the full document.

according to some distribution, the sample mean of the distribution is μ 1 N N i 1 x i . The sample covariance is 6 1 N 1 N i 1 ( x i μ )( x i μ ) T . Exercises 1. Generate 1000 points of a N ( 2 , 5 ) random variable. Plot the histogram of the data. Esti- mate the mean and the variance from the data you generate. How closely do the estimates correspond to actual parameters? 2. Generate 1000 points of a U ( 2 , 5 ) random variable. Plot the histogram of the data. Estimate the mean and the variance from the data you generate. How closely do the estimate correspond to the actual parameters? 3. Write a Matlab function that will generate N points of Gaussian N ( μ , 6) data, where μ is a vector of length n . The function should have the “declaration”
You've reached the end of this preview.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern