Skip to main content
Log in

On automatic kernel density estimate-based tests for goodness-of-fit

  • Original Paper
  • Published:
TEST Aims and scope Submit manuscript

Abstract

Although estimation and testing are different statistical problems, if we want to use a test statistic based on the Parzen–Rosenblatt estimator to test the hypothesis that the underlying density function f is a member of a location-scale family of probability density functions, it may be found reasonable to choose the smoothing parameter in such a way that the kernel density estimator is an effective estimator of f irrespective of which of the null or the alternative hypothesis is true. In this paper we address this question by considering the well-known Bickel–Rosenblatt test statistics which are based on the quadratic distance between the nonparametric kernel estimator and two parametric estimators of f under the null hypothesis. For each one of these test statistics we describe their asymptotic behaviours for a general data-dependent smoothing parameter, and we state their limiting Gaussian null distribution and the consistency of the associated goodness-of-fit test procedures for location-scale families. In order to compare the finite sample power performance of the Bickel–Rosenblatt tests based on a null hypothesis-based bandwidth selector with other bandwidth selector methods existing in the literature, a simulation study for the normal, logistic and Gumbel null location-scale models is included in this work.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1

Similar content being viewed by others

References

  • Anderson TW, Darling DA (1954) A test of goodness of fit. J Am Stat Assoc 49:765–769

    Article  MATH  Google Scholar 

  • Bickel PJ, Rosenblatt M (1973) On some global measures of the deviations of density function estimates. Ann Stat 1:1071–1095

    Article  MathSciNet  MATH  Google Scholar 

  • Bosq D, Lecoutre J-P (1987) Théorie de l’estimation fonctionnelle. Economica, Paris

    Google Scholar 

  • Bowman AW (1992) Density based tests for goodness-of-fit normality. J Stat Comput Simul 40:1–13

    Article  MATH  Google Scholar 

  • Bowman AW, Foster PJ (1993) Adaptive smoothing and density-based tests of multivariate normality. J Am Stat Assoc 88:529–537

    Article  MathSciNet  MATH  Google Scholar 

  • Cao R, Lugosi G (2005) Goodness-of-fit tests based on the kernel density estimator. Scand J Stat 32:599–616

    Article  MathSciNet  MATH  Google Scholar 

  • Cao R, Van Keilegom I (2006) Empirical likelihood tests for two-sample problems via nonparametric density estimation. Can J Stat 34:61–77

    Article  MathSciNet  MATH  Google Scholar 

  • Chacón JE, Tenreiro C (2013) Data-based choice of the number of pilot stages for plug-in bandwidth selection. Commun Stat Theory Methods 42:2200–2214

    Article  MathSciNet  MATH  Google Scholar 

  • Chacón JE, Montanero J, Nogales AG, Pérez P (2007) On the existence and limit behavior of the optimal bandwidth in kernel density estimation. Stat Sin 17:289–300

    MATH  Google Scholar 

  • Devroye L, Györfi L (1985) Nonparametric density estimation: the L\(_1\) view. Wiley, New York

    MATH  Google Scholar 

  • Ebner B, Henze N (2020) Tests for multivariate normality—a critical review with emphasis on weighted \(L^2\)-statistics. TEST 29:845–892

    Article  MathSciNet  MATH  Google Scholar 

  • Epps TW (2005) Tests for location-scale families based on the empirical characteristic function. Metrika 62:99–114

    Article  MathSciNet  MATH  Google Scholar 

  • Epps TW, Pulley LB (1983) A test for normality based on the empirical characteristic function. Biometrika 70:723–726

    Article  MathSciNet  MATH  Google Scholar 

  • Fan Y (1994) Testing the goodness of fit of a parametric density function by kernel method. Econom Theory 10:316–356

    Article  MathSciNet  Google Scholar 

  • Fan Y (1995) Bootstrapping a consistent nonparametric goodness-of-fit test. Econom Rev 14:367–382

    Article  MathSciNet  MATH  Google Scholar 

  • Fan Y (1998) Goodness-of-fit tests based on kernel density estimators with fixed smoothing parameters. Econom Theory 14:604–621

    Article  MathSciNet  Google Scholar 

  • Ghosh BK, Huang W-M (1991) The power and optimal kernel of the Bickel–Rosenblatt test for goodness of fit. Ann Stat 19:999–1009

    Article  MathSciNet  MATH  Google Scholar 

  • Gouriéroux C, Tenreiro C (2001) Local power properties of kernel based goodness of fit tests. J Multivar Anal 78:161–190

    Article  MathSciNet  MATH  Google Scholar 

  • Gürtler N (2000) Asymptotic theorems for the class of BHEP-tests for multivariate normality with fixed and variable smoothing parameter (in German). Doctoral dissertation, University of Karlsruhe, Germany

  • Hall P (1984) Central limit theorem for integrated square error of multivariate nonparametric density estimators. J Multivar Anal 14:1–16

    Article  MathSciNet  MATH  Google Scholar 

  • Hall P, Marron JS (1987) Extent to which least-squares cross-validation minimizes integrated square error in nonparametric density estimation. Probab Theory Rel Fields 74:567–581

    Article  MATH  Google Scholar 

  • Hall P, Marron JS (1991) Lower bounds for bandwidth selection in density estimation. Probab Theory Rel Fields 90:149–173

    Article  MathSciNet  MATH  Google Scholar 

  • Hall P, Sheather SJ, Jones MC, Marron JS (1991) On optimal data-based bandwidth selection in kernel density estimation. Biometrika 78:263–269

    Article  MathSciNet  MATH  Google Scholar 

  • Hall P, Marron JS, Park BU (1992) Smoothed cross-validation. Probab Theory Rel Fields 92:1–20

    Article  MathSciNet  MATH  Google Scholar 

  • Henze N (2002) Invariant tests for multivariate normality: a critical review. Stat Pap 43:467–506

    Article  MathSciNet  MATH  Google Scholar 

  • Henze N, Zirkler B (1990) A class of invariant consistent tests for multivariate normality. Commun Stat Theory Methods 19:3595–3617

    Article  MathSciNet  MATH  Google Scholar 

  • Johnson NL, Kotz S, Balakrishnan N (1995) Continuous univariate distributions 2. Wiley, New York

    MATH  Google Scholar 

  • Krzanowski WJ, Hand DJ (2009) ROC curves for continuous data. CRC Press, Boca Raton

    Book  MATH  Google Scholar 

  • Marron JS, Wand MP (1992) Exact mean integrated squared error. Ann Stat 20:712–736

    Article  MathSciNet  MATH  Google Scholar 

  • Martínez-Camblor P, Uña-Álvarez J (2009) Nonparametric k-sample tests: density function vs. distribution function. Comput Stat Data Anal 53:3344–3357

    Article  MATH  Google Scholar 

  • Martínez-Camblor P, Uña-Álvarez J (2013) Density comparison for independent and right censored samples via kernel smoothing. Comput Stat 28:269–288

    Article  MathSciNet  MATH  Google Scholar 

  • Martínez-Camblor P, Uña-Álvarez J, Corral N (2008) \(k\)-Sample test based on the common area of kernel density estimator. J Stat Plan Inference 138:4006–4020

    Article  MathSciNet  MATH  Google Scholar 

  • Meintanis SG (2004) Goodness-of-fit tests for the logistic distribution based on empirical transforms. Sankhya Ser A 66:306–326

    MathSciNet  MATH  Google Scholar 

  • Parzen E (1962) On estimation of a probability density function and mode. Ann Math Stat 33:1065–1076

    Article  MathSciNet  MATH  Google Scholar 

  • R Development Core Team (2019) R: a language and environment for statistical computing. R Foundation for Statistical Computing, Vienna. http://www.R-project.org

  • Romão X, Delgado R, Costa A (2010) An empirical power comparison of univariate goodness-of-fit tests for normality. J Stat Comput Simul 80:545–591

    Article  MathSciNet  MATH  Google Scholar 

  • Rosenblatt M (1956) Remarks on some non-parametric estimates of a density function. Ann Math Stat 27:832–837

    Article  MATH  Google Scholar 

  • Rosenblatt M (1975) A quadratic measure of deviation of two-dimensional density estimates and a test of independence. Ann Stat 3:1–14

    Article  MathSciNet  MATH  Google Scholar 

  • Scott DW, Terrel GR (1987) Biased and unbiased cross-validation in density estimation. J Am Stat Assoc 82:1131–1146

    Article  MathSciNet  MATH  Google Scholar 

  • Shapiro SS, Wilk MB (1965) An analysis of variance test for normality (complete samples). Biometrika 52:591–611

    Article  MathSciNet  MATH  Google Scholar 

  • Silverman BW (1986) Density estimation for statistics and data analysis. Chapman and Hall, London

    MATH  Google Scholar 

  • Simonoff JS (1996) Smoothing methods in statistics. Springer, New York

    Book  MATH  Google Scholar 

  • Stephens MA (1986) Tests based on EDF statistics. In: D’Agostino RB, Stephens MA (eds) Goodness-of-fit techniques. Marcel Dekker, New York, pp 97–193

  • Tenreiro C (1997) Loi asymptotique des erreurs quadratiques intégrées des estimateurs à noyau de la densité et de la régression sous des conditions de dépendance. Port Math 54:187–213

    MathSciNet  MATH  Google Scholar 

  • Tenreiro C (2001) On the asymptotic behaviour of the integrated square error of kernel density estimators with data-dependent bandwidth. Stat Probab Lett 53:283–292

    Article  MathSciNet  MATH  Google Scholar 

  • Tenreiro C (2003) On the asymptotic normality of multistage integrated density derivatives kernel estimators. Stat Probab Lett 64:311–322

    Article  MathSciNet  MATH  Google Scholar 

  • Tenreiro C (2007) On the asymptotic behaviour of location-scale invariant Bickel–Rosenblatt tests. J Stat Plan Inference 137:103–116 (Erratum: 139, 2115, 2009)

    Article  MathSciNet  MATH  Google Scholar 

  • Tenreiro C (2017) A weighted least-squares cross-validation bandwidth selector for kernel density estimation. Commun Stat Theory Methods 46:3438–3458

    Article  MathSciNet  MATH  Google Scholar 

  • Tsybakov AB (2009) Introduction to nonparametric estimation. Springer, London

    Book  MATH  Google Scholar 

  • Wand MP, Jones MC (1995) Kernel smoothing. Chapman & Hall, New York

    Book  MATH  Google Scholar 

