简体   繁体   中英

Given mean, variance and number of buckets, find histogram bucket boundaries

I need to find the bucket boundaries of the histograms when user inputs mean, variance and number of buckets for a standard normal distribution in addition to generating the distribution values.

I am using java nextGaussian() to generate the normal distribution values, but I am not sure how to get the bucket boundaries so that the histogram shape would look like a normal distribution.

Any help appreciated.

Thanks!

In general you want to have a range slightly larger than X max - X min and then divide the range into the desired number of bins. I'm unaware of any "definitive" algorithm out there, this is as much art as science. There's always some fiddling with the centering, range, and number of bins to get the bin boundaries to fall along nice human-readable values, and every stats package I know allows you to override their initial choices to improve the aesthetics of the outcome.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM