Linked Questions

27
votes
5answers
45k views

How to sample from a discrete distribution? [duplicate]

Assume I have a distribution governing the possible outcome from a single random variable X. This is something like [0.1, 0.4, 0.2, 0.3] for X being a value of either 1, 2, 3, 4. Is it possible to ...
8
votes
2answers
331 views

Approaches for generating synthetic survey data with dependent answers?

I would like to produce synthetic survey data. At the moment I produce independent answers between questions according to an arbitrary discrete distribution as in this question. I want to generate ...
4
votes
2answers
2k views

Choosing a discrete non-uniform distribution for generating random integers

I have a list $l$ containing integers in the range $[1,max]$ On list $l$ I do an operation $isPresent(x)$ which return true if x...
3
votes
2answers
33 views

Simulating random variables from a discrete distribution II [duplicate]

I have the following discrete probability distribution where $p$, $q$ and $r$ are known constants: $P(X=0)=q$, $0<q<1$ $P(X=1)=1-p-q-r$, $0<p+q+r<1$ $P(X=2)=p$, $0<p<1$ $P(X=3)=...
2
votes
2answers
1k views

Sampling from a piecewise linear probability density function

I have a pdf modelled as a piecewise linear function that I can represent as the sequence of pairs of real numbers standing for the points in the of the piecewise line: $\{(x_{1}, y_{1}), \dots, (x_{n}...
2
votes
2answers
676 views

Generate random number from a specific probability mass in R

How can I generate sample from a distribution with probability mass $P(X=x)$ in R? I know that probability mass, but it is not from a known distribution, also it is not linear, instead it has a ...
5
votes
1answer
1k views

Generating data with a pre-specified odds ratio

I have to simulate (in javascript) the likelihood that members of a certain population would have a disease, given a contextual value. All information I have comes from papers that show odds ratios ...
2
votes
1answer
61 views

Modeling distribution on a dart board

I have statistics for a game similar to lawn dart (3 concentric rings instead of 2) and I wanted to simulate shot distribution. What statistical distribution could I use? The game is throwing a ...
1
vote
1answer
890 views

How to draw random sample from an empirical joint distribution?

I want to draw a random sample from a known joint distribution. what I have now is the number of people in each age and income bracket (as shown in the example below):0.12 0.42 0.06 16 0.08 0.28 0.04 ...
0
votes
1answer
85 views

Randomly generating integers with prior probabilities [duplicate]

I'm after a nice method to draw from a range of integers given known prior probabilities. Say I wanted an 80% chance of drawing 1, a 15% chance of drawing 2, and a 5% chance of drawing 3... I'm ...
0
votes
1answer
1k views

Generate bivariate random numbers from joint distribution function

I have an empirical joint distribution function $ \hat{F}(x_1,x_2) = Pr(X_1 < x_1, X_2 < x_2) $ Can I generate bivariate random number from this distribution with a certain condition such as $...