##### Personal tools
•
You are here: Home Programming Assignments

# Programming Assignments

##### Document Actions

Introduction   ::   Exercises

## Exercises

1. Generate 1000 points of a random variable. Plot the histogram of the data. Estimate 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 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 M ATLAB function that will generate points of Gaussian data, where is a vector of length . The function should have the ``declaration''
```              function X = gengauss(mu,Nigma,N)
```
4. The file prog1dat.mat (on the class website) contains data points representing measurements from a four-dimensional physical system. Load the data into M ATLAB using the command
```              load prog1dat
```
A variable X will be created with the data in it. Suppose that and is measured. Determine the best estimate of the variables and . Explicitly state all the appropriate covariance and mean vectors, and how you obtain your estimates.
5. Continuing the previous problem, suppose that the variables , , and are available. Write a function predictx4 which will estimate the corresponding value of . The function should have the ``declaration''
```              function x4hat = predictx4(x1,x2,x3)
```
(with possibly some other arguments as well). If , , , what is the estimate of ?

6. Continuing the previous problem, let be obtained from the first two components of the four-dimensional data. Estimate , the covariance matrix of , and , the mean vector.

Plot contours of the pdf of . The function plotellipse.m (on the class website) may be helpful. Compare the axes of the ellipses with the eigenvectors of . What is the relationship?

Copyright 2008, by the Contributing Authors. Cite/attribute Resource . admin. (2006, June 13). Programming Assignments. Retrieved January 07, 2011, from Free Online Course Materials — USU OpenCourseWare Web site: http://ocw.usu.edu/Electrical_and_Computer_Engineering/Stochastic_Processes/program1_2.htm. This work is licensed under a Creative Commons License