Why doesn't the kurtosis function work properly for complex numbers?
이전 댓글 표시
Good morning,
I was trying out the kurtosis function on Matlab with complex numbers, using the following code:
var = sqrt(1/2) * randn(1,1000) + 1i * sqrt(1/2) * randn(1,1000);
var_kurt = kurtosis(var);
I was expecting var_kurt to equal 3, since I'm calculating the kurtosis of a gaussian distributed complex function, but instead I get a value of 68.7674 +18.3410i. However, kurtosis(real(var)) does equal 3, which surprises me since the kurtosis should not depend on the variable being complex. Any idea why this happens?
Thanks very much in advance,
Guillem
댓글 수: 1
Star Strider
2022년 9월 20일
The kurtosis function involves raising functions of the argument to the 4th power. In my experience, squaring a complex vector is the operation of multiplying it element-wise by its complex conjugate (the absolute value is the square root of that operation), rather than squaring the real and imaginary elements separately. It would likely be necessary to re-write the function to do that and then square that result to get the 4th power of the complex array that represents your data. The kurtosis function apparently assumes that all the arguments to it will be real.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Exploration and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!