Download references

Acknowledgements

The author would like to thank the anonymous reviewers and associate editor for their constructive comments and suggestions that greatly helped to improve this work.

Funding

Research partially supported by the Centre for Mathematics of the University of Coimbra—UID/MAT/00324/2019, funded by the Portuguese Government through FCT/MEC and co-funded by the European Regional Development Fund through the Partnership Agreement PT2020.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Carlos Tenreiro.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary file 1 (pdf 81 KB)

Proofs

Proofs

1.1 Proof of Theorem 1

Consider the expansion

$$\begin{aligned} (n\hat{h})^{-1} I_n(\hat{h})&= \int \{ f_{\hat{h}}(x) - K_{\hat{h}}*f(x) \}^2 \mathrm{d}x \nonumber \\&\quad + \int \{ K_{\hat{h}}*f(x) - K_{\hat{h}}*g(x; \hat{\theta }_1, \hat{\theta }_2 ) \}^2 \mathrm{d}x \nonumber \\&\quad + 2 \int \{ f_{\hat{h}}(x) - K_{\hat{h}}*f(x) \} \{ K_{\hat{h}}*f(x) - K_{\hat{h}}*g(x; \hat{\theta }_1, \hat{\theta }_2 ) \} \mathrm{d}x \nonumber \\&=: I_{n,1} + I_{n,2} + 2 I_{n,3}. \end{aligned}$$
(21)

In order to establish the asymptotic behaviour of each one of the previous terms, we use the approach of Tenreiro (2001), which is based on the Taylor expansion

