# 0.9 Lab 7a - discrete-time random processes (part 1)  (Page 5/5)

 Page 5 / 5

Notice that we cannot form a density estimate by simply differentiating the empirical CDF, since this function contains discontinuities at thesample locations ${X}_{i}$ . Rather, we need to estimate the probability that a random variable willfall within a particular interval of the real axis. In this section, we will describe a common method known as the histogram .

## The histogram

Our goal is to estimate an arbitrary probability density function, ${f}_{X}\left(x\right)$ , within a finite region of the $x$ -axis. We will do this by partitioning the region into $L$ equally spaced subintervals, or “bins”,and forming an approximation for ${f}_{X}\left(x\right)$ within each bin. Let our region of support start at the value ${x}_{0}$ , and end at ${x}_{L}$ . Our $L$ subintervals of this region will be $\left[{x}_{0},{x}_{1}\right]$ , $\left({x}_{1},{x}_{2}\right]$ , ..., $\left({x}_{L-1},{x}_{L}\right]$ . To simplify our notation we will define $bin\left(k\right)$ to represent the interval $\left({x}_{k-1},{x}_{k}\right]$ , $k=1,2,\cdots ,L$ , and define the quantity $\Delta$ to be the length of each subinterval.

$\begin{array}{ccc}\hfill bin\left(k\right)& =& \left({x}_{k-1},{x}_{k}\right]\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.277778em}{0ex}}k=1,2,\cdots ,L\hfill \\ \hfill \Delta & =& \frac{{x}_{L}-{x}_{0}}{L}\hfill \end{array}$

We will also define $\stackrel{˜}{f}\left(k\right)$ to be the probability that $X$ falls into $bin\left(k\right)$ .

$\begin{array}{ccc}\hfill \stackrel{˜}{f}\left(k\right)& =& P\left(X\in bin\left(k\right)\right)\hfill \\ & =& {\int }_{{x}_{k-1}}^{{x}_{k}}{f}_{X}\left(x\right)dx\hfill \end{array}$
$\begin{array}{ccc}& \approx & {f}_{X}\left(x\right)\Delta \phantom{\rule{4pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\text{for}\phantom{\rule{4.pt}{0ex}}x\in bin\left(k\right)\hfill \end{array}$

The approximation in [link] only holds for an appropriately small bin width $\Delta$ .

Next we introduce the concept of a histogram of a collection of i.i.d. random variables $\left\{{X}_{1},{X}_{2},\cdots ,{X}_{N}\right\}$ . Let us start by defining a function that will indicate whether ornot the random variable ${X}_{n}$ falls within $bin\left(k\right)$ .

${I}_{n}\left(k\right)=\left\{\begin{array}{cc}1,\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}{X}_{n}\in bin\left(k\right)\hfill \\ 0,\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}{X}_{n}\notin bin\left(k\right)\hfill \end{array}\right)$

The histogram of ${X}_{n}$ at $bin\left(k\right)$ , denoted as $H\left(k\right)$ , is simply the number of random variables that fall within $bin\left(k\right)$ . This can be written as

$H\left(k\right)=\sum _{n=1}^{N}{I}_{n}\left(k\right)\phantom{\rule{4pt}{0ex}}.$

We can show that the normalized histogram, $H\left(k\right)/N$ , is an unbiased estimate of the probability of $X$ falling in $bin\left(k\right)$ . Let us compute the expected value of the normalized histogram.

$\begin{array}{ccc}\hfill E\left[\frac{H\left(k\right)}{N}\right]& =& \frac{1}{N}\sum _{n=1}^{N}E\left[{I}_{n}\left(k\right)\right]\hfill \\ & =& \frac{1}{N}\sum _{n=1}^{N}\left\{1·P\left({X}_{n}\in bin\left(k\right)\right)+0·P\left({X}_{n}\notin bin\left(k\right)\right)\right\}\hfill \\ & =& \stackrel{˜}{f}\left(k\right)\hfill \end{array}$

The last equality results from the definition of $\stackrel{˜}{f}\left(k\right)$ , and from the assumption that the ${X}_{n}$ 's have the same distribution. A similar argument may be used to show that the variance of $H\left(k\right)$ is given by

$\begin{array}{c}\hfill Var\left[\frac{H\left(k\right)}{N}\right]=\frac{1}{N}\stackrel{˜}{f}\left(k\right)\left(1-\stackrel{˜}{f}\left(k\right)\right)\phantom{\rule{4pt}{0ex}}.\end{array}$

