I only have the mean value and standard deviation value, how do I make a histogram with this?

27 ビュー (過去 30 日間)
Aasiya Syed
Aasiya Syed 2020 年 5 月 3 日
回答済み: Walter Roberson 2020 年 5 月 3 日
My mean is -30.10 and my standard deviation is 7.79
My count is going to be a maximum limit of 150.
How would I construct a histogram with just this info?
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 3 日
You need to know the distribution involved. Also if you are talking about maximum counts then you need to specify a bin size.

サインインしてコメントする。

回答 (2 件)

Mathias Andersen
Mathias Andersen 2020 年 5 月 3 日
This should do the trick.
x = 7.79*randn(150,1)-30.1;
histogram(x,'Normalization','pdf')

Walter Roberson
Walter Roberson 2020 年 5 月 3 日
https://www.mathworks.com/help/stats/normcdf.html
Use normcdf on two values representing the edges of the bin that you wish to have the maximum count of 350. diff() to find the probability associated with the bin. ceil() 350 divided by that probability. The result is the number of samples that you need to simulate so that the maximum expected count would be 350.
Now you can use normcdf on a vector of bin edges, diff, multiply by the sample size, and that gives the counts for the bins. Or you can generate the appropriate number of random points calculated and histogram.

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by