Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Microsoft Power BI Community
- Galleries
- Quick Measures Gallery
- Jarque-Bera Test

Greg_Deckler

Super User

Jarque-Bera Test

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-17-2019
09:39 AM

OK, I know what everyone's been saying behind my back since I introduced my Kurtosis Quick Measure. *"Gee Greg, if you are going to introduce Kurtosis, why wouldn't you take the extra step and build a Jarque-Bera Test Quick Measure? That's just sheer laziness."* I get it, you guys are a tough crowd. I've heard you, so here is the Jarque-Bera Test Quick Measure. As explained here: https://www.statisticshowto.datasciencecentral.com/jarque-bera-test/, The Jarque-Bera Test,a type of Lagrange multiplier test, is a test for normality. Normality is one of the assumptions for many statistical tests, like the t test or F test; the Jarque-Bera test is usually run before one of these tests to confirm normality. It is usually used for large data sets, because other normality tests are not reliable when n is large (for example, Shapiro-Wilk isn’t reliable with n more than 2,000).

Specifically, the test matches the skewness and kurtosis of data to see if it matches a normal distribution. The data could take many forms, including:

- Time Series Data.
- Errors in a regression model.
- Data in a Vector.

A normal distribution has a skew of zero (i.e. it’s perfectly symmetrical around the mean) and a kurtosis of three; kurtosis tells you how much data is in the tails and gives you an idea about how “peaked” the distribution is. It’s not necessary to know the mean or the standard deviation for the data in order to run the test.

So here is the Jarque-Bera Test for DAX in all its glory:

Jarque-Bera = VAR __k = 1 VAR __mean = AVERAGEX(ALL('Data'),[Values]) VAR __stddev = STDEVX.P(ALL('Data'),[Values]) VAR __n = COUNTROWS(ALL('Data')) VAR __tableSkew = ADDCOLUMNS('Data',"__skew",POWER(([Values]-__mean),3)) VAR __sumSkew = SUMX(__tableSkew,[__skew]) VAR __skewness = DIVIDE(__sumSkew,POWER(__stddev,3),0) * DIVIDE(1,__n,0) VAR __tableKurtosis = ADDCOLUMNS('Data',"__skew",POWER(([Values]-__mean),4)) VAR __sumKurtosis = SUMX(__tableKurtosis,[__skew]) VAR __sampleKurtosis = DIVIDE(__sumKurtosis,POWER(__stddev,4),0) * DIVIDE(1,__n,0) VAR __firstPart = DIVIDE(__n - __k + 1,6,0) VAR __secondPart = POWER(__skewness,2) + 1/4*(POWER(__sampleKurtosis - 3,2)) RETURN __firstPart * __secondPart

JB Type = SWITCH(TRUE(), [Jarque-Bera]>0,"Not Normally Distributed", "Normally Distributed" )

eyJrIjoiMDdjMGU0OTQtODQwNy00YTM1LWJhMTEtNmZhZjMyNzBkNjQxIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9

Proud to be a Datanaut!