D’Agostino-Pearson Test
The D’Agostino-Pearson Test (D’Agostino and Pearson, 1973) combines the skewness and the kurtosis of the returns into one omnibus statistic. Like the Jarque-Bera test it asks whether the returns are as symmetric and as thin-tailed as a normal sample, but it first transforms each moment into a standard normal variable, so it stays valid in small samples where the chi-squared approximation of the Jarque-Bera test does not.
The formula for the D’Agostino-Pearson Test starts from the sample skewness \(\sqrt{b_{1}}\) and the sample kurtosis \(b_{2}\), with \(m_{k}\) the k-th central moment of the returns (with n in the denominator):
\[\sqrt{b_{1}} = \frac{m_{3}}{m_{2}^{3/2}}\] \[b_{2} = \frac{m_{4}}{m_{2}^{2}}\]Each moment is then turned into a standard normal variable under normality: the skewness into \(Z_{1}\) by the transformation of D’Agostino (1970) and the kurtosis into \(Z_{2}\) by that of Anscombe and Glynn (1983). The statistic \(K^{2}\) sums their squares:
\[K^{2} = Z_{1}^{2} + Z_{2}^{2}\]Under normality \(K^{2}\) is chi-squared with 2 degrees of freedom. A large \(K^{2}\), with a p-value below the significance level, rejects normality, and \(Z_{1}\) and \(Z_{2}\) show whether the skewness or the tails cause it. A distribution with the skewness and kurtosis of the normal but another shape passes the test.
A normality test asks whether a sample could come from a normal distribution: the null hypothesis is that it does, the alternative that it comes from any other distribution. The question matters because the Gaussian Value at Risk, the Black-Scholes model and many statistical tests assume normally distributed returns, while returns tend to be skewed and fat-tailed. The tests differ in the departure from normality they are most sensitive to. Every one of them reads the same way: a p-value below the chosen significance level (such as 0.05) rejects normality, while a higher p-value only means the sample gives no evidence against it, not that the returns are normal. In a long sample a test rejects even a departure too small to matter, and in a short one it misses a large one.
Also known as: D’Agostino K-squared test, omnibus normality test, normaltest.
In the Finance Toolkit this is get_normality_test with method="dagostino_pearson", the same function as Normality Test.
Example · ^GSPC, BTCUSD, TLT · 2021 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_normality_test:
from financetoolkit import Toolkit
toolkit = Toolkit(
["^GSPC", "BTCUSD", "TLT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.econometrics.get_normality_test(method="dagostino_pearson", period="monthly")
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”. | "weekly" |
within_period | bool | Whether to calculate the test within the specified period or for the entire period. Thus whether to look at the test within a specific year (if period = ‘yearly’) or look at the entirety of all years. Defaults to False. Note that this requires intraday data when period = ‘daily’, since a single day only nests observations when intraday data was fetched. | True |
method | str | The test. Options are: “shapiro_wilk” (Shapiro-Wilk Test), “anderson_darling” (Anderson-Darling Test), “lilliefors” (Lilliefors Test), “dagostino_pearson” (D’Agostino-Pearson Test). Defaults to “shapiro_wilk”. | "shapiro_wilk" |
include_benchmark | bool | Whether to include “Benchmark” among the assets tested. Defaults to False. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
Which returns:
| Item | ^GSPC | BTCUSD | TLT |
|---|---|---|---|
| D'Agostino-Pearson Statistic | 2.8308 | 1.6143 | 0.6994 |
| Skewness Z-Score | -1.6711 | 1.0969 | 0.7914 |
| Kurtosis Z-Score | -0.1955 | 0.6412 | -0.2703 |
| P-Value | 0.2428 | 0.4461 | 0.7049 |
4 rows
Using Your Own Data
get_normality_test runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:
from financetoolkit import Economics, Econometrics
economics = Economics(start_date="2000-01-01")
unemployment = economics.get_unemployment_rate(
countries=["United States", "Germany"], period="monthly"
)
econometrics = Econometrics(data=unemployment, changes="difference")
econometrics.get_normality_test()
References
- Paper D’Agostino, R.B. and Pearson, E.S. (1973). “Tests for Departure from Normality. Empirical Results for the Distributions of b₂ and √b₁.” Biometrika, 60(3), 613-622.
- Paper Anscombe, F.J. and Glynn, W.J. (1983). “Distribution of the Kurtosis Statistic b₂ for Normal Samples.” Biometrika, 70(1), 227-234.
- Library Referenced against scipy’s normaltest (D’Agostino-Pearson Test)