Programming Exercise 1 - Stochastic Processes in Electronic Systems | ECE 6010, Papers of Stochastic Processes

Material Type: Paper; Class: Stochastic Processes in Electronic Systems; Subject: Electrical & Computer Engr; University: Utah State University; Term: Unknown 1989;

Typology: Papers

Pre 2010

Uploaded on 07/30/2009

koofers-user-qcg
koofers-user-qcg 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Utah State University
ECE 6010
Stochastic Processes
Programming Exercise # 1
Due Friday September 9.
Introduction
This exercise will provide an opportunity to do some calculations and plots with actual data. The
intent is to make some of the abstract concepts a little more concrete. This exercise is to be done
using Matlab.
Background
randn Every call to the Matlab function rand generates an independent instance of a stan-
dard Gaussian random variable. That is, randn is a Gaussian random number generator:
X
N(0,1). Random column vectors of length nare generated by randn(n,1). Row
vectors are generated with randn(1,n). A matrix of random numbers is generated with
randn(n,m). For more information, type help randn in Matlab.
rand Similarly, the Matlab function rand generates independent uniform U(0,1)random num-
bers. Columnandrowvectorsandmatricesofrandomnumbersaregeneratedusingrand(n,1),
rand(1,n),rand(n,m). For more information type help rand in Matlab.
Histograms The Matlab hist command produces a histogram. This is a representation of the
empirical density function. In ahistogram, a sequence of bins is established. For each value in
a set of data, the number of times that data points fall in a binis 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 numbers
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 x1,x2, . . . , xN, where
each vector is a column vector of length ndrawn independently and identically distributed
1
pf3

Partial preview of the text

Download Programming Exercise 1 - Stochastic Processes in Electronic Systems | ECE 6010 and more Papers Stochastic Processes in PDF only on Docsity!

Utah State University

ECE 6010

Stochastic Processes

Programming Exercise # 1

Due Friday September 9.

Introduction

This exercise will provide an opportunity to do some calculations and plots with actual data. The intent is to make some of the abstract concepts a little more concrete. This exercise is to be done using Matlab.

Background

randn Every call to the Matlab function rand generates an independent instance of a stan- dard Gaussian random variable. That is, randn is a Gaussian random number generator: X N ( 0 , 1 ). Random column vectors of length n are generated by randn(n,1). Row vectors are generated with randn(1,n). A matrix of random numbers is generated with randn(n,m). For more information, type help randn in Matlab.

rand Similarly, the Matlab function rand generates independent uniform U( 0 , 1 ) random num- bers. Column and row vectors and matrices of random numbers are generated using rand(n,1), rand(1,n), rand(n,m). For more information type help rand in Matlab.

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

according to some distribution, the sample mean of the distribution is

N

^ N

i  1

x i.

The sample covariance is

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?

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

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 Matlab using the command

load prog1dat

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

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