random variable with normal distribution
1 次查看(过去 30 天)
显示 更早的评论
how can i find the first five moments of a random variable with pdf gaussisn distribution , and finding the characteristic function all in matlab?
0 个评论
采纳的回答
Image Analyst
2020-12-22
编辑:Image Analyst
2020-12-22
To get a bunch of random numbers drawn from a normal distribution, use randn().
r = randn(...........
If you want the nth moment just take the nth root of the sum of the values and divide by the number of samples minus 1.
If you want the central moments, then subtract the mean before raising to a power.
Sounds like homework (so I didn't give the actual MATLAB code, which is actually pretty simple - just a single line of code). Is it homework?
7 个评论
Image Analyst
2020-12-23
histogram() will give you the actual, empirical pdf. Not some theoretical analytical function. So the values don't matter. Support doesn't matter. You get what the PDF actually IS.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
