Rank: 669 based on 187 downloads (last 30 days) and 2 files submitted
photo

Ahmed Ben Saïda

E-mail
Company/University
Faculté des Sciences Economiques et de Gestion

Personal Profile:

 

Watch this Author's files

 

Files Posted by Ahmed Ben Saïda View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
24 Sep 2014 Chaos test A test for chaotic dynamics of a noisy time series based on the Lyapunov exponent. Author: Ahmed Ben Saïda chaos, lyapunov exponent, bifurcation, time series, noisy time series 50 0
18 Jun 2014 Shapiro-Wilk and Shapiro-Francia normality tests. Shapiro-Wilk & Shapiro-Francia parametric hypothesis test of composite normality. Author: Ahmed Ben Saïda statistics, probability, normality test, hypothesis test, composite, algorithm 137 13
  • 4.88889
4.9 | 10 ratings
Comments and Ratings by Ahmed Ben Saïda
Updated File Comments Rating
23 Mar 2013 Shapiro-Wilk and Shapiro-Francia normality tests. Shapiro-Wilk & Shapiro-Francia parametric hypothesis test of composite normality. Author: Ahmed Ben Saïda

To answer all questions:
- the kurtosis (line 119) does not modify the power of the test, it's barely used to help choosing between Shapiro-Wilk and Shapiro-Francia method. Moreover, it's better to use the sample kurtosis 'kurtosis(x)'.
- When posing x=norminv((1:9)/10)), x here is not normally distributed, it represents the inverse of the CDF which is not normal by definition. So if you want to test its power you can compute x=normrnd(mu, sigma, n, 1), where you can choose the size of your sample (n) and perform the test.

Comments and Ratings on Ahmed Ben Saïda's Files View all
Updated File Comment by Comments Rating
15 Dec 2014 Shapiro-Wilk and Shapiro-Francia normality tests. Shapiro-Wilk & Shapiro-Francia parametric hypothesis test of composite normality. Author: Ahmed Ben Saïda Johannes

Thanks for this implementation. I use it a lot in my current project.
I found a problem for samples which are uniform distributed, e.g.:

swtest(ones(1,6))

fails with:
Error using erfc
Input must be real and full.

I traced this back to line 211

W = (weights' * x) ^2 / ((x - mean(x))' * (x - mean(x)));

W can become NaN of Inf if the sample is uniform. I'm not sure how to treat this correctly. Just check if W is NaN/Inf and if so reject the null hypothesis?

20 Sep 2013 Shapiro-Wilk and Shapiro-Francia normality tests. Shapiro-Wilk & Shapiro-Francia parametric hypothesis test of composite normality. Author: Ahmed Ben Saïda Hassan Naseri

23 Mar 2013 Shapiro-Wilk and Shapiro-Francia normality tests. Shapiro-Wilk & Shapiro-Francia parametric hypothesis test of composite normality. Author: Ahmed Ben Saïda Ahmed Ben Saïda

To answer all questions:
- the kurtosis (line 119) does not modify the power of the test, it's barely used to help choosing between Shapiro-Wilk and Shapiro-Francia method. Moreover, it's better to use the sample kurtosis 'kurtosis(x)'.
- When posing x=norminv((1:9)/10)), x here is not normally distributed, it represents the inverse of the CDF which is not normal by definition. So if you want to test its power you can compute x=normrnd(mu, sigma, n, 1), where you can choose the size of your sample (n) and perform the test.

22 Oct 2012 Shapiro-Wilk and Shapiro-Francia normality tests. Shapiro-Wilk & Shapiro-Francia parametric hypothesis test of composite normality. Author: Ahmed Ben Saïda Willem-Jan de Goeij

Can you explain the following?
x is normally distributed.
If I perform a 2 tailed test, your function rejects the null hypothesis.

x = norminv((1:9)/10);
[h,p,w]=swtest(x,0.05,0)
h =
1
p =
0.0028
w =
0.9925

19 Oct 2012 Shapiro-Wilk and Shapiro-Francia normality tests. Shapiro-Wilk & Shapiro-Francia parametric hypothesis test of composite normality. Author: Ahmed Ben Saïda Sav Deb

Sorry, what is the usefulness of tail option? When to use 1,0 or -1 value?
Thank you for help

Contact us