Generating samples on a 2-D composite binomial distribution

Click For Summary

Discussion Overview

The discussion revolves around generating (X,Y) pairs that follow a composite distribution, specifically a mixture of normal distributions. Participants explore methods for creating samples that qualitatively resemble the desired model without needing rigorous compliance to statistical standards. The focus includes algorithmic simplicity and implementation ease.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant expresses a desire to generate (X,Y) pairs from a mixture of three normal distributions, emphasizing the need for a simple and understandable algorithm.
  • Another participant notes that the provided visual representation does not appear to be symmetric, suggesting potential issues with approximation or interpretation of the distribution.
  • A method for generating 2-D multivariate Gaussian distributions is proposed, involving the use of a vector of independent standard normal variables and transformation via a matrix and translation vector.
  • Clarification is made regarding the terminology, indicating that the original poster may be seeking a mixture model rather than simply adding normal random variables.
  • A simple algorithm is suggested for generating samples from a composite probability density function, involving selecting from the component densities based on their respective probabilities.
  • One participant expresses appreciation for the elegance of the proposed sampling method and confirms their understanding of generating samples from a 2-D Gaussian distribution.

Areas of Agreement / Disagreement

Participants show some agreement on the approach to generating samples from a mixture of distributions, but there is uncertainty regarding the interpretation of the original problem and the specifics of the distributions involved. The discussion remains unresolved on certain technical aspects and definitions.

Contextual Notes

There are limitations regarding the clarity of the original poster's requirements and the exact nature of the distributions being discussed. Some assumptions about the distributions and their properties remain unaddressed.

Swamp Thing
Insights Author
Messages
1,048
Reaction score
799
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   Reactions: 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.
 

Similar threads

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