$$\begin{aligned} K_h(u) := W(u,h) = \sum _{\ell =0}^{\omega -1} (h-1)^\ell K^{\partial (\ell )}(u) + (h-1)^\omega K^{\partial (\omega )}(u,h), \end{aligned}$$

where \(u\in \mathbb {R}\), \(h>0\),

$$\begin{aligned} K^{\partial (\ell )}(u) := \frac{1}{\ell !}\frac{\partial ^\ell W}{\partial h^\ell }(u,1), \; \ell =0,\ldots ,\omega -1, \end{aligned}$$

and

$$\begin{aligned} K^{\partial (\omega )}(u,h) := \frac{1}{(\omega -1)!} \int _0^1 (1-t)^{\omega -1} \frac{\partial ^\omega W}{\partial h^\omega }(u,1+t(h-1)) \mathrm{d}t. \end{aligned}$$

Note that, from assumption (K) the functions \(K^{\partial (\ell )}\) are bounded and integrable on \(\mathbb {R}\), for \(\ell =1,\ldots ,\omega -1\), and there exists \(\eta \in \,]0,1[\) such that the function \(K^{\partial (\omega ),\eta }(u) := \sup _{|h-1|\le \eta } |K^{\partial (\omega )}(u,h)|,\) is bounded and integrable on \(\mathbb {R}\). From the previous Taylor expansion we deduce the following expansions for \(f_{\hat{h}}\), \(K_{\hat{h}}*f\) and \(K_{\hat{h}}*g(\cdot ; \hat{\theta }_1, \hat{\theta }_2 )\), that play a crucial role in what follows. For \(x\in \mathbb {R}\) and denoting by h the deterministic bandwidth h(f) given in assumption (B), we have

$$\begin{aligned} f_{\hat{h}}(x)= & {} \sum _{\ell =0}^{\omega -1} \xi _n^\ell \frac{1}{n} \sum _{i=1}^n K^{\partial (\ell )}_h(x-X_i) + \xi _n^\omega \frac{1}{n} \sum _{i=1}^n K^{\partial (\omega )}_h(x-X_i,\hat{h}), \end{aligned}$$
(22)
$$\begin{aligned} K_{\hat{h}}*f(x)= & {} \sum _{\ell =0}^{\omega -1} \xi _n^\ell K^{\partial (\ell )}_h\!*\!f(x) + \xi _n^\omega K^{\partial (\omega )}_h(\cdot ,\hat{h})\!*\!f(x), \end{aligned}$$
(23)

and

$$\begin{aligned} K_{\hat{h}}*g(x; \hat{\theta }_1, \hat{\theta }_2 ) = \sum _{\ell =0}^{\omega -1} \xi _n^\ell K^{\partial (\ell )}_h\!*\!g(x; \hat{\theta }_1, \hat{\theta }_2 ) + \xi _n^\omega K^{\partial (\omega )}_h(\cdot ,\hat{h})\!*\!g(x; \hat{\theta }_1, \hat{\theta }_2 ), \end{aligned}$$
(24)

where \(K^{\partial (\ell )}_h(u)=K^{\partial (\ell )}_h(u/h)/h\) and \(K^{\partial (\omega )}_h(u,\hat{h})=K^{\partial (\omega )}_h(u/h,\hat{h}/h)/h\). Moreover, for \(|\hat{h}/h-1| \le \eta \) we have \(| K^{\partial (\omega )}_h(u,\hat{h})| \le K^{\partial (\omega ),\eta }_h(u)\), for \(u\in \mathbb {R}\).

Each one of the terms in (21) is studied in the following propositions. We denote by h the deterministic sequence h(f) given in assumption (B).

Proposition 1

We have

$$\begin{aligned} \begin{aligned} I_{n,1}&= (1-\xi _n) \frac{1}{nh} R(K) + \frac{1}{nh^{1/2}} U_n (1+ o_p(1)) \\&\quad + O_p\Big ( n^{-1} h^{-1/2} \xi _n + (nh)^{-1} \xi _n^2 + \xi _n^\omega \Big ), \end{aligned} \end{aligned}$$

where \(U_n\) given by (25) is asymptotically normal with zero mean and variance \(2R(K\!*\!K)R(f)\).

Proof

Using equalities (22) and (23), and assumptions (D), (K) and (B), from Proposition 2 of Tenreiro (2001, p. 290) we have

$$\begin{aligned} \begin{aligned}I_{n,1}&= \int \{ f_h(x)-K_h*f(x) \}^2 dx \mathrm {d}x - \xi _n \frac{1}{nh} R(K)\\&\quad + O_p\Big ( n^{-1} h^{-1/2} \xi _n + (nh)^{-1} \xi _n^2 + \xi _n^\omega \Big ). \end{aligned} \end{aligned}$$

Moreover, using degenerated U-statistics techniques (see Hall 1984; Tenreiro 1997) we have

$$\begin{aligned} \int \{ f_h(x)-K_h*f(x) \}^2 \mathrm{d}x = \frac{1}{nh} R(K) + \frac{1}{nh^{1/2}} U_n (1+ o_p(1)), \end{aligned}$$

with

$$\begin{aligned} U_n= & {} \frac{2}{n} \sum _{1\le i < j \le n} q_n(X_i,X_j),\\ q_n(u,v)= & {} h^{1/2} \int \big \{ K_h(x-u) - K_h\!*\!f(x) \big \} \big \{ K_h(x-v) - K_h\!*\!f(x) \big \} \mathrm{d}x,\nonumber \end{aligned}$$
(25)

and \(U_{n}\) is asymptotically normal with zero mean and variance equal to \(2R(K*K) R(f)\).

\(\square \)

Proposition 2

We have

$$\begin{aligned} I_{n,2} = R\big ( f - g(\cdot ; \theta _1(f),\theta _2(f) ) \big ) + o_p(1). \end{aligned}$$

Moreover, under the null hypothesis we have

$$\begin{aligned} I_{n,2} = O_p\big ( n^{-1} \big ). \end{aligned}$$

Proof

From (23) and (24) we have

