<< Chapter < Page Chapter >> Page >

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 ( x ) .

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

Applying the transformation F X ( · ) to X .

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

P ( Y y ) = 0 , for y < 0 1 , for y > 1

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

F Y ( y ) = P ( Y y ) = P ( F X ( X ) F X ( x ) ) = P ( X x ) (monotonicity) = F X ( x ) = y .

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

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

Transforming a uniform random variable to one with distribution F X ( · ) .

Note that combining these results allows us to transform any continuous random variable X F X ( x ) to any other continuous random variable Z F Z ( z ) , provided that F Z ( · ) is a one-to-one function.

Transforming a random variable with distribution F X ( · ) to one with distibution F Z ( · ) .

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 ( x ) = ( 1 - e - 3 x ) u ( x ) .

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.

Questions & Answers

what is defense mechanism
Chinaza Reply
what is defense mechanisms
Chinaza
I'm interested in biological psychology and cognitive psychology
Tanya Reply
what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask