Personal tools
  •  
You are here: Home Electrical and Computer Engineering Stochastic Processes Programming Assignments

Programming Assignments

Document Actions
  • Content View
  • Bookmarks
  • CourseFeed

Introduction   ::   Exercises

Exercises

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

  6. Continuing the previous problem, let $ \Xbf^{(1)}$ be obtained from the first two components of the four-dimensional data. Estimate $ \Sigma_{11}$ , the covariance matrix of $ \Xbf^{(1)}$ , and $ \mubf^{(1)}$ , the mean vector.

    Plot contours of the pdf of $ \Xbf^{(1)}$ . The function plotellipse.m (on the class website) may be helpful. Compare the axes of the ellipses with the eigenvectors of $ \Sigma_{11}$ . 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 Creative Commons License