How do I generate points that match a histogram?

前端 未结 6 1513
迷失自我
迷失自我 2020-12-14 04:10

I am working on a simulation system. I will soon have experimental data (histograms) for the real-world distribution of values for several simulation inputs.

Whe

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 04:55

    More information about the problem would be useful. For example, what sort of values are the histograms over? Are they categorical (e.g., colours, letters) or continuous (e.g., heights, time)?

    If the histograms are over categorical data I think it may be difficult to parameterise the distributions unless there are many correlations between categories.

    If the histograms are over continuous data you might try to fit the distribution using mixtures of Gaussians. That is, try to fit the histogram using a $\sum_{i=1}^n w_i N(m_i,v_i)$ where m_i and v_i are the mean and variance. Then, when you want to generate data you first sample an i from 1..n with probability proportional to the weights w_i and then sample an x ~ n(m_i,v_i) as you would from any Gaussian.

    Either way, you may want to read more about mixture models.

提交回复
热议问题