Undergrad Generating samples on a 2-D composite binomial distribution

Click For Summary
SUMMARY

This discussion focuses on generating (X,Y) pairs that follow a composite binomial distribution, specifically through a mixture of three normal distributions. The proposed method involves using a 2-D multivariate Gaussian defined by the equation ##\mathbf y:= A\mathbf x + \mathbf b##, where ##\mathbf b## translates the mean and ##\mathbf A## controls the covariance. The algorithm requires selecting one of the three probability density functions with associated weights, ensuring that the weights sum to one, and then generating random samples accordingly. The approach is designed to be simple and easy to implement without strict adherence to randomness tests.

PREREQUISITES
  • Understanding of 2-D multivariate Gaussian distributions
  • Familiarity with probability density functions
  • Knowledge of mixture models in statistics
  • Basic programming skills for implementing algorithms
NEXT STEPS
  • Learn about generating random samples from 2-D Gaussian distributions
  • Study the principles of mixture models in statistics
  • Explore algorithms for sampling from probability density functions
  • Investigate the properties of multivariate normal distributions
USEFUL FOR

Data scientists, statisticians, and anyone interested in generating synthetic data that approximates complex distributions for modeling and simulation purposes.

Swamp Thing
Insights Author
Messages
1,045
Reaction score
775
TL;DR
How to generate (X,Y) samples having a distribution specified in terms of the sum of a few normal 2-D distributions?
I would like to generate (X,Y) pairs such that they would follow a distribution something like this:
1570588368324.png

This is the sum of three normal distributions. Each distribution could have a different taper along the X and the Y, plus an offset along X and/or Y. So the parameters of these three distributions would be the input for my process.

I don't need to meet any rigorous test of randomness or compliance with the ideal model -- it just needs to look qualitatively like the model and be really EASY to understand and implement. Speed is not too much of an issue either.

What would be a simple algorithm?
 
Physics news on Phys.org
that picture doesn't look like a 2-d normal --i.e. it isn't symmetric about the axis that goes from top left to bottom right. This rather obvious skew is a sign of (approximation?) problems looming.
- - - - -
An easy way of generating 2-d normals is start with
##\mathbf x## which is a d dimensional vector with iid components that are standard normals i.e. N(0,1) each

Then consider the 2-d multivariate gaussian given by
##\mathbf y:= A\mathbf x + \mathbf b##
where ##\mathbf b \in \mathbb R^\text{2 x 1}## and translates the mean and ##\mathbf A \in \mathbb R^\text{2 x d}## which controls the (co)variance which will be given by ##AA^T##

edit:
maybe I misread this OP actually wants a mixture model. Frequently people here say adding distributions when they mean adding random variables, so hard to tell. The fact that the thread is titled 2-d composite binomial made me think we are actually dealing with adding normal random variables, not a mixture.
 
Last edited:
Swamp Thing said:
What would be a simple algorithm?

Suppose ##f_1, f_2,f_3## are probability density functions and you want to generate random samples from a probability density function ##g = k_1 f_1 + k_2 f_2 + k_3 f_3##, where the ##0 \leq k_i \leq 1_i## are constants. Since ##g## is a probability density, it must be that ##k_1 + k_2 + k_3 = 1##. So you can use ##k_1,k_2,k_3## as probabilities. To generate a random sample from ##g##, first pick which density ##f_i## to use. Pick ##f_i## with probability ##k_i##, Then generate a random sample ##(x,y)## from the density that was selected.

To deal with your example, we need to know how to generate random samples from a 2-D gaussian distribution. Do you know how to do that?
 
  • Informative
Likes Swamp Thing
Stephen Tashi said:
To generate a random sample from gg, first pick which density fif_i to use. Pick fif_i with probability kik_i, Then generate a random sample (x,y)(x,y) from the density that was selected.

Thanks, that's pretty elegant. I wish I had thought of it :oops:. And it works the way sub-populations would actually contribute to the total stats according to their relative size.

Stephen Tashi said:
To deal with your example, we need to know how to generate random samples from a 2-D gaussian distribution. Do you know how to do that?
I think that part should be OK.

Thanks.
 
If there are an infinite number of natural numbers, and an infinite number of fractions in between any two natural numbers, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and... then that must mean that there are not only infinite infinities, but an infinite number of those infinities. and an infinite number of those...

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
Replies
15
Views
3K