Laboratory Project 1: Introduction to Random Processes

Similar documents
Laboratory Project 2: Spectral Analysis and Optimal Filtering

Chapter 6. Random Processes

Probability Space. J. McNames Portland State University ECE 538/638 Stochastic Signals Ver

Stat 248 Lab 2: Stationarity, More EDA, Basic TS Models

TIME SERIES AND FORECASTING. Luca Gambetti UAB, Barcelona GSE Master in Macroeconomic Policy and Financial Markets

If we want to analyze experimental or simulated data we might encounter the following tasks:

Random Signal Transformations and Quantization

Introduction to Statistics and Error Analysis

ELEG 3143 Probability & Stochastic Process Ch. 6 Stochastic Process

X t = a t + r t, (7.1)

!P x. !E x. Bad Things Happen to Good Signals Spring 2011 Lecture #6. Signal-to-Noise Ratio (SNR) Definition of Mean, Power, Energy ( ) 2.

Gaussian, Markov and stationary processes

Centre for Mathematical Sciences HT 2017 Mathematical Statistics. Study chapters 6.1, 6.2 and in the course book.

EEG- Signal Processing

Joint Probability Distributions and Random Samples (Devore Chapter Five)

Discrete time processes

ECE 541 Stochastic Signals and Systems Problem Set 9 Solutions

Temperature measurement

Markov Chains and Hidden Markov Models

Econometría 2: Análisis de series de Tiempo

Reliability and Risk Analysis. Time Series, Types of Trend Functions and Estimates of Trends

Chapter 2 Random Processes

Final Exam. Economics 835: Econometrics. Fall 2010

Solutions to Homework Set #6 (Prepared by Lele Wang)

Problem Set 1 Solution Sketches Time Series Analysis Spring 2010

UCSD ECE153 Handout #40 Prof. Young-Han Kim Thursday, May 29, Homework Set #8 Due: Thursday, June 5, 2011

Stochastic Processes: I. consider bowl of worms model for oscilloscope experiment:

Lecture 3 Stationary Processes and the Ergodic LLN (Reference Section 2.2, Hayashi)

Centre for Mathematical Sciences HT 2017 Mathematical Statistics

Model-building and parameter estimation

TAKEHOME FINAL EXAM e iω e 2iω e iω e 2iω

Ch3. TRENDS. Time Series Analysis

ECE 636: Systems identification

Parametric Signal Modeling and Linear Prediction Theory 1. Discrete-time Stochastic Processes

Communication Theory II

System Identification

Econ 424 Time Series Concepts

Discrete-Time Signals and Systems

This is a Gaussian probability centered around m = 0 (the most probable and mean position is the origin) and the mean square displacement m 2 = n,or

Class 1: Stationary Time Series Analysis

Review of Probability

Some Statistics. V. Lindberg. May 16, 2007

Multivariate Distribution Models

9.07 MATLAB Tutorial. Camilo Lamus. October 1, 2010

CHAPTER 2 RANDOM PROCESSES IN DISCRETE TIME

Name of the Student: Problems on Discrete & Continuous R.Vs

Stochastic Processes

Stochastic Processes. M. Sami Fadali Professor of Electrical Engineering University of Nevada, Reno

P 1.5 X 4.5 / X 2 and (iii) The smallest value of n for

Simulation. Where real stuff starts

Some Time-Series Models

ESSE Mid-Term Test 2017 Tuesday 17 October :30-09:45