$$\begin{aligned} I_{n,2}&= \sum _{\ell ,\ell '=0}^{\omega -1} \xi _n^{\ell +\ell '} \int K^{\partial (\ell )}_h \!* \hat{\delta }_n(x) K^{\partial (\ell ')}_h \!* \hat{\delta }_n(x) \mathrm{d}x \\&\quad + 2 \sum _{\ell =0}^{\omega -1} \xi _n^{\omega +\ell } \int K^{\partial (\ell )}_h \!* \hat{\delta }_n(x) K^{\partial (\omega )}_h (\cdot ,\hat{h}) \!* \hat{\delta }_n(x) \mathrm{d}x \\&\quad + \xi _n^{2\omega } \int \big ( K^{\partial (\omega )}_h (\cdot ,\hat{h}) \!* \hat{\delta }_n(x) \big )^2 \mathrm{d}x, \end{aligned}$$

where \(\hat{\delta }_n(x)=f(x) - g(x; \hat{\theta }_1, \hat{\theta }_2 )\). Moreover,

$$\begin{aligned} \bigg | \int K^{\partial (\ell )}_h \!* \hat{\delta }_n(x) K^{\partial (\ell ')}_h \!* \hat{\delta }_n(x) \mathrm{d}x \bigg | \le ||K^{\partial (\ell )}||_1 ||K^{\partial (\ell ')}||_1 || \hat{\delta }_n ||_2^2, \end{aligned}$$

and for all \(\epsilon \in \,]0,\eta [\) and for \(|\hat{h}/h-1| \le \epsilon \) we have

$$\begin{aligned} \bigg | \int K^{\partial (\ell )}_h \!* \hat{\delta }_n(x) K^{\partial (\omega )}_h (\cdot ,\hat{h}) \!* \hat{\delta }_n(x) \mathrm{d}x \bigg | \le ||K^{\partial (\ell )}||_1 ||K^{\partial (\omega ),\eta }||_1 || \hat{\delta }_n ||_2^2 \end{aligned}$$

and

$$\begin{aligned} \bigg | \int \big ( K^{\partial (\omega )}_h (\cdot ,\hat{h}) \!* \hat{\delta }_n(x) \big )^2 \mathrm{d}x \bigg | \le ||K^{\partial (\omega ),\eta }||_1^2 || \hat{\delta }_n ||_2^2. \end{aligned}$$

Therefore, from assumption (B) we can write

$$\begin{aligned} I_{n,2} = R\big ( K_h*\hat{\delta }_n \big ) + O_p\big ( || \hat{\delta }_n ||_2^2 \xi _n \big ). \end{aligned}$$
(26)

On the other hand, from assumption (F) the function \((\theta _1,\theta _2) \mapsto g(x; \theta _1,\theta _2)\) has continuous first-order partial derivatives, and the functions \((\theta _1,\theta _2) \mapsto \big |\big | \frac{\partial g}{\partial \theta _k} (\cdot ; \theta _1,\theta _2)\big |\big |_2\) are locally bounded on \(\mathbb {R} \times ]0,+\infty [\) for \(k=1,2\). Therefore, for each \(x\in \mathbb {R}\), a Taylor expansion of \(g(x; \hat{\theta }_1, \hat{\theta }_2 )\) at the point \((\theta _1(f), \theta _2(f))\) leads to

$$\begin{aligned} \hat{\delta }_n(x) = f(x) - g(x; \hat{\theta }_1, \hat{\theta }_2 ) = f(x) - g(x; \theta _1(f), \theta _2(f) ) + u_n(x), \end{aligned}$$
(27)

where

$$\begin{aligned} || u_n ||_2 = O_p\big ( |\hat{\theta }_1-\theta _1(f) | + |\hat{\theta }_2-\theta _2(f) | \big ). \end{aligned}$$
(28)

The first part of the stated result follows now from (26) and the following convergence that can be established from standard arguments as h tends to zero, when n tends to infinity:

$$\begin{aligned} R\big ( K_h \!*\! (f - g(\cdot ; \theta _1(f),\theta _2(f) )) \big ) = R\big ( f - g(\cdot ; \theta _1(f),\theta _2(f)) \big ) + o(1). \end{aligned}$$

Finally, taking into account that \(\hat{\delta }_n = u_n\) under the null hypothesis, where \(|| u_n ||_2 = O_p(n^{-1/2})\) from assumption (P), we deduce that \(I_{n,2} = O_p(n^{-1})\) under the null hypothesis. \(\square \)

To establish the order of convergence of \(I_{n,3}\) we need the following lemma. Note that we are always assuming that \(\hat{h}\) satisfies assumption (B).

Lemma 1

Let \(\varphi \) be a real-valued function defined on \(\mathbb {R} \times ]0,+\infty [\), and assume that there exists \(\eta \in \,]0,1[\) such that the function \(\varphi ^\eta (u)= \sup _{|h-1|\le \eta } |\varphi (u,h)|\) is bounded and integrable.

  1. (a)

    If \(\gamma _n : \mathbb {R} \mapsto \mathbb {R}\) is such \(||\gamma _n||_2 = O(1)\) then

    $$\begin{aligned} \frac{1}{n} \sum _{i=1}^n \int \big \{ \varphi _h(x-X_i) - \varphi _h*f(x) \big \} \gamma _n(x) \mathrm{d}x = O_p\big ( n^{-1/2} \big ). \end{aligned}$$
  2. (b)

    If \(\gamma _n : \mathbb {R} \mapsto \mathbb {R}\) is such \(||\gamma _n||_r = O(1)\), for some \(r\in [1,\infty ]\), then

    $$\begin{aligned} \frac{1}{n} \sum _{i=1}^n \int | \varphi _h(x-X_i,\hat{h}) - \varphi _h(\cdot ,\hat{h})*f(x) | \gamma _n(x) \mathrm{d}x = O_p( 1 ). \end{aligned}$$
  3. (c)

    If \(\tilde{\gamma }_n = \tilde{\gamma }_n(\cdot ;X_1,\ldots ,X_n): \mathbb {R} \mapsto \mathbb {R}\) is such that \(||\tilde{\gamma }_n||_r = O_p(1)\), for some \(r\in [1,\infty ]\), then

    $$\begin{aligned} \frac{1}{n} \sum _{i=1}^n \int | \varphi _h(x-X_i,\hat{h}) - \varphi _h(\cdot ,\hat{h})*f(x) | \tilde{\gamma }_n(x) \mathrm{d}x = O_p\big ( h^{-1/r} \big ). \end{aligned}$$

Proof

Write \(S_{n,a}\), \(S_{n,b}\) and \(S_{n,c}\) for the sums considered in each one of the parts a), b) and c). The order of convergence stated in part a) follows from the inequalities

