random variable with normal distribution

2 Ansichten (letzte 30 Tage)
saif yahya
saif yahya am 22 Dez. 2020
Kommentiert: Image Analyst am 23 Dez. 2020
how can i find the first five moments of a random variable with pdf gaussisn distribution , and finding the characteristic function all in matlab?

Akzeptierte Antwort

Image Analyst
Image Analyst am 22 Dez. 2020
Bearbeitet: Image Analyst am 22 Dez. 2020
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 Kommentare
saif yahya
saif yahya am 23 Dez. 2020
if the above random variable r you defined by randn is truncated to have a region support r=[40,150] how to define the new pdf
Image Analyst
Image Analyst am 23 Dez. 2020
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by