normal distribution random sample

12 ビュー (過去 30 日間)
Bran
Bran 2013 年 1 月 28 日
I have various points in a 3D space and I want to take a subsample of them according to the normal distribution. I want to take just 100. Do I simple use the command randn(1, 100) or must I first fit the normal distribution to my data to find mu and sigma??
Bran

回答 (1 件)

Shashank Prasanna
Shashank Prasanna 2013 年 1 月 28 日
I will be able to provide a clearer answer but I am not sure what you mean by "subsample of them according to the normal distribution".
1) If you use randn(1,100) it will generate normal random variables from a standard normal distribution (0 mean, 1 sigma), but this has nothing to do with your data.
2) For your data you will have to fit a distribution and then generate random samples from that distribution.
Depends on what you want, please explain your use-case and what you want to do.

Community Treasure Hunt

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

Start Hunting!

Translated by