$$\begin{aligned} {E}(S_{n,a}^2)&\le \frac{1}{n} {E}\bigg ( \int \varphi _h(x-X_i) \gamma _n(x) \mathrm{d}x \bigg )^2 \\&\le \frac{1}{n} \iint \varphi (u)^2 \gamma _n(z+uh)^2 f(z) \mathrm{d}u \mathrm{d}z \\&\le \frac{1}{n} ||f||_\infty ||\varphi ||_2^2 ||\gamma _n||_2^2. \end{aligned}$$

In order to establish parts b) and c), it is enough to note that for all \(\epsilon \in \,]0,\eta [\) and for \(|\hat{h}/h-1| \le \epsilon \) we have

$$\begin{aligned} |S_{n,b}| \le \frac{1}{n} \sum _{i=1}^n \bigg \{ \int \varphi _h^\epsilon (x-X_i) |\gamma _n|(x) \mathrm{d}x + \int \varphi _h^\epsilon *f(x) |\gamma _n|(x) \mathrm{d}x \bigg \}=:S_{n,b}^\epsilon , \end{aligned}$$

and

$$\begin{aligned} |S_{n,c}| \le \frac{1}{n} \sum _{i=1}^n \bigg \{ \int \varphi _h^\epsilon (x-X_i) |\tilde{\gamma }_n|(x) \mathrm{d}x + \int \varphi _h^\epsilon *f(x) |\tilde{\gamma }_n|(x) \mathrm{d}x \bigg \}=:S_{n,c}^\epsilon , \end{aligned}$$

where

$$\begin{aligned} {E}(S_{n,b}^\epsilon ) \le 2 \int \varphi _h^\epsilon *f(x) |\gamma _n|(x) \mathrm{d}x \le 2 ||f||_\infty ||\varphi ^\epsilon ||_s ||\gamma _n||_r, \end{aligned}$$

and

$$\begin{aligned} S_{n,c}^\epsilon \le 2 h^{-1/r} ||\tilde{\gamma }_n||_r ||\varphi ^\epsilon ||_s, \end{aligned}$$

with \(1/r+1/s=1\). Therefore, \(S_{n,b}^\epsilon = O_p(1)\) and \(S_{n,c}^\epsilon = O_p\big ( h^{-1/r} \big )\) which implies the stated results as \(\hat{h}/h -1 = o_p(1)\). \(\square \)

Proposition 3

We have

$$\begin{aligned} I_{n,3} = O_p\big ( (nh)^{-1/2} \big ). \end{aligned}$$

Moreover, under the null hypothesis we have

$$\begin{aligned} I_{n,3} = O_p\big ( n^{-1} h^{-1/r} + n^{-1/2} \xi _n^\omega \big ), \end{aligned}$$

where \(r \in \,]2,\infty ]\) is given in assumption (F).

Proof

The first statement follows from Propositions 1 and 2 since \(|I_{n,3}| \le I_{n,1}^{1/2} I_{n,2}^{1/2}\). On the other hand, from (22), (23) and (24) we have

$$\begin{aligned} I_{n,3}&= \sum _{\ell ,\ell '=0}^{\omega -1} \xi _n^{\ell +\ell '}\frac{1}{n} \sum _{i=1}^n \int \big \{ K^{\partial (\ell )}_h(x-X_i) - K^{\partial (\ell )}_h\!*\!f(x) \big \}K^{\partial (\ell ')}_h \!* \hat{\delta }_n(x) \mathrm{d}x \\&\qquad + \sum _{\ell =0}^{\omega -1} \xi _n^{\omega +\ell }\frac{1}{n} \sum _{i=1}^n \big \{ K^{\partial (\ell )}_h(x-X_i) - K^{\partial (\ell )}_h\!*\!f(x) \big \}K^{\partial (\omega )}_h (\cdot ,\hat{h}) \!* \hat{\delta }_n(x) \mathrm{d}x \\&\qquad + \sum _{\ell =0}^{\omega -1} \xi _n^{\omega +\ell } \frac{1}{n} \sum _{i=1}^n \int \big \{ K^{\partial (\omega )}_h(x\!-\!X_i,\hat{h}) \!-\! K^{\partial (\omega )}_h(\cdot ,\hat{h})\!*\!f(x) \big \} K^{\partial (\ell )}_h \!* \hat{\delta }_n(x) \mathrm{d}x \\&\qquad + \xi _n^{2\omega } \frac{1}{n} \sum _{i=1}^n \int \big \{ K^{\partial (\omega )}_h(x\!-\!X_i,\hat{h}) \!-\! K^{\partial (\omega )}_h(\cdot ,\hat{h})\!*\!f(x) \big \} K^{\partial (\omega )}_h (\cdot ,\hat{h}) \!* \hat{\delta }_n(x) \mathrm{d}x \\&\quad = I_{n,3}^1 + I_{n,3}^2 + I_{n,3}^3 + I_{n,3}^4. \end{aligned}$$

where \(\hat{\delta }_n(x)=f(x) - g(x; \hat{\theta }_1, \hat{\theta }_2 )\). From assumption (F), the function \((\theta _1,\theta _2) \mapsto g(x; \theta _1,\theta _2)\) has continuous second-order partial derivatives, and for some \(r \in \,]2,\infty ]\) the functions \((\theta _1,\theta _2) \mapsto \big |\big | \frac{\partial ^2 g}{\partial \theta _k \partial \theta _l} (\cdot ; \theta _1,\theta _2)\big |\big |_r\) are locally bounded on \(\mathbb {R} \times ]0,+\infty [\), for \(k,l=1,2\). Therefore, under the null hypothesis a Taylor expansion of \(g(x; \hat{\theta }_1, \hat{\theta }_2 )\) at the point \((\theta _1(f), \theta _2(f))\) leads to