A time series is called strictly stationary if the joint distribution of every collection (Y t

Terminology Suppose we have N observations {x(n)} N 1. Estimators as Random Variables. {x(n)} N 1

Parametric Techniques Lecture 3

July 31, 2009 / Ben Kedem Symposium

DART_LAB Tutorial Section 2: How should observations impact an unobserved state variable? Multivariate assimilation.

Complement on Digital Spectral Analysis and Optimal Filtering: Theory and Exercises

Robustness and Distribution Assumptions

Covariance and Correlation

LECTURE 10: REVIEW OF POWER SERIES. 1. Motivation

CS491/691: Introduction to Aerial Robotics

Parametric Techniques

Time Series 2. Robert Almgren. Sept. 21, 2009

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

Centre for Mathematical Sciences HT 2018 Mathematical Statistics

1 Introduction to Generalized Least Squares

Part 1: You are given the following system of two equations: x + 2y = 16 3x 4y = 2

Random Processes Why we Care

Math 180B Problem Set 3

LECTURES 2-3 : Stochastic Processes, Autocorrelation function. Stationarity.

Chapter 6: Random Processes 1

Ensemble Data Assimilation and Uncertainty Quantification

Random signals II. ÚPGM FIT VUT Brno,

11. Further Issues in Using OLS with TS Data

Potentially useful reading Sakurai and Napolitano, sections 1.5 (Rotation), Schumacher & Westmoreland chapter 2

Bivariate distributions

Stochastic process for macro

ENSC327 Communications Systems 19: Random Processes. Jie Liang School of Engineering Science Simon Fraser University

Lab 4: Quantization, Oversampling, and Noise Shaping

Theory of Stochastic Processes 3. Generating functions and their applications

Lesson 4: Stationary stochastic processes

Problem Set Spring 2012

1. Stochastic Processes and Stationarity

Review of probability. Nuno Vasconcelos UCSD

Reminders. Thought questions should be submitted on eclass. Please list the section related to the thought question

3F1 Random Processes Examples Paper (for all 6 lectures)

Statistical signal processing

Ch 4. Models For Stationary Time Series. Time Series Analysis

BTRY 4830/6830: Quantitative Genomics and Genetics Fall 2014

4. Distributions of Functions of Random Variables

1 Kalman Filter Introduction

for valid PSD. PART B (Answer all five units, 5 X 10 = 50 Marks) UNIT I

Lecture Notes 7 Stationary Random Processes. Strict-Sense and Wide-Sense Stationarity. Autocorrelation Function of a Stationary Process

Lecture 2: Univariate Time Series

UCSD ECE 153 Handout #46 Prof. Young-Han Kim Thursday, June 5, Solutions to Homework Set #8 (Prepared by TA Fatemeh Arbabjolfaei)

Statistics of stochastic processes

MAS223 Statistical Inference and Modelling Exercises

Lecture 10: Powers of Matrices, Difference Equations

Stochastic Process II Dr.-Ing. Sudchai Boonto

Transcription:

Laboratory Project 1: Introduction to Random Processes Random Processes With Applications (MVE 135) Mats Viberg Department of Signals and Systems Chalmers University of Technology 412 96 Gteborg, Sweden Email: viberg@chalmers.se July 2009. 1 Introduction The purpose of this laboratory exercise is to illustrate some important concepts related to random processes. You will mostly use Matlab to compute and plot various quantities, and then contemplate on the result. The laboratory project is mandatory for the course. To get a pass, you need to hand in a report with your results, and a carefully selected set of plots (there will be several!). The deadline for handing in the report will be posted on the course homepage, but a preliminary date is October 3. You should work in groups of 2 students and send in the report as a pdf-file to viberg@chalmers.se. Random processes are frequently encountered in virtually all engineering applications. This is especially true when we are dealing with real data, collected by imperfect sensors and/or transmitted of random media. The key to a successful solution is then to understand random signals, or rather models of such processes. In this project we consider some basic concepts used to characterize random processes. Perhaps the most important is the nature of a random process itself. A short introduction is given in Section 4. More details regarding the background theory are given in [1], Chapters 5 and 8. 2 Pairs of Uncorrelated Random Variables The goal of this exercise is to increase the understanding of what the joint distribution of two random variables means. In the first case, you will study uncorrelated variables, using the Gaussian and Uniform distributions respectively. Task 1.1: Histogram Use Matlab to generate N = 2000 random variables x k from the N(0,1) (randn) and u k U(0,1) (rand) distributions 1 respectively, where k indicates realization number k. Plot the histograms using the hist command. Note that you can control the number of bins in the histogram with a second argument. Task 1.2: Joint Distribution Generate two vectors x and y of N = 2000 independent N(0,1) random variables. Illustrate the joint distribution by plotting y versus x using plot(x,y,. ) (this is called a scatterplot). What is the shape of the equiprobability lines (i.e. level curves in the joint 1 Generally, the typewriter font is used for Matlab commands in this document.

Lab 1: Introduction to random processes, MVE 135 2 distribution)? Next, continue with two vectors u and v from the U(-a,a) distribution, where a is selected to give variance one (a = 3). What is the shape of the scatterplot, and what can you say about the level curves now? Finally, generate a scatterplot of x versus u (Gaussian versus uniform) and explain the shape. Task 1.3: Conditional Distribution An important situation in applications is that we know the outcome of one variable (e.g. from a measurement), and we are asked to make an estimate of an unobservable quantity. A crucial concept for this situation is the conditional distribution. The distribution of x when we know the value of y is denoted p(x y). It is a slice of the joint distribution p(x, y), along the x-direction at some fixed y = ŷ, and then normalized to integrate to one: p(x y) = p(x, y)/p(y). Generate samples from this distribution by choosing a fixed value ŷ = 0.5 and a tolerance δy = 0.1. Go through the ordered pairs (x k, y k ) (where ( ) k indicates the kth realization), and select those x k s where ŷ y < y k < ŷ + y (note that y > 0 is needed since we are dealing with a continuous-valued distribution). Plot the histogram of the so selected samples, i.e., from p(x y = ŷ). Is it different from the marginal distribution p(x)? Why? Repeat the experiment with the pair (x k, u k ), fixing u k = 0.5. Explain the result. 3 Pairs of Correlated Random Variables Task 2.1: Joint Distribution and Correlation In this task you will investigate how correlation (or, more generally, dependency) changes the joint distribution. Start with the uncorrelated N(0,1) variables x and y from Task 1.1. Now, generate a new variable z according to 2 : z = αx + 1 α 2 y, 1 α 1. Show (theoretically) that z is also N(0,1) and that the correlation between x and z is given by r xz = E[xz] = α. You shall now illustrate the meaning of the correlation by generating scatterplots for different values α {0.5, 0.5, 0.9, 0.9}. Verify, for at least one of the cases, that z is also N(0,1), by plotting the histogram. After seeing the scatterplots, suggest a simple way to interpret correlation between two random variables! Task 2.2: Conditional Distribution In Task 1.3, the conditional distribution is the same as the marginal, since the variables are uncorrelated. We will now investigate how correlation changes the picture. First, generate z as above, with α = 0.7. Then generate samples from the distribution p(x z = 0.5) using the same procedure as in Task 1.3. Plot the histogram. Repeat for p(x z = 0.5). Then generate a new z with α = 0.7 and plot the histogram for p(x z = 0.5). Summarize your observations, and explain how correlation means that one variable holds information about the other. 4 Random Processes: White Noise A random process in discrete time is a sequence of random variables. Thus, a process {x[n]} has actually two dimensions: the time variable n takes values from..., 1, 0, 1,..., whereas the realization is chosen from the continuous event space, according to the specified distribution. The simplest random process is the White Gaussian Noise (WGN), which is a sequence of uncorrelated random variables with a Gaussian distribution. To illustrate the two-dimensional nature of a stochastic process, we can think of an N K matrix X X = x 1 [1]... x K [1].. x 1 [N]... x K [N]. (1) 2 Note that the actual way the variable is generated is unimportant. Only its statistical properties matter. This is very fortunate for engineers, since the exact underlying physics/chemistry/biology etc. of a complicated engineering system is usually beyond comprehension. But most of the time we can get (sufficiently) good statistical models!

Lab 1: Introduction to random processes, MVE 135 3 Thus, the nth row of X contains K different realizations of a sample x[n], whereas column k is one realization of the whole sequence {x[1],..., x[n]}, indexed by the realization number k. Thus, we can form the Ensemble Average µ x [n] of a sample x[n] as 1 µ x [n] = lim K K and the Time Average for the kth realization is given by 1 x k = lim N N K x k [n] k=1 N x k [n]. Note that we are using samples from the event space rather than treating it as continuous, mimicking the process of generating many observations of the same quantity. In most cases, the distribution is continuous, and the theoretical ensemble average is computed by an integral rather than a sum. We make no difference between these cases in the present exposition. An important concept for stochastic processes is ergodicity, which means that ensemble and time averaging gives the same result. For this to be possible we must clearly have µ x [n] = µ x, independently of n, and x k = x, independently of k. Thus, ergodicity is related to (wide-sense) stationarity. More details are given in Section 8.3 of [1]. Task 4.1: Ensemble and Time Averages Generate a matrix X as in (1), with K = 256 realizations of the stochastic process x[n], n = 1,..., N. Use N = 256 and let each x k [n] be N(0,1) WGN. In Matlab, this is conveniently done as X=randn(N,K). Plot the ensemble average ˆµ x [n] as a function of n by averaging along the rows in X. Use mean(x );. Next, plot the time average as a function of realization (mean(x);). Does this process appear to be ergodic in the mean? Note that the averages are different from the theoretical values due to the finiteness of N and K. Task 4.2: Joint Distribution and Correlation Illustrate the joint distribution of x[n 1 ] and x[n 2 ] by scatterplots, for a few values of n 1 and n 2. Do they look uncorrelated? Verify by computing the sample ensemble correlation ˆr x (n 1, n 2 ) = 1 K x k [n 1 ]x k [n 2 ] K n=1 (we call it sample because K is finite the true ensemble average r x (n 1, n 2 ) = E[x(n 1 )x(n 2 )] would be obtained for K ). 5 Random Walk Process In this part you shall study the simple random walk process, introduced in Example 8.5 on p. 282 in [1]. The process x[n] is recursively generated as k=1 x[n] = x[n 1] + w[n], (2) where w[n] is N(0,1) WGN. The filtering introduces a correlation between successive samples of x[n]. The first task is to theoretically characterize this correlation. Then you shall generate scatterplots to illustrate the theoretical results. Task 5.1 (Theoretical): Mean Value Verify that µ x [n] = 0 for all n. Task 5.2 (Theoretical): Variance Assume that the process is started with x[0] = 0, so that x[1] = w[1] and E[x 2 [1]] = σ 2 w = 1. Derive a formula for recursively computing P x [n] = E[x 2 [n]] in terms of P x [n 1]. Exploit the fact that x[n l] is uncorrelated to w[n] for any l 1. Solve the resulting difference equation and give an explicit expression for P x [n]. What happens as n?

Lab 1: Introduction to random processes, MVE 135 4 Task 5.3 (Theoretical): Auto-Correlation Compute the auto-correlation r x (n, n 1) by multiplying (2) with x[n 1] and take expectation. Continue with r x (n, n 2) and generalize to r x (n, n l) for any l > 0. Is the process wide-sense stationary (r x (n, n l) independent of n)? Finally, give an explicit expression for the Normalized Correlation Coefficient What happens as n (for fixed l)? ρ x (n, n l) = r x (n, n l) Px (n)p x (n l) Task 5.4: Joint Distribution Generate a 256 256 matrix X similar to (1), where each column is generated as in (2). This can conveniently be done using the command x=filter(1,[1-1],w); for each column. Plot all realizations in the same figure using plot(x). Explain what you see! Is it consistent with your theoretical calculations? Next, generate scatterplots for pairs (x[n 1 ], x[n 2 ]) with (n 1, n 2 ) {(10, 9), (50, 49), (100, 99), (200, 199)} and (n 1, n 2 ) {(50, 40), (100, 90), (200, 190)}. Comment on the plots in light of the theoretical computations! Task 5.5: Sample Auto-Correlation Compute the sample ensemble auto-correlation ˆr x (n, n 1) as a function of n (n = 2 : 256). This is done by averaging the product x[n]x[n 1] along the rows in the matrix X. Plot ˆr x (n, n 1) versus n, together with the theoretical values r x (n, n 1) in the same plot. Note the agreement with the theoretical values. In this experiment you used K = 256 realizations of the same process to compute the ensemble auto-correlation. Would it be possible to estimate the auto-correlation r x (n, n 1) from one realization only, for this process? 6 Damped Random Walk As a final example you shall study a stationary random process. This time, let x[n] be generated as x[n] = 0.9x[n 1] + w[n], (3) where w[n] is N(0,1) WGN. Similar to the random walk, this is a first-order auto-regressive (AR) process. You shall repeat the above calculations for this model, which looks similar at first sight, but which has quite different behavior! Task 6.1 (Theoretical): Variance Assume again that the process is started with x[0] = 0 so that x[1] = w[1] and E[x 2 [1]] = σ 2 w = 1. Derive the recursion formula for P x [n] and give an explicit expression for P x [n]. Compute the limiting variance as n? Task 6.2 (Theoretical): Auto-Correlation Compute the auto-correlation function r x (n, n l) = E[x[n]x[n l]]. Is this process wide-sense stationary? What if n? Task 6.3: Joint Distribution Generate a 256 256 matrix X similar to (1), where each column is generated as in (3) (Matlab: x=filter(1,[1-0.9],w);). Plot all realizations in the same plot using plot(x) and comment on the results. Generate scatterplots for pairs (x[n 1 ], x[n 2 ]) with (n 1, n 2 ) {(10, 9), (50, 49), (100, 99), (200, 199)} and (n 1, n 2 ) {(50, 40), (100, 90), (200, 190)}. Comment on the plots in light of the theoretical computations. Compare with Task 5.4. Task 6.4: Sample Auto-Correlation Compute the sample ensemble auto-correlation ˆr x (n, n 1) versus n, as in Task 5.5, and plot ˆr x (n, n 1) and the theoretical value r x (n, n 1) versus n in the same figure. Is there any significant difference from Task 5.5? Since this process is stationary (for large n), we expect the same result also from a time average. Thus, the auto-correlation can be estimated from a single realization as ˆr x (l) = 1 N N x[n]x[n l] n=l Test this approach on one or two realizations, at least for l = 1, and compare to the theoretical auto-correlation and to the result obtained using ensemble averaging. Keep in mind that both K and N are finite, so you should not expect a perfect agreement.

Lab 1: Introduction to random processes, MVE 135 5 References [1] S.L. Miller and D.G. Childers. Probability and Random Processes With Applications to Signal Processing and Communications. Elsevier Academic Press, Burlington, MA, 2004.