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

 Page 4 / 5

To test your function, generate a sample of Uniform[0,1] random variables using the function X=rand(1,N) . Plot two CDF estimates: one using a sample size $N=20$ , and one using $N=200$ . Plot these functions in the range t=[-1:0.001:2] , and on each plot superimpose the true distribution for a Uniform[0,1] random variable.

Hand in your empcdf function and the two plots.

## Generating samples from a given distribution

It is oftentimes necessary to generate samples from a particular distribution. For example, we might want to run simulations to test how an algorithmperforms on noisy inputs. In this section we will address the problem of generating random numbers froma given distribution ${F}_{X}\left(x\right)$ .

Suppose we have a continuous random variable $X$ with distribution ${F}_{X}\left(x\right)$ , and we form the new random variable $Y={F}_{X}\left(X\right)$ . In other words $Y$ is a function of $X$ , and the particular function is the CDF of the random variable $X$ .

How is $Y$ distributed? First notice that ${F}_{X}\left(·\right)$ is a probability, so that $Y$ can only take values in the interval $\left[0,1\right]$ .

$P\left(Y\le y\right)=\left\{\begin{array}{cc}0,\hfill & \text{for}\phantom{\rule{4.pt}{0ex}}y<0\hfill \\ 1,\hfill & \phantom{\rule{4.pt}{0ex}}\text{for}\phantom{\rule{4.pt}{0ex}}y>1\hfill \end{array}\right)$

Since ${F}_{X}\left(x\right)$ is a monotonically increasing function of $x$ , the event $\left\{Y\le y\right\}$ is equivalent to $\left\{X\le x\right\}$ if we define $y={F}_{X}\left(x\right)$ . This implies that for $0\le y\le 1$ ,

$\begin{array}{ccc}\hfill {F}_{Y}\left(y\right)& =& P\left(Y\le y\right)\hfill \\ & =& P\left({F}_{X}\left(X\right)\le {F}_{X}\left(x\right)\right)\hfill \\ & =& P\left(X\le x\right)\phantom{\rule{50.58878pt}{0ex}}\text{(monotonicity)}\hfill \\ & =& {F}_{X}\left(x\right)\hfill \\ & =& y\phantom{\rule{4pt}{0ex}}.\hfill \end{array}$

Therefore $Y$ is uniformly distributed on the interval [0,1] .

Conversely, if ${F}_{X}\left(·\right)$ is a one-to-one function, we may use the inverse transformation ${F}_{X}^{-1}\left(U\right)$ to transform a Uniform[0,1] random variable $U$ to a random variable with distribution ${F}_{X}\left(·\right)$ .

Note that combining these results allows us to transform any continuous random variable $X\sim {F}_{X}\left(x\right)$ to any other continuous random variable $Z\sim {F}_{Z}\left(z\right)$ , provided that ${F}_{Z}\left(·\right)$ is a one-to-one function.

## Exercise

Your task is to use i.i.d. Uniform[0,1] random variables to generatea set of i.i.d. exponentially distributed random variables with CDF

${F}_{X}\left(x\right)=\left(1-{e}^{-3x}\right)u\left(x\right)\phantom{\rule{4pt}{0ex}}.$

Derive the required transformation.

Generate the Uniform[0,1] random variables using the function rand(1,N) . Use your empcdf function to plot two CDF estimates for the exponentially distributed random variables:one using a sample size $N=20$ , and one using $N=200$ . Plot these functions in the range x=[-1:0.001:2] , and on each plot superimpose the true exponential distribution of [link] .

## Inlab report

• Hand in the derivation of the required transformation, and yourMatlab code.
• Hand in the two plots.

## Estimating the probability density function

The statistical properties of a random variable are completely described by its probability density function (assuming it exists, of course).Therefore, it is oftentimes useful to estimate the PDF, given an observation of a random variable.For example, similar to the empirical CDF, probability density estimates may be used to test a proposed model.They may also be used in non-parametric classification problems, where we need toclassify data as belonging to a particular group but without any knowledge of the true underlying class distributions.

where we get a research paper on Nano chemistry....?
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
Ali
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
ya I also want to know the raman spectra
Bhagvanji
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
Got questions? Join the online conversation and get instant answers!