$$\begin{aligned} \hat{\delta }_n(x) = - \sum _k (\hat{\theta }_k-\theta _k(f)) \frac{\partial g}{\partial \theta _k} (x; \theta _1(f), \theta _2(f)) + v_n(x), \end{aligned}$$
(29)

for \(x\in \mathbb {R}\), where from assumption (P)

$$\begin{aligned} || v_n ||_r = O_p\big ( (\hat{\theta }_1-\theta _1(f) )^2 + (\hat{\theta }_2-\theta _2(f) )^2 \big ) = O_p\big ( n^{-1} \big ). \end{aligned}$$

Therefore, from Lemma 1 we get \(I_{n,3}^1 = O_p \big ( n^{-1} h^{-1/r} \big )\), \(I_{n,3}^2 = O_p \big ( (n^{-1/2} + n^{-1} h^{-1/r}) \xi _n^\omega \big )\), \(I_{n,3}^3 = O_p \big ( ( n^{-1/2} + n^{-1} h^{-1/r} ) \xi _n^\omega \big )\) and \(I_{n,3}^4 = O_p \big ( ( n^{-1/2} + n^{-1} h^{-1/r} ) \xi _n^{2\omega } \big )\), which completes the proof. \(\square \)

We can now conclude the proof of Theorem 1. As \(\xi _n = o_p(1)\) and \(h \rightarrow 0\), as \(n\rightarrow \infty \), from Proposition 1 we have

$$\begin{aligned} I_{n,1} = O_p\big ( (nh)^{-1} + \xi _n^\omega \big ). \end{aligned}$$

Therefore, from expansion (21) and Propositions 2 and 3, we get

$$\begin{aligned} (nh)^{-1} \big ( I_n(\hat{h}) - R(K) \big ) = R\big ( f - g(\cdot ; \theta _1(f),\theta _2(f) ) \big ) + O_p\big ( (nh)^{-1/2} + \xi _n^\omega \big ), \end{aligned}$$

which completes the proof of part b) as \(nh \rightarrow \infty \), when \(n\rightarrow \infty \). Moreover, under the null hypothesis from Propositions 1, 2 and 3 we also have

$$\begin{aligned} h^{-1/2} \big ( I_n(\hat{h}) - R(K) \big ) = U_n + O_p\Big ( h^{-1/2} \xi _n^2 + h^{1/2-1/r} + n h^{1/2} \xi _n^\omega \Big ) + o_p(1). \end{aligned}$$

Taking into account hypothesis (13), this completes the proof of part a) as \(r>2\) and \(U_n\) are asymptotically normal with zero mean and variance equal to \(\nu _f^2 = 2R(K\!*\!K)R(f)\).

\(\square \)

1.2 Proof of Theorem 2

Let us consider the expansion

$$\begin{aligned} (n\hat{h})^{-1} J_n(\hat{h})&= \int \{ f_{\hat{h}}(x) - f(x) \}^2 \mathrm{d}x \nonumber \\&\quad + \int \{ f(x) - g(x; \hat{\theta }_1, \hat{\theta }_2 ) \}^2 \mathrm{d}x \nonumber \\&\quad + 2 \int \{ f_{\hat{h}}(x) - f(x) \} \{ f(x) - g(x; \hat{\theta }_1, \hat{\theta }_2 ) \} \mathrm{d}x \nonumber \\&=: J_{n,1} + J_{n,2} + 2 J_{n,3}. \end{aligned}$$
(30)

Each one of these terms will be studied in the following propositions. As before, we denote by h the deterministic sequence h(f) which existence is assured by assumption (B).

Proposition 4

We have

$$\begin{aligned} J_{n,1}= & {} \frac{1}{nh} R(K) + R(K_h*f - f) + \frac{1}{nh^{1/2}} U_n (1+o_p(1)) + \frac{1}{\sqrt{n}h^{-2}} V_n\\&+ O_p \Big ( \big ( (nh)^{-1} + h^4 \big ) \xi _n + \xi _n^\omega \Big ), \end{aligned}$$

where \(U_n\) is defined in Proposition 1 and \(V_n\) given by (31) is asymptotically normal with zero mean and variance \(\mu _2(K)^2 \mathrm {Var}_f(f''(X_1))\).

Proof

Taking into account equality (22) and assumptions (D), (D’), (K), (K’) and (B), from Lemma 1 of Tenreiro (2001, p. 286) we have

$$\begin{aligned} J_{n,1} = \int \{ f_{h}(x) - f(x) \}^2 \mathrm{d}x + O_p \Big ( \big ( (nh)^{-1} + h^4 \big ) \xi _n + \xi _n^\omega \Big ). \end{aligned}$$

Using degenerated U-statistics techniques (see Hall 1984) we know that

$$\begin{aligned} \begin{aligned}\int \{ f_{h}(x) - f(x) \}^2 dx \mathrm {d}x&= \frac{1}{nh} R(K) + R(K_h*f - f) \\&\quad + \frac{1}{nh^{1/2}} U_n (1+o_p(1)) + \frac{1}{\sqrt{n}h^{-2}} V_n, \end{aligned} \end{aligned}$$

with \(U_n\) given by (25) and

$$\begin{aligned} V_n := \frac{2}{\sqrt{n}} \sum _{i=1}^n \int \{ K_h(x-X_i) - K_h*f(x) \} h^{-2} \{ K_h*f(x) - f(x) \} \mathrm{d}x, \end{aligned}$$
(31)

with

$$\begin{aligned} h^{-2} \{ K_h*f(x) - f(x) \} = \iint _0^1 (1-t) u^2 K(u) f''(x-tuh) \mathrm{d}u \mathrm{d}t, \end{aligned}$$
(32)

is asymptotically normal with zero mean and variance equal to \(\mu _2(K)^2 \mathrm {Var}_f(f''(X_1))\).

\(\square \)

Proposition 5

We have

$$\begin{aligned} J_{n,2} = R\big ( f - g(\cdot ; \theta _1(f),\theta _2(f) ) \big ) + o_p(1). \end{aligned}$$

Moreover, under the null hypothesis we have

$$\begin{aligned} J_{n,2} = O_p\big ( n^{-1} \big ). \end{aligned}$$

Proof

It follows straightforwardly from (27) and (28). \(\square \)

Proposition 6

We have

$$\begin{aligned} J_{n,3} = O_p\big ( (nh)^{-1/2} \big ). \end{aligned}$$

Moreover, under the null hypothesis we have

$$\begin{aligned} J_{n,3} = - \frac{1}{\sqrt{n}h^{-2}} \big ( W_n + o_p(1) \big ) + O_p \big ( n^{-1} h^{-1/r} + n^{-1/2} \xi _n^\omega \big ), \end{aligned}$$

where \(W_n\) is given by (36).

Proof

The first statement follows from Propositions 4 and 5 because \(|J_{n,3}| \le J_{n,1}^{1/2} J_{n,2}^{1/2}\) and \(R(K_h*f - f)=O(h^4)\). Write

$$\begin{aligned} J_{n,3}&= \int \{ f_{\hat{h}}(x) - K_{\hat{h}}*f(x) \} \hat{\delta }_n(x) \mathrm{d}x + \int \{ K_{\hat{h}}*f(x) - f(x) \} \hat{\delta }_n(x) \mathrm{d}x \nonumber \\&=: J_{n,3}^1 + J_{n,3}^2 , \end{aligned}$$
(33)

where \(\hat{\delta }_n(x)=f(x) - g(x; \hat{\theta }_1, \hat{\theta }_2 )\). From (22) and (23) we have

$$\begin{aligned} J_{n,3}^1&= \sum _{\ell =0}^{\omega -1} \xi _n^\ell \frac{1}{n} \sum _{i=1}^n \int \big \{ K^{\partial (\ell )}_h(x-X_i) - K^{\partial (\ell )}_h\!*\!f(x) \big \} \hat{\delta }_n(x) \mathrm{d}x \nonumber \\&\quad + \xi _n^\omega \frac{1}{n} \sum _{i=1}^n \int \big \{ K^{\partial (\omega )}_h(x-X_i,\hat{h}) - K^{\partial (\omega )}_h(\cdot ,\hat{h})\!*\!f(x) \big \} \hat{\delta }_n(x) \mathrm{d}x, \end{aligned}$$

where from Lemma 1 we get

$$\begin{aligned} J_{n,3}^1 = O_p \big ( n^{-1} h^{-1/r} + n^{-1/2} \xi _n^\omega \big ). \end{aligned}$$
(34)

On the other hand, from (23) we have

$$\begin{aligned} J_{n,3}^{2}&= \int \{ K_{h}*f(x) - f(x) \} \hat{\delta }_n(x) \mathrm{d}x \nonumber \\&\quad + \sum _{\ell =1}^{\omega -1} \xi _n^\ell \int K^{\partial (\ell )}_h\!*\!f(x) \hat{\delta }_n(x) \mathrm{d}x + \xi _n^\omega \int K^{\partial (\omega )}_h(\cdot ,\hat{h})\!*\!f(x) \hat{\delta }_n(x) \mathrm{d}x, \end{aligned}$$
(35)

where for all \(\epsilon \in \,]0,\eta [\) and for \(|\hat{h}/h-1| \le \epsilon \) we have

$$\begin{aligned} \bigg | \int K^{\partial (\omega )}_h(\cdot ,\hat{h})\!*\!f(x) \hat{\delta }_n(x) \mathrm{d}x \bigg | \le || K^{\partial (\omega ),\eta }||_1 ||f||_2 || \hat{\delta }_n ||_2. \end{aligned}$$

Moreover, as \(\int K^{\partial (\ell )}(u) \mathrm{d}u = \int uK^{\partial (\ell )}(u) \mathrm{d}u=0\) for \(\ell \ge 1\), a Taylor expansion of second order leads to

$$\begin{aligned} K^{\partial (\ell )}_h\!*\!f(x) = h^2 \iint _0^1 (1-t) u^2 K^{\partial (\ell )}(u) f^{\prime \prime }(x-tuh) \mathrm{d}t\mathrm{d}u. \end{aligned}$$

Therefore, for \(\ell \ge 1\) we have

$$\begin{aligned} \bigg | \int K^{\partial (\ell )}_h \!*\!f(x) \hat{\delta }_n(x) \mathrm{d}x \bigg | \le h^2 \int u^2 |K^{\partial (\ell )}(u)| \mathrm{d}u ||f''||_2 || \hat{\delta }_n ||_2. \end{aligned}$$

Taking into account (27) and the fact that \(|| \hat{\delta }_n ||_2 = O_p(n^{-1/2})\) under the null hypothesis, from (35) we get

$$\begin{aligned} J_{n,3}^{2} = \int \{ K_{h}*f(x) - f(x) \} \hat{\delta }_n(x) \mathrm{d}x + O_p\big ( n^{-1/2} ( h^2 \xi _n + \xi _n^\omega ) \big ). \end{aligned}$$

