An Optimal Test for the Additive Model with Discrete or Categorical Predictors
Abhijit Mandal

TL;DR
This paper introduces an asymptotically optimal test for additive models with discrete or categorical predictors, applicable to models with continuous covariates, and demonstrates its effectiveness through simulations and real data application.
Contribution
The paper develops a new goodness-of-fit test for additive models with discrete or categorical predictors, extending existing methods to handle mixed predictor types.
Findings
Test is asymptotically optimal with a $n^{-1/2}$ detection rate.
Simulation studies confirm theoretical properties.
Applied successfully to real data on diamond pricing.
Abstract
In multivariate nonparametric regression the additive models are very useful when a suitable parametric model is difficult to find. The backfitting algorithm is a powerful tool to estimate the additive components. However, due to complexity of the estimators, the asymptotic -value of the associated test is difficult to calculate without a Monte Carlo simulation. Moreover, the conventional tests assume that the predictor variables are strictly continuous. In this paper, a new test is introduced for the additive components with discrete or categorical predictors, where the model may contain continuous covariates. This method is also applied to the semiparametric regression to test the goodness-of-fit of the model. These tests are asymptotically optimal in terms of the rate of convergence, as they can detect a specific class of contiguous alternatives at a rate of . An…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
An Optimal Test for the Additive Model with Discrete or Categorical Predictors
Abhijit Mandal
Department of Mathematics, Wayne State University
Detroit, MI 48202, U.S.A
Abstract
In multivariate nonparametric regression the additive models are very useful when a suitable parametric model is difficult to find. The backfitting algorithm is a powerful tool to estimate the additive components. However, due to complexity of the estimators, the asymptotic -value of the associated test is difficult to calculate without a Monte Carlo simulation. Moreover, the conventional tests assume that the predictor variables are strictly continuous. In this paper, a new test is introduced for the additive components with discrete or categorical predictors, where the model may contain continuous covariates. This method is also applied to the semiparametric regression to test the goodness-of-fit of the model. These tests are asymptotically optimal in terms of the rate of convergence, as they can detect a specific class of contiguous alternatives at a rate of . An extensive simulation study is presented to support the theoretical results derived in this paper. Finally, the method is applied to a real data to model the diamond price based on its quality attributes and physical measurements.
AMS 2010 subject classification: Primary 62G10; Secondary 62J12, 62G20.
Keywords: Additive model; Categorical data analysis; Backfitting algorithm; Generalized likelihood ratio test; Semiparametric model; Local polynomial regression.
1 Introduction
The additive model is a widely used multivariate smoothing technique. It was originally suggested by Friedman and Stuetzle (1981) and popularized due to extensive discussion in Hastie and Tibshirani (1990). It models a random sample by
[TABLE]
where the random error has mean zero, constant variance , and the additive component is an unknown smooth function for . Stone (1985, 1986) have shown that the additive model reduces a full -dimensional nonparametric regression effectively to a one-dimensional problem by fitting the model with the same asymptotic efficiency, i.e., an optimal convergence rate of for twice continuously differentiable functions. So, it has the very desirable property of reducing the “curse of dimensionality” in a satisfactory manner. In this paper, the additive function is estimated using the backfitting algorithm proposed by Buja et al (1989). Opsomer and Ruppert (1997), Wand (1999) and Opsomer (2000) studied asymptotic properties of the backfitting estimators. In the literature, there are several other algorithms, such as the marginal integration estimation method (Tjøstheim and Auestad, 1994), the estimating equation method (Mammen et al, 1999) and the Bayesian backfitting algorithm (Hastie and Tibshirani, 2000), among others.
To our knowledge, there are relatively limited theoretical results on the testing problem for the additive models where discrete or categorical (possibly mixed with continuous) explanatory variables are considered. Sperlich et al (2002) and Yang et al (2003) considered marginal integration estimators to construct tests for testing the additive components with continuous variables. The asymptotic critical values of these tests are difficult to obtain due to the complicated expressions for the bias and the variance of the test statistic. Moreover, the authors observed that the asymptotic accuracy of their result is limited for small and moderate sample sizes. In the same setup, Fan et al (2001) and Fan and Jiang (2005) proposed the generalized likelihood ratio (GLR) test for testing the significance of additive components using backfitting estimators. The idea is based on comparison of pseudo-likelihood functions under the null and the alternative hypotheses, which leads to the log-ratio of the variance estimators under the null and the alternative. Similar to the maximum likelihood ratio tests in parametric models, the GLR test has an important fundamental property that the asymptotic null distribution of the test is independent of nuisance parameters and functions. This property is referred to as the Wilks phenomenon. The GLR test is asymptotically distribution-free; and it is asymptotically optimal in terms of convergence of the nonparametric hypothesis testing problem (see Ingster, 1993 and Spokoiny, 1996). However, the authors mentioned that the GLR test may not be accurate as the test statistic contains an unknown bias term. So, a Monte Carlo simulation or a bootstrap technique is performed to calculate the -value of the test. This somehow restricts the method for being widely applicable among the general practitioners.
In this paper, we propose a GLR test for the additive components having discrete or categorical valued predictors, while the model may contain continuous valued covariates. For categorical predictors this test may be regarded as the generalized analysis of covariance (ANCOVA), where covariates are modeled by nonparametric functions and the normality assumption on the error term is not required. In this case, the predictors may be referred as treatment or block of the design of experiment.
The rest of the paper is organized as follows. We gave an overview of the nonparametric additive model and the semiparametric additive model in Sections 2 and 3, respectively. In Section 4, we introduced the GLR test and presented the theoretical properties. An extensive simulation studies are performed in Section 5 to explore the behavior of the proposed test. In Section 6, we have applied our method to analyze a real data containing diamond price, and we proposed an appropriate model based on quality attributes and physical measurements. Section 7 has some concluding remarks. The assumptions of the theorems are given in Appendix A. Appendix B presents a brief description of the backfitting estimator. The proofs of the theorems are given in Appendix C.
2 The Nonparametric Additive Model
Let us consider a one dimensional response variable , a -dimensional predictor and an additional -dimensional covariate . We assume that contains only discrete or categorical variables, but may contain all type of variables – categorical, discrete or continuous. If is a discrete valued random variable, then denotes the number of distinct values, , where for all . If is a categorical variable, then are different levels of the variable. Let be a random sample of size from . The nonparametric additive model is given by
[TABLE]
where the random error has mean zero and a constant variance . To ensure identifiability of components of the additive model, we set for all , and for all . The intercept parameter is generally estimated by . The backfitting estimator is used to estimate the nonparametric functions for . For the ease of readability, a discussion on the backfitting estimators is given in Appendix B. We have divided regressors into two groups – predictor and covariate, as we construct a test of significance for predictors only, whereas their effect is adjusted by “nuisance” covariates. In other words, if we are interested to test the effect of a subset of regressors in the additive model, we name those regressors as predictors and remaining regressors as covariates. We require all predictors to be discrete or categorical variables, but there is no restriction on covariates.
3 The Semiparametric Additive Model
The semiparametric additive model (SAM) is the combination of a parametric model and a nonparametric additive model. Here, some of the additive components are modeled parametrically while the remaining ones are unspecified and are estimated nonparametrically. First, we model predictors parametrically and covariates nonparametrically, then a generalized model is considered. In general, the predictors are assumed to be discrete valued random variables. However, if the predictors are ordinal categorical variables, their order or rank may also be modeled parametrically. Let us consider the following SAM model:
[TABLE]
where is a family of parametric functions for . We assume that is completely known except for the value of the parameter , . Opsomer and Ruppert (1999) and Jiang et al (2007) have studied this model when the parametric models are linear functions. One might be interested to build a SAM when the main interest of study is to precisely quantify the effect of the predictors on the dependent variable , but the relationship is observed in the presence of “nuisance” covariates . The use of the parametric forms for predictors, if properly specified, allows us to make an easily interpretable inference about their effect on . On the other hand, modeling covariates nonparametrically, one may avoid potential introduction of bias in the estimated relationship between predictors and . Another possible situation when a SAM would be useful, if someone is fairly confident about the shape of the relationship between predictors and , but not about that of the other covariates. It can be shown that by modeling some predictors using appropriate parametric functions, the risk of over-fitting the model is reduced by decreasing the overall degrees of freedom of the test.
To ensure the identifiability of the model, we assume that the expectation of the parametric term is zero, i.e. for all , and for all . We consider the case where is a polynomial for all . As takes values, one needs at most parameters to completely specify . So, we assume that is a polynomial of degree , where , . Therefore, with a slight abuse of notation, we write
[TABLE]
where , . Note that is not an independent parameter, it just makes centered at zero. Let us define , where . For , we define
[TABLE]
and if then is a vector containing the first column of Equation (3.3). Let . Then, following Speckman (1988), the estimates of the additive components are derived from the backfitting algorithm as the solution of the following equations:
[TABLE]
provided exists. Here, is the centered smoothing matrix for as defined after Equation (A.4) in Appendix B. Suppose is the additive smoother matrix of , so that the backfitting estimate of is for . Let us define and . Then, the above normal equations are solved non-iteratively as
[TABLE]
Sometimes the experimenter may have a prior knowledge about some of the variables and would like to model them parametrically, whereas keeping other variables in the nonparametric model. In that case, one may consider the following generalized SAM model:
[TABLE]
where and for , for are families of parametric functions. For simplicity, we assume that is a polynomial of degree for all and .
4 The Generalized Likelihood Ratio Test
Let us consider the generalized SAM model defined in Equation (3.6). For this model, one may be interested mainly in two type of tests based on the predictor variables – a goodness-of-fit test for the parametric function and a model utility test for the nonparametric function. First, we present the generalized test that includes both type of tests, then we discuss about the individual test. So, we are now interested in the following null hypothesis:
[TABLE]
Under , we define and as the backfitting estimators of and , respectively. Then, the residual sum of squares, under , is given by
[TABLE]
As we are testing only for predictors by keeping covariates unchanged, the unconstrained model is
[TABLE]
Under this model, the residual sum of square is given by
[TABLE]
where and are the backfitting estimators of and , respectively, under the unconstrained model. The generalized likelihood ratio (GLR) test statistic for testing null hypothesis is defined as
[TABLE]
If the difference between and is small, then the GLR test statistic may be approximated by . In the parametric model, this is equivalent to the log-likelihood ratio test statistic, where estimators are replaced by the corresponding maximum likelihood estimators. Generally, the nonparametric maximum likelihood estimate does not exist and even when it does exist, the resulting maximum likelihood ratio test is not optimal (see Fan and Jiang, 2005, Hall and Marron, 1988). So, the GLR test statistic may be regarded as a log-ratio of the quasi-likelihoods.
We assumed homoscedasticity of the error term, i.e. error in model (3.6) has a constant variance. If this assumption is not valid, one may consider a GLR statistic by taking weighted residual sum of squares. The subsequent analysis and the backfitting algorithm will be modified similar to the weighted likelihood approach for the parametric models.
4.1 Asymptotic Distribution
To derive the null distribution of the GLR test statistic, let us define , where for and . We also define in a similar way of as defined in Equation (3.3) by replacing with . Let us denote . Suppose , and is a dimensional block diagonal matrix whose -th diagonal block is an identity matrix of order if , and if . Define another dimensional block matrix , whose -th diagonal block is the identity matrix of order if , and of order if . For , the -th off-diagonal block of is given by
[TABLE]
where if and if . Then, the following theorem gives the asymptotic null distribution of the GLR statistic.
Theorem 1**.**
Suppose that regularity conditions (C1)–(C8) in Appendix A hold. Further assume that the limit of exists and it is invertible. Let us consider the unconstrained model (4.3) and the null hypothesis in (4.1), where is a polynomial of degree and , for . Then, under , the asymptotic distribution of the GLR test statistic coincides with , where are independent and identically distributed (i.i.d.) standard normal variables, are non-zero eigenvalues of and is the rank of .
The proof of the theorem is given in Appendix B. Theorem 1 shows that the asymptotic null distribution of the GLR test statistic is a linear combination of chi-square variables. The critical region of the test may be calculated using the algorithm proposed by Davies (1980). Note that the null distribution does not depend on the modeling of covariates as we keep covariates unchanged under both the null and the alternative hypotheses. But, in practice, it reduces the possible over-fitting; thus the finite sample performance of the test improves due to parametric modeling those covariates. However, one must be careful while modeling covariates, and it is important to verify whether such a parametric model is valid or not. A wrong model may cause severe power loss as demonstrated in the simulation studies. A special case of Theorem 1 when the predictor variables are pairwise independent, the null distribution is reduced to a single chi-square as mentioned in the following corollary.
Corollary 1**.**
Suppose that the predictor variables are pairwise independent, and the assumptions of Theorem 1 hold. Then, under , the asymptotic distribution of the GLR test statistic is a chi-square distribution with degrees of freedom .
It is shown in the simulation section that even if the predictors are not pairwise independent one may approximate the null distribution using Corollary 1 unless predictors are strongly correlated. Simulation studies show that the approximation makes the test little anti-conservative in small or moderate sample sizes. However, as sample size increases it gives a good approximation.
It is interesting to note that the asymptotic null distribution of the GLR test statistic does not depend on the nuisance parameters – the design densities of , functions for the covariates and the error distribution. But, in general, it depends on the design densities of as shown in Theorem 1. So, the Wilks phenomenon does not hold in the true sense, however, it holds good if predictors are pairwise independent.
The main advantage of our method is that it is easy to calculate the -values of the test. In fact, the discrete valued predictors make the test simple. On the other hand, as shown by Fan and Jiang (2005) and Jiang et al (2007), if the predictors are continuous the GLR test becomes complicated, and the asymptotic null distribution depends on kernel density functions and bandwidth parameters. Moreover, the authors mentioned that the null distribution may not be accurate as the test statistic contains an unknown bias term. So, the null distribution is calculated by Monte Carlo simulation or using a conditional bootstrap method. In our test, we do not need any additional conditions to choose the bandwidth parameter for continuous covariates as long as assumption (C5) holds. Therefore, for simplicity, we may use the same bandwidth parameter which is optimal for estimation (see Section 5).
The main contribution of this paper is that the GLR test is constructed for the additive components with discrete or categorical predictors. The asymptotic distribution of the GLR test statistic is derived in Fan and Jiang (2005) with the strict assumption that all the predictors and covariates are continuous, more specifically, their marginal distributions must be Lipschitz continuous on some bounded support. Keeping in mind the real applications, this restriction is modified for the discrete or categorical predictors. For this reason, the proof of the theorem does not directly follow from the previous method, and we used a novel approach to derive the asymptotic distribution.
4.2 Power Function
We now consider the power function of the GLR test. Let us take the following contiguous alternative hypothesis:
[TABLE]
where is an additive function under the alternative hypothesis such that . We define as the best fitted polynomial of degree to for , and for . Using the following theorem, we get the power function of the GLR test.
Theorem 2**.**
Let us consider the notations and assumptions of Theorem 1. Then, under , the asymptotic distribution of the GLR test statistic coincides with , where .
It is interesting to note that the GLR test detects a specific class of contiguous alternatives at a rate of . So, the power of the test is asymptotically optimal in terms of the rate of convergence. For a fixed alternative the power of the GLR test convergences to one, i.e. the test is consistent. In case of pairwise independent predictors, the theorem simplifies as below.
Corollary 2**.**
Suppose that the predictor variables are pairwise independent, and the assumptions of Theorem 1 hold. Then, under , the asymptotic distribution of the GLR test statistic is non-central chi-square with the non-centrality parameter and the degrees of freedom .
It is not surprising that the GLR statistic is -consistent, whereas most of the nonparametric tests have relatively slower rate. Estimating the function corresponding to a discrete or categorical predictor is a finite dimensional problem as we assume that , the domain of , is finite. Thus, all functions for of the additive models in (3.6) and (4.3) are equivalent to the parametric part of the semiparametric model. So, the corresponding convergence rate is consistent with Corollary 1 of Opsomer and Ruppert (1999). The same result is also obtained by Speckman (1988). However, this rate depends on the bandwidth parameter selected for smoothing the continuous covariates (if any). The bandwidth parameter must be selected based on assumption (C5) given in Appendix A. Even if when the model contains continuous covariates, as the null hypothesis is the significance only for the predictors, the GLR test has a convergence rate similar to a parametric model. Intuitively, in large sample sizes, the effect of smoothers for continuous covariates cancels out when two residual sum of squares are subtracted in the numerator of the GLR statistic in Equation (4.5). Meanwhile, the denominator (decided by ) of the GLR statistic converges to , the error variance of the additive model. So, those continuous smooth functions do not have any major role in the rate of convergence of the GLR test as long as their bandwidth parameters are optimally selected.
We have started with a very general test in that includes both the goodness-of-fit test and the model utility test. For this reason, the construction of and used in Theorem 1 looks slightly complicated. However, if we are interested only in one type of test, those matrices becomes very simple. In these cases, the residual sum of squares and also have simpler expressions. Now, we discuss about these special cases. To make the procedure further simple, we assume that all covariates are modeled nonparametrically.
4.3 The Goodness-of-Fit Test for the Semiparametric Model
Let us consider the full nonparametric additive model given in (2.1). With respect that base model, we now construct a goodness-of-fit test for the semiparametric model (3.1), where all predictors are modeled parametrically. So, the null hypothesis for this problem is
[TABLE]
The residual sum of squares, under , is given by
[TABLE]
where is the backfitting estimator of under for , and is the backfitting estimator of under for . Under the unconstrained nonparametric additive model, the residual sum of square is given by
[TABLE]
where are the backfitting estimators under the full model given in (2.1). Suppose , and is a dimensional block matrix, whose -th diagonal block is an identity matrix of order , and for the -th off-diagonal block of is given in Equation (4.6) with . Notice that , defined in Section 4.1, becomes an identity matrix in this setup as . Moreover, we need existence of instead of , where is defined in Section 3 after Equation (3.3). Then, the following result gives the asymptotic null distribution of the GLR goodness-of-fit test statistic .
Corollary 3**.**
Suppose that the limit of exists and it is invertible, and regularity conditions (C1)–(C8) in Appendix A hold. Let us consider the unconstrained model (2.1) and the null hypothesis in (4.8), where is a polynomial of degree and for all . Then, the asymptotic distribution of the GLR goodness-of-fit test statistic, under , coincides with , where are i.i.d. standard normal variables, are non-zero eigenvalues of and is the rank of .
In general, the asymptotic null distribution of the GLR goodness-of-fit test statistic is a linear combination of chi-square variables. But, the distribution comes out to be a single chi-square if the predictor variables are pairwise independent. In this case, the degrees of freedom of the test statistic becomes .
4.4 Model Utility Test for the Nonparametric Additive Model
Let us consider the null hypothesis that there is no association between and , where are covariates of the nonparametric additive model (2.1). The null hypothesis can be written as
[TABLE]
Let be the backfitting estimators under . Then, the residual sum of squares, under , is given by
[TABLE]
Under the unconstrained nonparametric additive model (2.1), the residual sum of square is given in Equation (4.10). So, the GLR nonparametric test statistic becomes .
Suppose is a dimensional block diagonal matrix whose -th diagonal block is for . Define another dimensional block matrix , whose -th diagonal block is an identity matrix of order , and for the -th element of the -th off-diagonal block of is given by
[TABLE]
where and . The following result gives the asymptotic distribution of the GLR nonparametric test statistic for testing the null hypothesis .
Corollary 4**.**
Let us assume that regularity conditions (C1)–(C8) in Appendix A hold. Let us consider the unconstrained model (2.1) and the null hypothesis in (4.11). Then, under , the asymptotic distribution of the GLR nonparametric test statistic coincides with , where are i.i.d. standard normal variables, are non-zero eigenvalues of and is the rank of .
If the predictor variables are pairwise independent, the GLR nonparametric test statistic follows the chi-square distribution with degrees of freedom under the null hypothesis. The setup of the GLR nonparametric test is similar to the classical ANCOVA when predictors are categorical variables. In ANCOVA predictors are called treatments or blocks, and covariates are modeled parametrically. The goal is to test the treatment or block effect in the design of experiment. So, the GLR test is generalization the classical ANCOVA, where covariates are modeled nonparametrically. Moreover, we do not need to assume that the error distribution is normal.
5 Simulation
In the first part of the simulation, we check the null distribution of the GLR nonparametric test statistic for the hypothesis given in (4.11). Then, we demonstrate the power of the GLR test and compare it with the F-test associated with the nested linear models in the regression analysis. And finally, the performance of the general GLR test for testing in (4.1) under the semiparametric model is presented. All numerical examples in this paper are performed using R software. The R code for the GLR test will be provided on request.
5.1 Null Distribution
Let us consider the nonparametric additive model defined in (2.1), where and . All five random variables in and the first two random variables in are discrete. The number of discrete values taken by and are 3, 4, 5, 4, 3 and 5, 4, respectively, starting from zero with an increment one. The probabilities for each of these variables are generated independently from a uniform (0,1) distribution, and then they are standardized so that the total probabilities become one. We have discarded very low values of probability () to avoid very small or zero frequencies. To make the situation general, we have taken few independent and few dependent variables. and are independent random variables; form a group of dependent variables, but they are independent of and . Similarly, and are two independent groups. The covariance matrices for the dependent groups are also generated randomly. Finally, these parameters are kept fixed throughout the entire simulation. To generate a set of dependent discrete variables, first, a random sample is drawn from a multivariate normal distribution with a fixed covariance matrix, then observations are discretized based on their probabilities. Here, we are interested in testing the null hypothesis . To show the null distribution we have taken for all . For covariates, the functions are taken as
[TABLE]
Notice that these functions are not centered at mean zero. However, it does not violate assumptions of model (2.1) as constants needed to center those functions contribute to the intercept term . The smoother using Nadaraya-Watson estimator (Watson, 1964) is taken to smooth and . We used the default bandwidth parameter for the kernel density as , where is the standard deviation of corresponding variable, and is the sample size. We have taken two different types of error distributions – the standard normal distribution and the chi-square distribution with 5 degrees of freedom. A sample of size 500 from is generated, and this exercise is replicated 1,000 times. The histograms of the observed GLR nonparametric test statistic are presented in Figure 1, and the corresponding kernel density estimates are also plotted. The plots show that the empirical distributions match with the theoretical null distribution obtained from Corollary 4. The plots give an indication of inflated level, but further simulation studies show that the convergence improves as sample size increases. In the same figure, we have plotted the density of the null distribution of the GLR test under independence assumption on the predictors. It is a single chi-square distribution with degrees of freedom . It gives a good approximation of the null distribution. In fact, further simulation studies show that, unless some predictors are strongly correlated, this approximation works reasonably well. In Figures 1(a) and (b) the error distributions are different in two plots, so they demonstrate that the null distribution of the GLR test does not depend on the choice of the error distribution.
5.2 Power Function
In the power calculation for testing , we have taken the same setup of the previous example, except for the distribution of and the corresponding function. Here, we have taken
[TABLE]
and the distribution of is given by where . So, it violates the null hypothesis if . As we compare the power of the GLR test and the classical F-test associated with the nested linear models, the error term is generated from the standard normal distribution to make all results comparable. For each value of , we simulated 500 samples and repeated it 1,000 times to calculate the observed power. The observed power is the proportion of the test statistics greater than the corresponding critical value at 5% level of significance obtained from Corollary 4. In Figure 2(a), the GLR test shows a good power, but the F-test completely fails in this situation. The GLR test is slightly anti-conservative at null, which was also reflected in Figure 1. In the same plot, we presented the observed powers of few other tests including the GLR test under independence assumption, abbreviated as GLR (ind.). Its performance is very similar to the original GLR test although predictors were not pairwise independent. We also plotted the theoretical power function of the GLR test calculated from Corollary 2 under the independence assumption. The observed and the theoretical power functions are very close to each other.
If we fit a linear regression model in this setup, the breakdown situation of the F-test is apparent as the least square estimates of the regression coefficients vanish in the large sample sizes. Conditioning on the other variables the expected value of the least square estimate of the regression coefficient corresponding to turns out to be
[TABLE]
which simplifies to zero for all values of in Equation (5.2) when . Thus, seems to be true for all values of with respect to a linear model, and the power function for the F-test centers around the nominal level of the test. On the other hand, the full additive model successfully captures the nonlinear relationship; and the power of the GLR test tends to one as increases.
In the same plot, we presented the observed power function of the GLR semiparametric test (abbreviated as GLR Semi.) assuming that all covariates are linearly related with (although it is not true), where the predictors are modeled nonparametrically. As the covariates are highly nonlinear, including a function, the semiparametric test breaks down. Notice that the distribution of the GLR test statistic does not change if the covariates are modeled parametrically, so the theoretical critical value of the GLR semiparametric test is same as the GLR nonparametric test, and it is obtained from Corollary 4. The GLR Semi. (ind.) test in Figure 2(a) is the approximation of the GLR semiparametric test under independence assumption on the predictor variables. The performance of these two tests are similar to the F-test. It shows that a wrong model of the covariates may cause severe power loss.
We have investigated few more cases by generating different relationships between and . Figure 2(b) presents power functions where is nonlinear as given in Equation (5.2), but is linear. The functions corresponding to the linear relationships between and are taken simply as for instead of nonlinear functions in Equation (5.1). Here, we get the similar results from the GLR and F-test. The GLR semiparametric test gives almost equal power as described by its theoretical power function derived from Corollary 2. In fact, in this case, the theoretical power of the GLR semiparametric test is same as the GLR nonparametric test. But the advantage of semiparametric modeling is that its finite sample performance is better than the full nonparametric test, if the modeling of the parametric part is correct. For this reason, the nonparametric GLR test is showing slightly inflated level, whereas the GLR semiparametric test properly maintains the level of the test.
In Figure 2(c), we have plotted the power functions when is linear by taking instead of Equation (5.2), but is nonlinear as given in Equation (5.1). Even if the F-test successfully models the relationship between and , its power is almost unchanged as it fails to model the relationship between and . Similarly, the GLR semiparametric test is also showing poor power.
Finally, the power functions of these tests, when both the relationships between and are linear, are plotted in Figure 2(d). Here, all assumptions of the F-test are satisfied, so it is the most powerful among all unbiased tests. It is interesting to notice that the power of all GLR tests are very competitive with the F-test. Therefore, even if the both relationships are linear, we do not expect to lose a significance amount of power by conducting the GLR test. These simulation results show that it is better to use the GLR test unless we are confident of a suitable parametric model. If some assumptions of the parametric model are violated, the F-test may break down. On the other hand, the GLR test produces very high power almost in all situations.
5.3 The Goodness-of-Fit Test
In a similar setup, we have studied the general GLR test including the goodness-of-fit testing problem for the semiparametric model. We test the null hypothesis (4.1) that there exists a linear relationship between and , but there is no effect of other components, i.e., . We did not assume any parametric model for the covariates. In this simulation, we have taken and the same as given in Equation (5.2). So, the null hypothesis is true when , and power of the GLR test should increase as deviates from zero. The other setup for the simulation is same as the previous simulations including the functions for the covariates as given in Equation (5.1). Figure 3(a) shows that the observed and theoretical null distributions are close to each other. The power functions of different tests are given in Figure 3(b). All tests in this plot are semiparametric tests, however, to make similarity with the previous simulation, we denote ‘GLR Semi.’ when all covariates are assumed to be linear. ‘GLR Test’ refers to the main semiparametric test whose null distribution is derived from Theorem 1 without assuming that covariates are linearly modeled. Similarly ‘GLR (ind.)’ is the approximation of this test by assuming that all predictors are pairwise independent. The black dotted line in the plot is the approximate power function derived for Corollary 2 that assumes all predictors are pairwise independent. The main GLR test maintains the nominal level of the test and gives good power when the null hypothesis is not true. GLR (ind.) shows slight inflated power, however, it gives good approximation of the original test. GLR Semi. and GLR Semi. (ind.) fail to produce any significant power as the linearity assumptions on covariates are not satisfied.
As a whole, these simulation results in Section 5 give enough justification for the theoretical results derived in the paper. These GLR tests are simple to calculate and produce a good power. As a virtue of the nonparametric method the tests do not depend on the error distribution of the model. For the model utility test, the GLR test gives better power than the classical F-test when the parametric modeling is not appropriate. And even if the parametric model holds good, the GLR test produces a comparative power. The GLR test can be further simplified if we assume that the predictors are pairwise independent. In this case, the test is slightly anti-conservative, but overall the approximation is good unless some predictors are strongly correlated.
6 Real Data Example
In this section, we apply the GLR test to analyze the diamonds data-set used in Wickham (2009). This data-set contains the price (in 2008 US dollars) and other attributes of 53,940 diamonds. The attributes include the four C’s of diamond quality – cut, color, clarity and carat. There are three main physical measurements , and – the largest length, width, and height of a diamond, respectively. The data-set has other two physical measurements - depth and table, but we have not included them in this analysis as they are functions of , and . Carat is a unit of mass used for measuring gemstones and pearls. Cut is an objective measure of a diamond’s light performance what we generally think of as sparkle. Cut, color and clarity are categorical variables, and other variables are continuous. There are five categories of cut - Fair, Good, Very Good, Premium and Ideal; and the percentage of each diamonds in this data-set are 2.98, 9.10, 22.30, 25.57 and 39.95, respectively. Color has seven categories D (best) to J (worst) with 12.56%, 18.16%, 17.69%, 20.93%, 15.40%, 10.05% and 5.21%, respectively. Clarity contains eight categories I1 (worst), SI2, SI1, VS2, VS1, VVS2, VVS1 and IF (best) with 1.37%, 17.04%, 24.22%, 22.73%, 15.15%, 9.39%, 6.77% and 3.32%, respectively.
As cut, color and clarity are categorical variables, we apply the GLR test for testing their effect in diamond price, whereas carat, , and serve as covariates. The sample size is huge, so a slight deviation from a null hypothesis may cause rejection of the null hypothesis. For this reason, we have taken a random sub-sample of 1,000 observations from the data-set At first, we test the null hypothesis (4.11) that there is no effect of cut, color and clarity. So, . The -value of the GLR test comes out to be zero. Then, we have conducted three different tests to check the main effect of cut, color and clarity, separately, by taking others as covariates (for example, ). Even in these cases -values of the GLR tests are for cut and zero for color and clarity. This is not surprising as there is a strong effect of cut, color and clarity in the price of diamonds.
All categorical variables, cut, color and clarity, maintain an order in their quality. So, in the next step, we have conducted some goodness-of-fit tests to know the effect of different levels of those variables. We are particularly interested to know whether there is any specific pattern in the order of different levels of a category. The levels are ranked according to the increasing order of quality. In our first goodness-of-fit test, we have taken the order of cut as a single predictor () and six other variables including the ranks of color and clarity as covariates (). We tested the null hypothesis that the diamond price is linear with the rank of the levels of cut. The -value of the GLR test is 0.5476. This indicates that the diamond price may be modeled as a linear function of the rank of its cutting quality. The box plots in Figure 4(a) show the partial effect of cut after eliminating the effects of other variables. The middlemost line of median in the box plot is replaced by the corresponding mean, so it gives the mean effect of cut for that category. The red line in the plot is the least square regression line of the price difference on the rank of the cut effect. The plot also shows that the ranks in cut maintain a proper linear relationship in modeling the diamond price.
In the second semiparametric test, we checked the linearity effect of the rank of color in diamond price. The GLR test gave a -value of , so we considered a quadratic model for the rank of color. The -value of the test came out to be 0.0857, so the quadratic effect of color is not rejected at 5% level of significance (see Figure 4(b)). Similarly, the -values of corresponding to the linear, quadratic and cubic models of the rank of clarity are , 0.0412 and 0.4233, respectively. So, the effect of clarity in diamond price may be modeled as a cubic function of its rank (see Figure 4(c)).
Finally, we have constructed a semiparametric model where the ranks of cut, color and clarity were taken as linear, quadratic and cubic functions, respectively. Carat, , and serve as covariates for this test, and they are modeled nonparametrically. So, according to our notations and . The GLR test (4.8) for the goodness-of-fit of the model gave a -value of 0.1104 for this semiparametric model. Figure 4(d) displays the scatter plot of the original price of diamonds and their fitted price from the semiparametric model; the correlation between the two prices is 0.9632. The points in the plot cluster around the red line which represents the perfect fit. These results indicate that if we build a semiparametric model for this data the appropriate choices of the additive components for the rank of cut, color and clarity are a linear, quadratic and cubic functions, respectively.
The estimate of the overall mean price for the data-set is , and the standard deviation is . Let us consider an additive model as where being the additive effects of the rank of cut, color, clarity, carat, , and , respectively. Then, the parametric parts of the fitted semiparametric model are given by
[TABLE]
7 Discussion
In an additive model, a novel method is derived for testing the main effect of the predictor variables which take discrete or categorical values. The main effect is adjusted by covariates possibly containing continuous valued random variables. The predictors and covariates are modeled nonparametrically using an additive model, so the test avoids loss of power due to model misspecification often arises in classical parametric tests. This method is further extended to the semiparametric model, and a goodness-of-fit test is derived. The simulation results show that the GLR test may outperform the parametric test when the model for just one of the components fails; and at the same time, it produces a comparable power as the conventional tests if the assumed parametric model holds good. The power of the GLR test is asymptotically optimal in terms of the rate of convergence, and it can detect a specific class of contiguous alternatives at a rate of . In case of categorical predictors the GLR test generalizes the classical ANCOVA by modeling covariates nonparametrically and without assuming normality of the error term. So, it is a development of the basic statistical theory, and the methodology can be widely useful in practice.
Appendix A: Regularity Conditions
To derive the asymptotic distribution of the GLR test statistic, we need the following assumptions:
- (C1)
Suppose , then for all and , where . 2. (C2)
The kernel function is bounded and Lipschitz-continuous with a bounded support. 3. (C3)
If is continuous, then the density of is Lipschitz-continuous and bounded away from 0 and has bounded supports for . 4. (C4)
If both and are continuous, then the joint density of and is Lipschitz-continuous on its support for . 5. (C5)
as and for . 6. (C6)
If is continuous and be the degree of the polynomial used for smoothing of , then the -th derivative of , for , exist and is bounded and continuous. 7. (C7)
. 8. (C8)
for all , and .
Acknowledgements: The author very much appreciates Kuchibhotla Arun Kumar for carefully reading the paper including all proofs and providing helpful comments and suggestions.
Appendix B: Backfitting Estimators
Let us define for , and for . The additive components, , are estimated using the backfitting estimators. The first step is to select a suitable smoothing matrix for , where is the estimator of , and is the residual of given other additive components. This step is then repeated until convergence of all additive components (Hastie and Tibshirani, 1990). As contains categorical or discrete valued random variables, the bin smoother at a point mass is appropriate. Suppose, for , there are observations at , where , . If the observations are sorted according to the values of , then the smoothing matrix for is given by
[TABLE]
where is a matrix with elements 1, and is a matrix with elements 0. It essentially means that is constructed such a way that is the partial mean of , where for and .
The covariate may contain any type of random variable – categorical, discrete or continuous. If some components of are categorical or discrete, then we use bin smoother again. Otherwise, for continuous valued covariates, one may choose a smoother that uses local polynomials. For the simplicity of notation, we assume that all covariates are continuous. In fact, the situation is even simpler for categorical or discrete covariates. Let be the degree of the polynomial used for smoothing of for . Note that Nadaraya-Watson estimate (Watson, 1964) is a trivial case of the polynomial smoothing where the degree of the polynomial is zero. Suppose is the kernel function, and denote , where is the bandwidth parameter. Then, the smoothing matrix of is given by
[TABLE]
where is a diagonal matrix containing the kernel weight, and
[TABLE]
Then, the normal equations for the backfitting estimators (Buja et al, 1989, Opsomer and Ruppert, 1998) are given by
[TABLE]
where is the centered smoothing matrix for , and is the -dimensional vector of elements 1. The solution to the normal equations has the form
[TABLE]
provided the inverse exists. Here, and are the associated matrices. So, the backfitting estimator of is given by
[TABLE]
where , and is a block matrix of dimension with identity matrix in the -th block and zero elsewhere.
Let us denote . Suppose is the smoother matrix for the additive model after dropping out the term containing . Then, the following lemma from Opsomer (2000) ensures the existence and uniqueness of the backfitting estimators of the additive model.
Lemma 1**.**
If for some , where denotes any matrix norm, then the backfitting estimators uniquely exist and
[TABLE]
Appendix C: Proofs
Lemma 2**.**
Let us assume that conditions (C2)–(C5) hold, then
[TABLE]
for all . The term means that each element is of order .
Proof.
This property is proved in Opsomer and Ruppert (1997) using a local polynomial fitting where the smoothing matrix is as defined in (A.2). This is also true for the point mass bin smoother as
[TABLE]
Note that for the relationship is exact, and we do not need any assumption for this. ∎
Lemma 3**.**
If the predictors and covariates are pairwise independent then, under conditions (C1)–(C6), we have
[TABLE]
for all .
Proof.
Using equation (A.9) for and , we get
[TABLE]
Note that for . For , we define . Here is a block matrix containing each element in the -th block equal to
[TABLE]
where and . Using strong law of large numbers (SLLN) and assumption (C1), we get
[TABLE]
Combining equations (A.11) and (A.13) the -th element of becomes
[TABLE]
So, the lemma is proved for . For Opsomer and Ruppert (1997) have shown that under conditions (C2)–(C6)
[TABLE]
where is the joint distribution of and , whereas and are their marginal distributions. So, the lemma is true for . Now, using condition (C8) and applying the same technique, we can prove this result when , and , or vise versa. ∎
Lemma 4**.**
Let us denote , where is given in equation (A.6). Then, under conditions (C1)–(C6)
[TABLE]
where .
Proof.
For , we get
[TABLE]
From equation (A.7), we have
[TABLE]
Using Lemma 3, we have the following approximation
[TABLE]
This approximation is exact when the corresponding predictors or covariates are pairwise independent. Combining equations (A.18) and (A.19), we get
[TABLE]
Similarly Now, for all values of and , we prove by recursion that
[TABLE]
Therefore, by taking summation over the lemma is proved. ∎
Lemma 5**.**
Suppose conditions (C1)–(C4) and (C8) are satisfied. Then, under ,
[TABLE]
for all , where .
Proof.
Note that
[TABLE]
For and we define . Then
[TABLE]
Using strong law of large numbers (SLLN) and assumption (C8) we get
[TABLE]
So
[TABLE]
Hence, under , for all
[TABLE]
Again using SLLN we get
[TABLE]
for all . Similarly, a.s. for all . Hence using Lemma 2 the lemma is proved from equation (A.27). ∎
Lemma 6**.**
Denote , then under conditions (C1)–(C6)
[TABLE]
where .
Proof.
Using Lemma 4, we get
[TABLE]
∎
Corollary 4.
Denote , where is the smoother matrix for the additive model after dropping all predictors. Using an argument similar to that in the proof of Lemma 6, we find
[TABLE]
where . So
[TABLE]
. Now and for . From the technique used in Lemma 3, it can be shown that is a symmetric matrix. So, using Lemma 3 equation (A.32) reduces to
[TABLE]
Now
[TABLE]
Let us define . Then
[TABLE]
Using Lemma 5, under , we have
[TABLE]
Moreover, using (A.26) it is easy to show that, under , for all . Hence, from (A.35), we get
[TABLE]
Now, for , using the definition in (A.1), we have
[TABLE]
where is a vector with elements one and rest are zero. If , then the -th element of is one. Note that in this definition, we did not sort according to their observed values. As under condition (C7), using central limit theorem (CLT), we get
[TABLE]
As and are independent for all , the components of are i.i.d. standard normal variables. Therefore, from (A.38), we have Let us define
[TABLE]
Then a.s., where . Note that . Hence
[TABLE]
because is an idempotent matrix of rank . If all predictors are pairwise independent, then from Lemma 3, we get
[TABLE]
for . So, and are asymptotically independent for all (see p. 84 of Bapat, 2012). Therefore, if the predictors are pairwise independent, then under , equation (A.37) gives
[TABLE]
However, in general, the above distribution comes out to be a sum of dependent chi-square variables as
[TABLE]
Suppose , and , then the correlation between and is given by
[TABLE]
The last expression is derived using the same techniques as used in equation (A.13). Note that combining equations (A.44) and (A.45), we obtain result (A.43) if the predictor variables are independent.
Now, it is easy to show that
[TABLE]
Therefore, using Slutsky’s theorem, in (A.44) may be replaced by , and therefore
[TABLE]
Define , and , where is defined in Section 4.4. As is an idempotent matrix, in equation (A.47) is written as
[TABLE]
Now, the covariance matrix of is (defined in Section 4.4), which is a block matrix with -th diagonal block is an identity matrix of order , and the -th element of the -th off-diagonal block is given in (A.45). So, the covariance matrix of is . Let are non-zero eigenvalues of , where is the rank of . Suppose is a vector of i.i.d. standard normal variables, and . Then, from (A.48), the theorem is proved as
[TABLE]
∎
Theorem 3**.**
Let us consider the notations and assumptions of Corollary 4. Then, under , the asymptotic distribution of the GLR test statistic coincides with , where .
Proof.
If is not true, then from (A.35), we get
[TABLE]
Now, the result in equation (A.44) reduces to
[TABLE]
From the proof of Lemma 5, we have
[TABLE]
Using , we get for all . Hence
[TABLE]
Suppose is the -th element of for some . Then
[TABLE]
Note that
[TABLE]
So, using condition (C1), we get from equation (A.54)
[TABLE]
Hence, from equation (A.52), we get
[TABLE]
Therefore
[TABLE]
As for all , we get
[TABLE]
Combining (A.46), (A.50), (A.51) and (A.59) the theorem is proved. ∎
Corollary 3.
The residual sum of squares under can be written as
[TABLE]
where
[TABLE]
Using Lemma 4 it can be shown that
[TABLE]
Hence
[TABLE]
Therefore, equation (A.61) reduces to
[TABLE]
As is an idempotent matrix, using (A.62) and (A.64) we get from equation (A.60)
[TABLE]
Suppose is the true value of under . So, under , the model can be written as
[TABLE]
where . Opsomer and Ruppert (1999) have shown that is a consistent estimator of . Hence, under , from equation (A.62) we get
[TABLE]
Using a similar technique of equation (A.26) it can be shown that
[TABLE]
So, combining (A.67) and (A.68) we get
[TABLE]
Hence, equation (A.65) simplifies to
[TABLE]
Now, proceeding the same way as the proof of Corollary 4, we get
[TABLE]
Using equations (A.23) and (A.69) we get
[TABLE]
Combining equations (A.34) and (A.35) we get
[TABLE]
Using CLT it is easy to establish that . From equation (A.58), we have . Then, equation (A.73) turns out to be
[TABLE]
Note that
[TABLE]
Using condition (C8) and equation (A.69) it can be shown that the second and the forth terms in equation (A.75) tend to zero in probability; and by CLT the third and the fifth terms is asymptotically zero. Therefore
[TABLE]
As , we get from the above equation
[TABLE]
Combining (A.74) and (LABEL:yxy), we get from (A.72)
[TABLE]
where and is defined in (3.3). It can be shown that
[TABLE]
where . So may be regarded as the hat matrix in context of the classical regression in fitting of a degree polynomial. Equation (A.79) shows that columns of the matrix form an orthogonal basis for the column space of . Similarly, columns of form an orthogonal basis for the column space of . Using some matrix calculations it can be shown that
[TABLE]
where . Now is an idempotent matrix with rank . Hence
[TABLE]
where
[TABLE]
So components of are i.i.d. standard normal variables. From equation (A.78), we get
[TABLE]
where
[TABLE]
Rest of the proof is done using the same technique as the proof of Corollary 4. ∎
Theorem 1.
In this case, we can show that
[TABLE]
where . Hence, the proof of the theorem follows from Corollaries 3 and 4. ∎
Theorem 2.
Combining steps of Theorems 1 and 3, we get the proof of the current theorem. ∎
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Bapat (2012) Bapat RB (2012) Linear algebra and linear models. Springer Science & Business Media
- 2Buja et al (1989) Buja A, Hastie T, Tibshirani R (1989) Linear smoothers and additive models. Ann Statist 17(2):453–555
- 3Davies (1980) Davies RB (1980) The distribution of a linear combination of χ 2 superscript 𝜒 2 \chi^{2} random variables. Algorithm AS 155. Appl Statist 29:323–333
- 4Fan and Jiang (2005) Fan J, Jiang J (2005) Nonparametric inferences for additive models. J Amer Statist Assoc 100(471):890–907
- 5Fan et al (2001) Fan J, Zhang C, Zhang J (2001) Generalized likelihood ratio statistics and Wilks phenomenon. Ann Statist 29(1):153–193
- 6Friedman and Stuetzle (1981) Friedman JH, Stuetzle W (1981) Projection pursuit regression. J Amer Statist Assoc 76(376):817–823
- 7Hall and Marron (1988) Hall P, Marron JS (1988) Variable window width kernel estimates of probability densities. Probab Theory Related Fields 80(1):37–49
- 8Hastie and Tibshirani (2000) Hastie T, Tibshirani R (2000) Bayesian backfitting (with discussion). Statist Sci 15(3):196–223, with comments and a rejoinder by the authors
