[Statistical Tools] Skewness, Kurtosis bug

[Statistical Tools] Skewness, Kurtosis bug - Сообщения

#1 Опубликовано: 28.05.2018 01:32:09
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Stat Skewness(Y).sm (10 КиБ) скачан 49 раз(а).
#2 Опубликовано: 28.05.2018 01:46:01
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... kurtosis does not cut the mustard either.

Stat Skewness(Y).sm (12 КиБ) скачан 49 раз(а).
1 пользователям понравился этот пост
NDTM Amarasekera 28.05.2018 23:11:00
#3 Опубликовано: 29.05.2018 12:22:15
NDTM Amarasekera

NDTM Amarasekera

130 сообщений из 352 понравились пользователям.

Группа: User

I have the same problem with latest SS appVersion(4)="0.99.6671.38791".
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
#4 Опубликовано: 29.05.2018 14:52:33
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

I don't know anything about Skewness/Kurtosis, but I did look up the Matlab algorithms for each. Jean, I don't know where your algorithms comes from, but it appears SMath uses same/similar algorithms as Matlab.

Stat Skewness(Y)_Lyles.sm (19 КиБ) скачан 50 раз(а).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#5 Опубликовано: 29.05.2018 23:34:12
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Jean, I don't know where your algorithms come from, but it appears SMath uses same/similar algorithms as Matlab.


Source code: Mathcad/Mathsoft "Statistical Electronic Book"
As you know, there are three kinds of lies:
1 white lie... 2. convenient lie ... 3. Statistics

Thanks for checking, thanks Collab NDTMA for checking too.

#6 Опубликовано: 30.05.2018 06:14:36
NDTM Amarasekera

NDTM Amarasekera

130 сообщений из 352 понравились пользователям.

Группа: User

Thank you Jean for highlighting this issue.

Sta bug.jpg
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
#7 Опубликовано: 30.05.2018 07:03:22
NDTM Amarasekera

NDTM Amarasekera

130 сообщений из 352 понравились пользователям.

Группа: User

Forgot to attach the Excel worksheet. Sorry!

Skew & Kurtosis.xlsx (24 КиБ) скачан 38 раз(а).
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
#8 Опубликовано: 30.05.2018 07:50:49
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

Wrote


Source code: Mathcad/Mathsoft "Statistical Electronic Book"



I may have found the issue. Not sure if there is a typo or not in your book, but if you look at the Mathcad Website here: https://help.ptc.com/mathcad/en/index.html#page/PTC_Mathcad_Help/example_kurt_and_skew.html

You will see a formula similar to yours. However, you need to move the StdDev(Y) function outside of the left most expression in each function. I'm not at a computer with Smath right now so I can't verify if it produces the same results. Will check back later.

Untitled drawing.png
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#9 Опубликовано: 30.05.2018 14:14:55
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

However, you need to move the StdDev(Y) function outside of the left most expression in each function



That is immaterial, the suite of multiplications is commutative.
Smath/Matlab use the same Kurtosis algorithm ... different than Mathcad.
OriginLab 7.5 [formerly Microcal] gives 19 stat parameters wrt to 'Y'
OriginLab 7.5 kurtosis = same as Mathcad [-0.618]
Note that OriginLab is the Bible CAS in Pharmacokinetics.

Smath KurtosisExcess(Y)=-0.775 is much closer ... still troubling.

Cheers ... Jean

Stat Skewness_Kurtosis(Y).sm (32 КиБ) скачан 38 раз(а).
#10 Опубликовано: 30.05.2018 14:45:37
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

Wrote


That is immaterial, the suite of multiplications is commutative.



Yes. but (a*b*c)^4 is much different than (a*b )*C^4 Edit: Whoops I see that it looks right in original file. I miscounted parentheses.

I've done quite a bit of research into this because I've been curious. There are two differences between the Matlab/Smath and Mathcad Functions.

1.) The Matlab kurtosis link mentions this, but the Wolfram link explains it very well. Kurtosis has been historically defined such that a normal distribution has kurtosis of 3. However, Kurtosis Excess is defined with a -3 offset such that a Normal distribution has a Kurtosis Excess of 0. The Mathcad Kurtosis function is really a Kurtosis Excess function such that a normal distribution has a kurtosis of 0.

2.) The second difference is that the Mathcad algorithm accounts for sample size whereas the Matlab/SMath algorithm does not. I found a website here that explains the difference.

Lastly, I performed a small experiment by creating a Matlab based skewness and kurtosis function as well as a mathcad based skewness and kurtosis function. I then created random vectors with increasing sample sizes (from 10 to 1000) and compared the % error from the built in Smath Skewness and Kurtosis functions. As you can see the as the sample size increases the difference between the Matlab and Mathcad algorithms decreases (at least for Skewness). It may take a minute or two to run.

Untitled.png

Stat Skewness(Y)_Lyles.sm (31 КиБ) скачан 38 раз(а).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#11 Опубликовано: 30.05.2018 18:18:16
CBG

CBG

77 сообщений из 312 понравились пользователям.

Группа: User

Skewness.png

Skewnesss_and_Kurtosis_Jean_CBG.sm (11 КиБ) скачан 39 раз(а).


Best Regards

Carlos
#12 Опубликовано: 30.05.2018 22:44:21
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Thank you both: Alyles, Carlos.

I reconciliated myself with these two descriptive statistic parameters.
In short: as useful as knowing the night of next blue moon, as they refer
strictly to Normal Distribution ... Oh ! there are surely very many in fact.
In real data collection, you are just interested to fit an histogram to some
kind of PDF from known or less common.
Like Mathcad says: value of kurtosis is immaterial, only ±

Stat Skewness_Kurtosis(Y).sm (43 КиБ) скачан 37 раз(а).
#13 Опубликовано: 31.05.2018 00:38:51
CBG

CBG

77 сообщений из 312 понравились пользователям.

Группа: User

Skewnesss_and_Kurtosis_Jean_CBG_R1.sm (46 КиБ) скачан 36 раз(а).

Skewness_R1.png

Best Regards

Carlos
#14 Опубликовано: 31.05.2018 11:05:56
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Thanks Carlos for your reconciliation ... no more bug !

Stat Skewness_Kurtosis(Y).sm (60 КиБ) скачан 44 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений