random variable with normal distribution
조회 수: 2 (최근 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!
