samedi 11 mars 2023

Conditional random sampling: n samples must add to Y

How do I sample n numbers X_1 through X_n (in one go?) such that their total is a given Y, and knowing that the unconditional distribution of X_i is (or would be) the normal distribution with parameters mu and sigma?

Just drawing n normally distributed numbers and scaling them to total Y doesn't seem right. If the absolute value of Y is very large, it would tend to produce n outliers (relative to the unconditional distribution) as opposed to - I don't know - 1 outlier. Also: if Y is zero, the result doesn't make sense.




Aucun commentaire:

Enregistrer un commentaire