Therefore, as $N$ grows large, the bin probabilities $\stackrel{˜}{f}\left(k\right)$ can be approximated by the normalized histogram $H\left(k\right)/N$ .

$\stackrel{˜}{f}\left(k\right)\approx \frac{H\left(k\right)}{N}$

Using [link] , we may then approximate the density function ${f}_{X}\left(x\right)$ within $bin\left(k\right)$ by

${f}_{X}\left(x\right)\approx \frac{H\left(k\right)}{N\Delta }\phantom{\rule{4pt}{0ex}}\phantom{\rule{4pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\text{for}\phantom{\rule{4.pt}{0ex}}x\in bin\left(k\right)\phantom{\rule{4pt}{0ex}}.$

Notice this estimate is a staircase function of $x$ which is constant over each interval $bin\left(k\right)$ . It can also easily be verified that this density estimate integrates to 1.

## Exercise

Let $U$ be a uniformly distributed random variable on the interval [0,1]with the following cumulative probability distribution, ${F}_{U}\left(u\right)$ :

${F}_{U}\left(u\right)=\left\{\begin{array}{cc}0,\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}u<0\hfill \\ u,\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}0\le u\le 1\hfill \\ 1,\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}u>1\hfill \end{array}\right)$

We can calculate the cumulative probability distribution for the new random variable $X={U}^{\frac{1}{3}}$ .

$\begin{array}{ccc}\hfill {F}_{X}\left(x\right)& =& P\left(X\le x\right)\hfill \\ & =& P\left({U}^{\frac{1}{3}}\le x\right)\hfill \\ & =& P\left(U\le {x}^{3}\right)\hfill \\ & =& {\left({F}_{U},\left(u\right)|}_{u={x}^{3}}\hfill \\ & =& \left\{\begin{array}{cc}0,\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}x<0\hfill \\ {x}^{3},\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}0\le x\le 1\hfill \\ 1,\hfill & \text{if}\phantom{\rule{4.pt}{0ex}}x>1\hfill \end{array}\right)\hfill \end{array}$

Plot ${F}_{X}\left(x\right)$ for $x\in \left[0,1\right]$ . Also, analytically calculate the probability density ${f}_{X}\left(x\right)$ , and plot it for $x\in \left[0,1\right]$ .

Using $L=20$ , ${x}_{0}=0$ and ${x}_{L}=1$ , use Matlab to compute $\stackrel{˜}{f}\left(k\right)$ , the probability of $X$ falling into $bin\left(k\right)$ .

Use the fact that $\stackrel{˜}{f}\left(k\right)={F}_{X}\left({x}_{k}\right)-{F}_{X}\left({x}_{k-1}\right)$ .
Plot $\stackrel{˜}{f}\left(k\right)$ for $k=1,\cdots ,L$ using the stem function.

## Inlab report

1. Submit your plots of ${F}_{X}\left(x\right)$ , ${f}_{X}\left(x\right)$ and $\stackrel{˜}{f}\left(k\right)$ . Use stem to plot $\stackrel{˜}{f}\left(k\right)$ , and put all three plots on a single figure using subplot .
2. Show (mathematically) how ${f}_{X}\left(x\right)$ and $\stackrel{˜}{f}\left(k\right)$ are related.

Generate 1000 samples of a random variable $U$ that is uniformly distributed between 0 and 1 (using the rand command). Then form the random vector $X$ by computing $X={U}^{\frac{1}{3}}$ .

Use the Matlab function hist to plot a normalized histogram for your samples of $X$ , using 20 bins uniformly spaced on the interval $\left[0,1\right]$ .

Use the Matlab command H=hist(X,(0.5:19.5)/20) to obtain the histogram, and then normalize H .
Use the stem command to plot the normalized histogram $H\left(k\right)/N$ and $\stackrel{˜}{f}\left(k\right)$ together on the same figure using subplot .

## Inlab report

1. Submit your two stem plots of $H\left(k\right)/N$ and $\stackrel{˜}{f}\left(k\right)$ . How do these plots compare?
2. Discuss the tradeoffs (advantages and the disadvantages) between selecting a very large or very small bin-width.

#### Questions & Answers

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
SUYASH Reply
for screen printed electrodes ?
SUYASH
What is lattice structure?
s. Reply
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Sanket Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

### Read also:

#### Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Purdue digital signal processing labs (ece 438). OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10593/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?   By Rhodes By Mistry Bhavesh  By By By  