Generating Random Samples from Discrete and Continuous Random Variables

  • Thread starter Tereno
  • Start date
  • Tags
    Statistics
In summary: And then you have to find the inverse of the function that generates the list.2. Suppose X is a continuous random variable with c.d.f. FX(x) = P(X
  • #1
Tereno
8
0
Hey guys I've got several questions about statistics.

Here's the first one.

1. Suppose X is a discrete random variable that takes on the three values x1, x2, x3 with probabilities p1, p2, p3 respectively. Describe how you could generate a random sample from X if all you had access to were a list of numbers generated at random from the interval [0, 1].

2. Suppose X is a continuous random variable with c.d.f. FX(x) = P(X  x). To make things easier, suppose further that X takes on values in an interval [a, b] (do allow for a to be −1 and b to be +1).

Let Y be the random variable defined by Y = FX(X). This looks strange, but is perfectly
valid since FX is just a function, and you are allowed to take functions of random variables.

Your problem: show that Y distributed U[0, 1].

Method: calculate the c.d.f. Y , FY (y) = P(Y  y), for all real y. Replace Y with FX(X),
and consider when you can take the inverse of FX.
Taking the inverse of FX is not always possible, in particular, for x < a and x > b. Consider
those cases separately.
You will find that the c.d.f. of Y is 0 for y < 0, y for 0  y  1, and 1 for y > 1, so indeed
Y distributed U[0, 1].
An important application of this fact is that if u is a random selection from the interval [0, 1], F−1 X (u) is a random selection from X.
 
Physics news on Phys.org
  • #2
Tereno said:
2. Suppose X is a continuous random variable with c.d.f. FX(x) = P(X  x).

Regarding the part in blue:

My browser is showing that as "X square x", as in there is a square-shaped symbol between the X and the x. Is that what you meant? Does anyone else see it differently? Your post is riddled with those squares.
 
  • #3
Concerning part 1. Find the pdf of X and call it f(t). Consider the
integral int(f(t), t,0,x)=y, where y is one of the numbers generated randomly from (0,1). Solve for x in the above integral. This will generate a quasi-random sequence of samplings of X.
 
  • #4
P(X  x) = P (X <= x)
and P(Y  y) = P (Y <= y)

and the other two are strict inequalities <

Sorry for the confusion.
 
  • #5
hmm..what do you mean by int(f(t), t,0,x)=y...??

o to x is the limits of integration?
 
  • #6
My familiarity with part 1. comes from Monte Carlo Methods for Integration, in which a definite integral gets approximated by the expectation value of a random variable (who's pdf matches the argument of the integral). In order to sample the random variable, call it x, one creates the equation int(pdf(x),x,o,y)=z, where pdf(x) is the probability density function of the random variable x, y is the variable to be solved for, and z is a random sequence chosen from an arbitrary distribution. As you can see, my example deals with the continuous case, but I would imagine that the discrete case, such as yours, may be dealt with in the same manner.
 
  • #7
Whoa..that's a little hard for me to understand. i don't think I've learn that yet.
 
  • #8
And here's another question:

2. Suppose X is a discrete random variable that takes on values from {1, 2, 3, . . .} with probabilities
{p1, p2, p3, . . .}. If u is a number selected at random from [0, 1] explain why

min {sum from i=1 to n of p subscript i >= u}

can be considered as a random selection from X.
 
  • #9
1. Suppose X is a discrete random variable that takes on the three values x1, x2, x3 with probabilities p1, p2, p3 respectively. Describe how you could generate a random sample from X if all you had access to were a list of numbers generated at random from the interval [0, 1].
Don't you have to know according to which random distribution that list of numbers was generated? I think at the very least you have to assume that you know their distribution even if you don't assume what it is (e.g. uniform).
 

1. What is the difference between a discrete random variable and a continuous random variable?

A discrete random variable can only take on a finite or countable number of values, while a continuous random variable can take on any value within a certain range.

2. How do you generate random samples from a discrete random variable?

To generate random samples from a discrete random variable, you can use a random number generator to select a value from the set of possible values according to the probability distribution of the variable.

3. How do you generate random samples from a continuous random variable?

To generate random samples from a continuous random variable, you can use a random number generator to select a value within the range of possible values, according to the probability density function of the variable.

4. What is the importance of generating random samples from random variables in scientific research?

Generating random samples from random variables allows for the creation of representative samples that can be used for statistical analysis and inference, providing insights and conclusions about the larger population from which the samples were drawn.

5. Are there any limitations or considerations when generating random samples from random variables?

Yes, there are certain limitations and considerations to keep in mind when generating random samples from random variables. These include the need for a large sample size to accurately represent the population, the potential for bias in the sampling process, and the importance of properly understanding and applying statistical methods to the data collected from the samples.

Similar threads

  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
9
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
472
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
440
  • Calculus and Beyond Homework Help
Replies
1
Views
732
  • Calculus and Beyond Homework Help
Replies
3
Views
920
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
30
Views
2K
  • Calculus and Beyond Homework Help
Replies
9
Views
543
Back
Top