Finally, from (29) and (32), and assumptions (E) and (\(G'\)), we have

$$\begin{aligned}&\int \{ K_{h}*f(x) - f(x) \} \hat{\delta }_n(x) \mathrm{d}x \\&\quad = h^2 \iiint _0^1 (1-t) u^2 K(u) f^{\prime \prime }(x-tuh) \hat{\delta }_n(x) \mathrm{d}t\mathrm{d}u \mathrm{d}x \\&\quad = - \frac{1}{\sqrt{n}h^{-2}} \big ( W_n + o_p(1) \big ) + O_p\big ( n^{-1} h^2 \big ), \end{aligned}$$

where

$$\begin{aligned} W_n = \frac{1}{\sqrt{n}} \sum _{i=1}^n \sum _k \psi _k(X_i;\theta _1(f),\theta _2(f)) D_k(f), \end{aligned}$$
(36)

with

$$\begin{aligned} D_k(f) = \frac{1}{2} \mu _2(K) \int \bar{f}^{\prime \prime }(x) \frac{\partial g}{\partial \theta _k} (x; \theta _1(f) \theta _2(f)) \mathrm{d}x, \end{aligned}$$

as

$$\begin{aligned} \iiint _0^1 (1-t) u^2 K(u) f^{\prime \prime }(x-tuh) \frac{\partial g}{\partial \theta _k} (x; \theta _1(f) \theta _2(f)) \mathrm{d}t\mathrm{d}u \mathrm{d}x = D_k(f) + o(1), \end{aligned}$$

and

$$\begin{aligned} \bigg | \iiint _0^1 (1-t) u^2 K(u) f^{\prime \prime }(x-tuh) v_n(x) \mathrm{d}t\mathrm{d}u \mathrm{d}x \bigg | \le \mu _2(K) ||f''||_s ||v_n||_r, \end{aligned}$$

with \(1/r+1/s=1\). Thus

$$\begin{aligned} J_{n,3}^{2} = - \frac{1}{\sqrt{n}h^{-2}} \big ( W_n + o_p(1) \big ) + O_p\big ( n^{-1} h^2 + n^{-1/2} ( h^2 \xi _n + \xi _n^\omega ) \big ) \end{aligned}$$
(37)

The proposition follows from (33), (34) and (37). \(\square \)

We can now conclude the proof of Theorem 2. From Proposition 4 and assumption (B’) we have

$$\begin{aligned} J_{n,1}= O_p\big ( (nh)^{-1} + \xi _n^\omega \big ). \end{aligned}$$

Therefore, from expansion (30) and Propositions 5 and 6, we get

$$\begin{aligned}&(nh)^{-1} \big ( J_n(\hat{h}) - R(K) - c_n(f;K) \big ) \\&\quad = R\big ( f - g(\cdot ; \theta _1(f),\theta _2(f) \big ) + O_p\big ( (nh)^{-1/2} + \xi _n^\omega \big ), \end{aligned}$$

which completes the proof of part b). Moreover, from Propositions 4, 5 and 6, under the null hypothesis we also have

$$\begin{aligned} h^{-1/2} \big ( J_n(\hat{h}) - R(K) - c_n(f;K) \big )&= U_n + ( nh^5 )^{1/2} (V_n - 2W_n) \\&\quad + O_p\Big ( h^{-1/2} \xi _n + h^{1/2-1/r} + n h^{1/2} \xi _n^\omega \Big ) + o_p(1). \end{aligned}$$

Taking into account hypothesis (14), this completes the proof of part a) as \(r>2\) and, from the central limit theorem for degenerate U-statistics with variable kernels established in Tenreiro (1997, Theorem 1, p. 190), the sum \(U_n + ( nh^5 )^{1/2} (V_n - 2W_n)\) is asymptotically normal with zero mean nd variance equal to \(\sigma _f^2 = 2R(K*K) R(f) + \lambda _f \mu _2(K)^2 \mathrm {Var}_f(\varphi _f(X))\). \(\square \)

1.3 Proof of Theorem 3

We consider only the case of the test based on the critical region \(\mathscr {C}(J_n(\hat{h}),\alpha )=\{J_n(\hat{h}),\alpha ) > q(J_n(\hat{h}),\alpha ) \}\) given in (15), where \(q(J_n(\hat{h}),\alpha )\) is the quantile of order \(1-\alpha \) of the null distribution of \(J_n(\hat{h})\), but similar arguments can be used to establish the consistency of the test based on \(\mathscr {C}(I_n(\hat{h}),\alpha )\). From Theorem 2.a) and for \(f\in \mathscr {F}_0\) we have \(\upsilon _{f}^{-1} h(f)^{-1/2} \big ( q(J_n(\hat{h}),\alpha ) - R(K) - c_n(f;K) \big ) \rightarrow \Phi ^{-1}(1-\alpha )\). Therefore,

$$\begin{aligned} q(J_n(\hat{h}),\alpha ) \rightarrow R(K)+c(f_0;K), \end{aligned}$$
(38)

because h(f) tends to zero, as \(n\rightarrow \infty \), and \(c_n(f;K)=c_n(f_0;K)=c(f_0;K) (1+o(1))\), with \(c(f;K)=\frac{1}{4} \lambda _{f} \mu _2(K)^2 R(f^{\prime \prime }) (1 + o(1))\) (see Wand and Jones 1995, pp. 19–23, and Bosq and Lecoutre 1987, pp. 80–81). On the other hand, from Theorem 2.b) and for \(f\in \mathscr {F}{\setminus }\mathscr {F}_0\) we have \((nh(f))^{-1} \big ( J_n(\hat{h}) - R(K) - c_n(f;K) \big ) {\mathop {\longrightarrow }\limits ^{p}} R\big (f - g(\cdot ; \theta _1(f),\theta _2(f) )\big ) \ne 0,\) which enables us to conclude that

$$\begin{aligned} J_n(\hat{h}) {\mathop {\longrightarrow }\limits ^{p}} + \infty , \; \text{ for } \text{ all } \;f\in \mathscr {F}{\setminus }\mathscr {F}_0, \end{aligned}$$
(39)

as \(nh(f) \rightarrow \infty \), and \(c_n(f;K)=c(f;K) (1+o(1))\). The consistency of the test based on \(\mathscr {C}(J_n(\hat{h}),\alpha )\) follows now from (38) and (39). \(\square \)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Tenreiro, C. On automatic kernel density estimate-based tests for goodness-of-fit. TEST 31, 717–748 (2022). https://doi.org/10.1007/s11749-021-00799-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11749-021-00799-3

Keywords

Mathematics Subject Classification

Navigation