フィルターのクリア

Computing 4th cumulant of Gaussian variable

25 ビュー (過去 30 日間)
Divij Gupta
Divij Gupta 2021 年 6 月 19 日
回答済み: Chunru 2021 年 6 月 19 日
I am trying to write a program to compute the 4th cumulant for a given array of numbers. For a test, I'm generating an array of numbers distributed as a Gaussian distribution. The expected 4th order cumulant is 0. However, I am getting a wildly oscillating value, wildly oscillating around 0. Here is the code, I have no idea what is going wrong (if anything):
function cu4 = fourthCumulantReal(a)
cu4 = moment(a,4) - 3*(moment(a,2))^2;
end
Test Data: fourthCumulantReal(normrnd[0,1,[1,50]])

回答 (1 件)

Chunru
Chunru 2021 年 6 月 19 日
When number of samples is sufficiently large, the sample mean (your fucntion output) is approaching to the true expected value (0).
fourthCumulantReal(normrnd(0,1,[1,500000]))
ans = -0.0036
function cu4 = fourthCumulantReal(a)
cu4 = moment(a,4) - 3*(moment(a,2))^2;
end

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by