Journal of Machine Learning Research 1 (2013) 1-60

Submitted 12/13; Published 00/00

Predictive Interval Models for Non-parametric Regression Mohammad Ghasemi Hamed

[email protected]

ENAC, MAIAA, F-31055 Toulouse, France

Mathieu Serrurier

[email protected]

IRIT - Universit´e Paul Sabatier Univ. de Toulouse, IRIT, F-31400 Toulouse, France

Nicolas Durand

[email protected]

IRIT - Universit´e Paul Sabatier ENAC, MAIAA, F-31055 Toulouse, France

Editor:

Abstract Having a regression model, we are interested in finding two-sided intervals that are guaranteed to contain at least a desired proportion of the conditional distribution of the response variable given a specific combination of predictors. We name such intervals predictive intervals. This work presents a new method to find two-sided predictive intervals for non-parametric least squares regression without the homoscedasticity assumption. Our predictive intervals are built by using tolerance intervals on prediction errors in the query point’s neighborhood. We proposed a predictive interval model test and we also used it as a constraint in our hyper-parameter tuning algorithm. This gives an algorithm that finds the smallest reliable predictive intervals for a given dataset. We also introduce a measure for comparing different interval prediction methods yielding intervals having different size and coverage. These experiments show that our methods are more reliable, effective and precise than other interval prediction methods. Keywords: Interval prediction, tolerance intervals, predictive intervals, local linear regression

1. Introduction Regression analysis is a statistical technique for estimating the value of one variable as a function of independent variables. They are widely applied in science and engineering, they are used in problems like function estimation, financial forecasting, and time series prediction. In the general form a regression equation has three variables: the response variable Y (x) , a function f (x) and a random error ε, where Y (x) = f (x) + ε. There are different kinds of regression techniques which estimate different characteristics of the conditional distribution of the response variable Y (x). The most common approaches estimate the mean of the random variable Y (x) and are usually known as least-squares techniques. Robust regression approaches are similar to least-squares techniques but they are designed to be c

2013 Mohammad Ghasemi Hamed and Mathieu Serrurier and Nicolas Durand .

Ghasemi Hamed and Serrurier

robust to outliers and violations of the least-squares assumptions. Another kind, called quantile regression, estimates the conditional quantiles of the response variable. In each category, the regression function can be estimated with a parametric linear, a parametric non-linear or a non-parametric method. This results in linear, non-linear or non-parametric regression models. Interval prediction is an important part of every regression modeling procedure because regression models are always built with finite sample sizes. Thus the predicted mean or quantile is an estimate of the true unknown conditional mean or quantile of the random variable Y (x). Therefore while dealing with finite size datasets, we need to make some statistical inferences. There are currently many interval prediction methods for the regression context, however each interval has its own specific interpretation and application. In this work we are interested in finding two-sided prediction intervals in regression models which contain, with a high confidence level, at least a desired proportion of the conditional response variable. Such intervals are mostly used in application demanding a high level of confidence, like quality control, environmental monitoring, industrial hygiene, exposure data analysis, aircraft trajectory prediction, security systems etc. We divide interval prediction approaches in regression into two main categories: The first category methods are based on the estimated conditional mean. These methods are usually based on least-squares models and propose interval prediction techniques that are centered on the estimation of the mean regression function. These approaches generally assume a non-biased regression model with a Gaussian error having constant variance. On the other hand we have quantile regression methods which directly estimate these intervals. Quantile regression methods are more robust to outliers and have less assumptions than the least-squares approaches. But they suffer from other weaknesses like slower speed of convergence and the crossing quantile effect (two different quantiles may cross or overlap each other). One of our contributions is the review and the comparison of different least-squares and quantile regression techniques used to find intervals which contain a desired proportion of the response variable. We take advantage of this work to address common misunderstood questions about interval prediction methods in the machine learning community. We explain their applications and review their drawbacks. As pointed out at the beginning paragraph, we are interested in finding intervals in regression models which contain, with a high confidence level, at least a desired proportion of the conditional response variable. For that purpose, we introduce a new type of interval prediction method named “predictive interval methods”. A predictive interval model is guaranteed to contain for any query point x, at least a desired proportion of the conditional distribution of the response variable. Such models can be obtained with tolerance intervals for regression or confidence interval on quantile regression, but these concepts have limited applications in the literature. So we propose tolerance intervals for Local Linear Regression (LLR). Then we use the tolerance intervals for LLR to obtain predictive interval models for LLR. Our predictive interval models are applied for two-sided interval prediction, however one can easily extend them to a one-sided interval prediction context. Then, we introduce a statistical test to check if an “interval prediction model” is a “predictive interval model”. In the same context, we 2

Predictive Interval Models for Non-parametric Regression

introduce two measures for ranking interval prediction models. These measures rate the efficiency and the tightness of the obtained envelope. Our predictive interval methods are based on LLR and give variable size intervals. We assume that the mean regression function is locally linear and that the prediction error is locally homoscedastic (heterocedastic in general). Our method does not neglect the regression bias and finds intervals that work properly with biased regression models. The proposed predictive intervals are based on the Leave-One-Out (LOO) or 10-fold cross-validation prediction errors of the local linear regression.

In order to validate our methods, we use several regression datasets to compare our predictive interval method for local linear regression with other interval prediction methods. The selected methods will be tested on their capacity to provide two-sided β-content predictive interval models. The models are compared by their reliability, efficiency, precision and the tightness of their obtained envelope. We also take advantage of our evaluation chapter to show that the conventional interval prediction method is not appropriate for high confidence interval prediction. It is almost always less efficient than our predictive interval methods and their envelope is almost always larger than the envelope obtained by our methods. Ghasemi Hamed et al. (2012) proposed a K-Nearest Neighbors (KNN) based interval prediction method which finds intervals that guarantee to contain, simultaneously for all instances in the predictor space, at least a proportion β of the conditional distribution of the response value. They called it simultaneous interval regression for KNN and they stated that, their method is similar to simultaneous tolerance intervals for KNN regression with a high confidence level. Their work differs from our contribution in at least three points: first, we do not look for models that guarantee the simultaneous condition. Our models could be obtained by tolerance intervals for regression and not simultaneous tolerance intervals for regression. The difference between these concepts is explained in Section 3. Second, our methods are based on LLR and use local distribution of the prediction error instead of local distribution of the conditional response variable. Third, we propose a test and two interval comparison measures to obtain and compare our models.

This paper is organized as follows: Section 2 is a background on regression and tolerance interval for least squares regression. Section 3 describes the state of the art in for interval prediction in regression. Section 4 introduces two efficiency measures which can be used to compare different interval prediction models. Section 5 introduces the concept of predictive interval models. Section 6 proposes a methods to obtain tolerance intervals for LLR under the Local Homoscedastic Normal Prediction Error (LHNPE) conditions. Section 7 describes how to use the tolerance intervals for LLR to find predictive interval models for LLR. Chapter 8 use experiments to compares our methods with other least squares and quantile regression method on nine benchmark datasets and the final section is a discussion with concluding remarks. 3

Ghasemi Hamed and Serrurier

2. Background 2.1

Context and Notation

We choose a fixed regression design where dataset S = (x1 , Y (x1 )), · · · , (xn , Y (xn )) is a random sample. The xi ’s are vectors of observations and Y (xi ) are random variables. These distributions are continuous probability distributions. We always suppose that there is one true mean regression function f (·) with a zero mean error and an unknown variance σ 2 . The most practical assumption is the Gaussian homoscedastic error, but it is not mandatory. S is a finite random sample, so the estimated regression model finds a pair of (fˆ, σ ˆ ); fˆ denotes the estimated regression function and σ ˆ is the estimated error standard deviation. This pair is a random vector in the probability space of regression models defined for the underlying regression type (for ex: Ordinary Least Squares (OLS)). Note that in the case of error being not normally distributed, the pair (fˆ, σ ˆ ) does not correctly represent the estimated regression model. Thus we will use the symbol PS instead of Pfˆ,ˆσ to refer to a probability distribution where the random vector is the estimated regression model based on the random sample S. We also use the following notation: • S = (x1 , Y (x1 )), · · · , (xn , Y (xn )): the random sample of regression, the training set; • f (·): the true and unknown regression function; • f (x): the conditional mean of the response variable for specified combination of the predictors; • fˆ(·): the estimated regression function; • fˆ(x): the estimated regression function at point x; • ε: the error variable; • εpred : the prediction error at point x, εpred = Y (x) − fˆ(x); x x • σ 2 : the true and unknown variance of the error variable; • σ ˆ 2 : the estimated variance of the error variable; • σf2ˆ(x) : the variance of the estimated regression function at point x; • x∗ : a point in the predictor space that does not exists in the training set; • Y (x): the conditional response variable for a given combination of the predictors, Y (x) = f (x) + ε; • Yi : the ith random response variable, Yi = Y (xi ); • yi : an observation of the random variable Yi ; • I(x)Tγ,β : β-content γ-coverage tolerance interval for the distribution of the response variable at point x; 4

Predictive Interval Models for Non-parametric Regression

• I(εpred )Tγ,β : β-content γ-coverage tolerance interval for the distribution of the predicx tion error at point x; • I(x)Pβ : β-content predictive interval for the distribution of Y (x); • I(εpred )Pβ : β-content predictive interval for the distribution of the prediction error at x point x; • Zp : the p-quantile of a standard normal distribution; • χ2p,n : the p-quantile of a chi-square distribution with n degrees of freedom. Note that, in this work we suppose that the prediction error for any point xi , is obtained with εpred = Y (xi ) − fˆ(xi ), where the mean estimate fˆ(xi ) does not use the xi observation (xi , yi ). 2.2

Least-squares Regression

Regression analysis is a statistical technique for estimating the value of one variable as a function of independent variables. In fixed design regression, there are n pairs of observations (x1 , Y1 ), · · · , (xn , Yn ), where xi is the vector of observations known as covariates and Yi is the response variable. In other words, the random variable Yi or Y (xi ) follows a mean function f (xi ) with a random error term εi defined as: Yi = f (xi ) + εi , where E(εi ) = 0.

(1)

The model assumes that εi are mutually independent and identically distributed (iid) random variables. The goal is to estimate the mean function f (·) by fˆ(·), being as close as possible to the unknown function f (·). The usual assumption is to suppose that the variance of the error is the same everywhere. This is known as homoscedasticity and the opposite hypothesis (variable error variance) is known as heteroscedasticity. In a least squares regression, the idea is to estimate the mean of Y (x) by fˆ(x) and based on some assumptions it results in finding the function that minimizes the Mean Squared Error (MSE), i.e. finding fˆ(·) that minimizes: n

M SE(f ) =

1X (yi − fˆ(xi ))2 . n i=1

If we have a homoscedastic error, the average risk of the regression estimator plus a constant value is equal to MSE. So in small to medium size datasets, leave-one-out or 10fold cross validation MSE are well-known estimators of the risk function. For more details on the risk, see Appendix B. 2.3

Local regression methods

Local Polynomial Regression (LPR) assumes that the unknown function f (·) can be locally approximated by a low degree polynomial. Local Polynomial Regression (LPR) fits a low degree polynomial model in the neighborhood (xi ) of the point x. The estimated vector of 5

Ghasemi Hamed and Serrurier

parameters used in the fitted LPR is the vector that minimizes a locally weighted sum of squares. Thus for each x a new polynomial is fitted to its neighborhood and the response value is estimated by evaluating the fitted local polynomial with the vector x as covariate. In general the polynomial degree (d) is 1 or 2; for d = 0, LPR becomes a kernel regression and when d = 1 it changes to LLR.

2.3.1

Definition of Local Polynomial Regression (LPR)

Suppose that the regression function f (·) at the point x can be approximated locally for z inside a neighborhood of x. The idea is to write the Taylor’s expansion for z inside a neighborhood of x as follows Fan and Gijbels (1996):

f (z) =

d X f j (x) j=0

j!

j

(z − x) ≡

d X

βj (z − x)j .

(2)

j=0

Equation (2) models the regression function by a polynomial function. Thus, for every observation z in the neighborhood of x, we write (2) and estimate the vector βx = (βx,0 , · · · , βx,d )T by the vector of parameters βˆx = (βˆx,0 , · · · , βˆx,d )T which minimizes the locally weighted sum of squares defined in Equation (3), and where Kb (·) represents a kernel function with bandwidth b. In fact, estimating f (x) for the random design as well as for the fixed design results in the locally weighted polynomial regression expressed by the equation below Fan and Gijbels (1996): βˆx = Argmin

n X

2 d X j Kb (xi − x) Yi − βx,j (xi − x)

β∈R(d+1) i=1

(3)

j=0

ˆ , · · · , βx,d ˆ )T . So the local polynomial estimation for point x is computed where βˆx = (βx,0 as follows: n X fˆ(x) = ai (x)Yi , (4) i=1

where a(x) = I1T βˆx and I1T = (1, 0, · · · , 0). Kernel functions K(·) are used to weight the observations. They are chosen so that observations closer to the fitting point x have bigger weights and those far from x have smaller weights. If K(·) is a kernel, then Kb (·) is also a kernel function. 1 u Kb (u) = K( ), where b > 0. b b Here, b, known as the bandwidth, is a constant scalar value used to select an appropriate scale for the data. In this article, we use the following kernel: 1 D(u) Kb (u) = K , b b 6

(5)

Predictive Interval Models for Non-parametric Regression

where D(·) is a distance function like the L2 -norm. Some authors including Cleveland (1979) and Cleveland and Devlin (1988), took the K-nearest neighbors of x as its neighborhood. In this case, for each x, b = Dk (x), where Dk (x) is the distance from the K-th nearest neighbors (the farthest neighbor) from the point x. For a detailed discussion see Atkeson et al. (1997). 2.3.2

Bandwidth Selection

A popular bandwidth selection method is the LOO technique suggested in Stone (1977) Stone (1977) which chooses the following bandwidth b:

b = Argmin

n X

(yi − fˆ−i (xi ))2 ,

(6)

i=1

where fˆ−i (xi ) is the estimation without using the ith observation. Estimating the bandwidth by LOO is a time-consuming task, so it is common to minimize the K-fold cross validation score with K = 5 or K = 10; this leads to an approximation of LOO. Plug-in bandwidth is another smoothing strategy which is a formula for the asymptotically optimal bandwidth. The plug-in bandwidth requires several unknown quantities that must be estimated from the data. In section 4.2 of Fan and Gijbels (1996), a plug-in bandwidth for linear weighted local linear regression is defined. One of the required parameters for this estimator is f (·)’s second derivative which is more difficult to estimate than f (·) itself. In this work we use 10-fold cross validation to find the best bandwidth of our dataset. 2.3.3

Loess

Loess was introduced by Cleveland and Delvin Cleveland and Devlin (1988), and is a multivariate version of LOWESS Cleveland (1979), which is another version of LPR. Loess is described by (4), where the polynomial degree is one d = 1 or two d = 2. For the bandwidth selection and weight calculation, loess is similar to KNN. Its weights are calculated with (5) where, u = (xi − x), D(·) is u’s L2 -norm in the predictor space and b is the Euclidean distance between the input vector x and its K th nearest neighbor. The weight function chosen by Cleveland and Delvin Cleveland and Devlin (1988) was the Tricube kernel, however it is not mandatory. In this work, linear loess is the non-parametric smoother function. Therefore, for each input vector x, we use (3), with d = 1, to estimate the vector of parameter βˆx from the training set. As we can see in (7), for each prediction the locally weighted linear regression problem is converted to a Weighted Least Squares (WLS) in which the weights are estimated by a kernel function. βˆx = arg min

n X

wi (yi − xTi β)2 ,

i=1

where wi = Kb (xi − x) ≥ 0 is the weight of the ith observation. 7

(7)

Ghasemi Hamed and Serrurier

2.4

Tolerance intervals

let X = (X1 , · · · , Xn ) denote a random sample from a continuous probability distribution. A tolerance interval is an interval that is guaranteed, with a specified confidence level γ, T sign is used to refer to to contain a specified proportion β of the population. The Iγ,β a β-content γ-coverage tolerance interval Krishnamoorthy and Mathew (2009). Then, we have: T (8) PX P (X ∈ Iγ,β |X) ≥ β = γ. When our sample set (of size n) comes from a univariate normal distribution, the lower and upper tolerance bounds (Xl and Xu , respectively) are are obtained as follows: Xl = θˆ − cˆ σ , Xu = θˆ + cˆ σ v u 2 u (n − 1)(1 + n1 )Z1− 1−β t 2 c= χ21−γ,n−1

(9) (10)

Where θˆ is the sample mean of the distribution, σ ˆ its sample standard deviation, χ21−γ,n−1 represents the 1 − γ quantile of the chi-square distribution with n − 1 degree of freedom and Z 2 1−β is the squared of (1 − 1−β 2 ) quantile of the standard normal distribution Howe 1−

2

(1969). 2.5

Tolerance intervals for least-squares regression

In the case of regression with constant error variance and normal distribution of errors, usually inter-quantiles of a normal distribution with mean zero and variance σ ˆ 2 , (being the error variance estimator) are used as an approximate solution to find intervals that contain a desired proportion of the distribution of the response variable for a given value of dependent variables. For instance, the 0.95 inter-quantile [fˆ(x) − 1.96ˆ σ , fˆ(x) + 1.96ˆ σ ] is often used as the interval containing 95% of the distribution of Y (x) (i.e., as a regression tolerance interval). As shown by Wallis Wallis (1951), this statement is not true since σ ˆ2 and fˆ(x) are only estimations of the true error variance σ 2 and the true mean function at point x, f (x). These estimations are always made on a finite sample and are then pervaded with uncertainty. Tolerance intervals for least squares regression have been introduced in order to take into account this uncertainty. These intervals are described formally by (11). We will refer to such intervals, β-content γ-coverage regression tolerance intervals and they T (x). are denoted by Iγ,β Z

T (x) Uβ,γ

P T (x) Uβ,γ

px (t)dt ≥ β

= γ,

(11)

where Y (x) = f (x) + ε and px (t) denotes the probability density function of Y (x) for a T (x) for Y (x) specified value of the predictor variable x. A two-sided tolerance interval Iγ,β is of the form fˆ(x) ± ρ(x)ˆ σ , where ρ(x) is the tolerance factor to be determined subject to the content β and the desired confidence level γ. Let C(x; fˆ, σ ˆ ) represent the content of this tolerance interval, 8

Predictive Interval Models for Non-parametric Regression

C(x; fˆ, σ ˆ ) = PY (x) fˆ(x) − ρ(x)ˆ σ ≤ Y (x) ≤ fˆ(x) + ρ(x)ˆ σ .

(12)

The tolerance factor ρ(x) satisfies the following condition: ˆ Pfˆ,ˆσ C(x; f , σ ˆ ) ≥ β = γ.

(13)

Equations (11) and (13) could also be expressed as follows: T Pfˆ,ˆσ PY (x) Y (x) ∈ Iγ,β (x) ≥ β = γ,

(14)

T T Iγ,β (x) = [LTβ,γ (x), Uβ,γ (x)] = [fˆ(x) − ρ(x)ˆ σ , fˆ(x) + ρ(x)ˆ σ ].

It is important to observe that tolerance intervals in regression are defined separately T (x ) and for each input vector. Therefore, for two different input vectors x1 and x2 , Iγ,β 1 T (x ) are different and the event Y (x ) ∈ I T (x ) is independent of Y (x ) ∈ I T (x ). Iγ,β 2 1 1 2 γ,β γ,β 2 For more details see Hahn and Meeker (1991) and Krishnamoorthy and Mathew (2009). This intervals has been studied for non-linear parametric in Carroll and Ruppert (1991). They use transformation and/or weighting for the construction of prediction and tolerance intervals for a new response following a non-linear regression fit. Their work addresses the case of normally distributed errors and the non-parametric case in which the error distribution is unknown. But the non-parametric case concerns the error distribution and not the regression fit, and tolerance intervals for non-parametric regression have not, so far, been applied to non-parametric regression.

3. State of the Art of the Interval Prediction Regression models are always built with finite sample size (n < ∞), thus the predicted mean or quantile is an estimate of the true unknown conditional mean or quantile of the random variable Y (x) = f (x) + ε. Therefore while dealing with datasets of finite size, we need to make some statistical inferences. This section reviews and gives a comparison of different least-squares and quantile regression techniques used to find such intervals. Besides, we take advantage of this section to address a misunderstood interval prediction method in the machine learning community. We explain its applications and review its drawbacks. 3.1

Interval Prediction Models

The goal of this paragraph is to emphasize the differences between intervals, interval prediction methods and interval prediction models. An interval prediction method is the procedure required for obtaining an interval. It is just the way to do it but when it is applied to a dataset, we obtain an interval prediction model. For example, a tolerance interval for regression is a type of interval. The method to obtain it in linear models is described in Krishnamoorthy and Mathew (2009) and, when applied to a dataset, the model which gives the tolerance interval for each point in the predictor space is the interval prediction model. 9

Ghasemi Hamed and Serrurier

Definition 1 A regression β-content interval prediction model, built on the random sample S, is function I(·)β from the predictor space Rp to the response variable space R such that: I(·)β : Rp → I, where I = {[a, b]|a, b ∈ R ∪ {−∞, ∞}, a < b}. and, the expected content of the intervals is at least β: ES P Y (x) ∈ I(x)β S ≥ β.

(15)

(16)

Thus when the size of our training set goes to infinity and under certain conditions, a β-content interval prediction model finds intervals that on average contain, at least, a β of the distribution of Y (x). This is a quite broad definition which covers all the interval prediction method for Y (x) and we will use it for such purpose. Our works deals with the regression models, so we omit to mention the regression word and use “interval prediction model” instead of “regression interval prediction model”. Note that test and model selection techniques are always applied to models and not to methods. However when a method is more efficient than its competitors on several datasets or in a general theoretical framework, we can state that this method is more efficient than others. 3.2

Least-Squares Based Interval Prediction

We review briefly some well-known statistical inference techniques applied to least-squares regression models. There is an extensive literature on this topic and the goal of this section is to emphasize that least-squares interval prediction methods are not restricted to large sample techniques. However, there are still some subjects like tolerance intervals and simultaneous intervals that need further study. We will see further that prediction and tolerance intervals have some equivalents in the quantile regression set-up, but confidence band and simultaneous tolerance intervals seem to be restricted to the least-squares world. 3.3

Conventional Interval prediction

One of the most common interval prediction techniques used in practice is to take [fˆ(x) − Z 1−β SSE, fˆ(x) + Z1− 1−β SSE]) as the interval which contains a β proportion of Y (x)’s 2

2

population,where SSE 2 is the average MSE given by a LOO or a 10-fold cross validation scheme. One might assume that the intervals expressed below have similar properties to the regression tolerance interval defined in the next section. ˆ ˆ = β. (17) P Y (x) ∈ f (x) − Z 1−β SSE, f (x) + Z1− 1−β SSE 2

2

We assume that: • the error variance for all x’s is constant (homoscedasticity). • the estimator’s variance σf2ˆ(x) is constant for all x. • fˆ(x) is an unbiased estimator of f (x). 10

Predictive Interval Models for Non-parametric Regression

• the error ε, and fˆ(x), are independent and both have normal distributions. Equation (17) becomes asymptotically valid, but it remains non-applicable for datasets of finite size. For more details on the proof of our statements, refer to Appendix B. Unfortunately, it is a common practice in the Machine Learning community to employ this method for obtaining intervals having the properties of prediction intervals, tolerance intervals or simultaneous tolerance intervals. The conventional interval prediction method has some drawbacks: • First of all, the estimation does not take into account the regression sample size like prediction interval, confidence bands and tolerance intervals. • It just estimates asymptotic global inter-quantile for the conditional response variable. • It supposes that the estimated regression function is non-biased. The problem of finding intervals that satisfy (17) is treated by tolerance for in leastsquares regression. 3.3.1

Inference on the conditional mean f (x)

This part describes interval prediction techniques that obtain intervals that contain with a confidence level the conditional mean at point x. • Point-wise confidence interval for f (x): The confidence interval for the mean regression function Iβpw (x) contains asymptotically, a desired proportion β of the conditional distribution of the estimated mean function fˆ(x) for each combination of predictors H¨ardle (1990). Pfˆ(f (x) ∈ Iβpw (x)) = β.

(18)

• Simultaneous Confidence band for the conditional mean function, for all x ∈ X : this is the idea of γ-confidence band Iγcb (x) for the regression. These intervals [Uγ (x), Lγ (x)] create an envelope around the entire mean regression function f (·) such that, for all x ∈ X , the probability that the true f (x) is contained in the band is simultaneously γ. Pfˆ f (x) ∈

Iγcb (x)

for all x ∈ X

= γ, where Iγcb (x) = [Uγ (x), Lγ (x)]

(19)

where X is the domain of x. 3.3.2

Inference on the response variable Y (x) = f (x) + ε

This part describes interval prediction techniques that obtain intervals that contain a desired proportion of the conditional distribution of the response variable. These methods are closely related to the methods explained just above. • Prediction interval for Y (x) : they are also called expectation tolerance intervals for regression IβP red (x) which contains on average and not at least, a desired proportion 11

Ghasemi Hamed and Serrurier

β of the conditional distribution of the response variable Y (x) for each combination of predictors. They are described by the equation below: P red ˆ = β where Y (x) = f (x) + ε Efˆ,ˆσ P Y (x) ∈ Iβ (x)|fˆ, σ

(20)

For a detailed discussion about the differences between prediction and tolerance intervals, the reader can find more in Paulson (1943); Hahn and Meeker (1991); Krishnamoorthy and Mathew (2009). T (x) are explained • Tolerance interval for regression: tolerance interval for regression Iγ,β in 2.5. The interval contains, with a confidence level γ, at least a desired proportion β of the distribution of Y (x).

• Simultaneous tolerance intervals for regression: β-content γ-coverage simultaneous regression tolerance intervals, described in Krishnamoorthy and Mathew (2009), create an envelope around the entire mean regression function f (·) such that for all x ∈ X , the probability that Y (x) is contained in the envelope is β, and this coverage is guaranteed with a confidence level γ. They are can be described by (12) and (13) where (13) must be replaced by the equation below: ˆ Pfˆ,ˆσ min C(x; f , σ ˆ ) ≥ β = γ. (21) x∈X

Note that tolerance intervals and simultaneous tolerance intervals for least squares regression have been well studied for linear regression but the application of these methods in the non-linear and particularly the non-parametric case are limited in the literature. 3.4

Quantile Regression Based Interval prediction

A quantile regression model can estimate one conditional quantile so one-sided and twosided interval estimation are treated separately. 3.4.1

One-sided interval prediction

• Quantile regression: one-sided intervals obtained by the estimation of the conditional quantile are similar to one-sided prediction intervals in least-squares models. • Confidence intervals on regression quantiles: the obtained one-sided interval contains, with a confidence level γ, at least a desired proportion β of Y (x) Kocherginsky et al. (2005); Koenker (1994). They have so far been studied for linear models, and they are similar to one-sided tolerance intervals for regression explained in 2.5. 3.4.2

Two-sided interval prediction

in order to obtain two-sided (1 − α)-content conditional intervals (β = 1 − α), one must build two distinct quantile regression models: a lower α2 -quantile regression model and an upper (1 − α2 )-quantile regression model. 12

Predictive Interval Models for Non-parametric Regression

• Quantile regression: This is done by a pair of upper and lower quantile regression model. These intervals are estimations and they are similar to two-sided prediction intervals in least-squares models. • Confidence intervals on regression quantiles: These two-sided intervals contain with a γ confidence level, a proportion 1 − α of the Y (x). As noted, we need a pair of ( α2 , 1 − α2 ) quantile regression models but each model now itself needs a one-sided confidence interval on regression quantile. Once we have built the upper and lower quantile regression models, we must obtain a lower (one-sided) (1 − τ2 ) confidence interval on the lower α2 -quantile regression model and an upper (one-sided) (1 − τ2 ) confidence interval on the upper (1 − α2 )-quantile regression model. By applying the Bonferroni inequality, one can merge the pair of (1 − τ2 ) confidence intervals to obtain a joint confidence statement with a probability greater or equal to γ = 1 − τ . More details on this combination can be found in Appendix B. It is important to emphasize that although these intervals are theoretically feasible, there has not been any work, until now, which treats the problem of two-sided interval prediction with one-sided confidence intervals on regression quantiles. Such intervals are similar to two-sided γ-coverage 1 − α-content least-squares tolerance intervals and they are explained in 2.5. As discussed in Koenker (2005), two different quantile regression models may cross or overlap each other, which is called as quantile crossing. Thus two-sided interval prediction is more meaningful by enforcing the non-crossing constraint. However after enforcing this constraint, the conditional quantile estimator may not converge to the true conditional quantile. Thus we have to choose between a “non-correct” or non-convergent estimator.

4. Comparing Interval Prediction Models For a given dataset, we may have several interval prediction models but we need some quality measure to compare them. For this purpose, we define the dataset measures listed below. These measures are then used as building blocks for some graphical charts and plots explained further in this section. The idea is to provide graphical tools which can help us to compare the effectiveness of different interval prediction methods through different datasets. 4.1

Direct Dataset Measures

For each of the datasets the following quality measures can be computed. Note that the βcontent intervals I(xi )β = [L(xi )β , U (xi )β ] must be obtained for observations not contained in the training set S. So for small to medium datasets, we obtain these measures with a cross-validation or a LOO schema. • MIP: Mean Inclusion Percentages: the fraction of the response values that are contained in the β-content interval I(xi )β . M IPβ = n−1

n X i=1

13

V (xi ).

Ghasemi Hamed and Serrurier

where is V (xi ) is defined as: ( 1 if Y (xi ) ∈ I(xi )β , V (xi ) = 0 otherwise. • MIS: Mean of Interval Size. M ISβ = n

−1

n X

size(I(xi )β ).

i=1

• σis : sample standard deviation of interval sizes. σis = n

−1

n X (size(I(xi )β ) − M ISβ )2 , i=1

where size(I(x)β ) = U (xi )β − U (xi )β . In to verify the reliability of an interval prediction method, we introduce the following constraint. Definition 2 Let S be a sample of size n and b(n) be an function of n, a β-interval prediction model is a reliable model if we have: MIP Constraint: M IPβ ≥ b(n).

(22)

This definition will further be used in the next section. 4.2

Composed Dataset Measures

We use the above quality measures to define the following composed measures: 4.2.1

Normalized MIS

Suppose that we want to test c different β-content methods (“M ethod1 ”, “M ethod2 ” ,..., “M ethodc ”) on the dataset S. They give us c distinct models and each model has a Mean of Interval Size (MIS), so we have: M ISS1 , M ISS2 ,..., M ISSc . But depending on the dataset and β’s value, one model may satisfy the MIP constraint or not. For a model that does not satisfy this constraint, we do not compute its normalized MIS. For each model its normalized MIS is equal to the ratio of its MIS to the maximum MIS on this dataset normalizedM ISSi =

M ISSi . max (M ISSi )

i∈(1,··· ,c)

If we have : m1 m2 M ISSm1 ≥ M ISSm2 and M IPS,β ≥ b(n) and M IPS,β ≥ b(n)

⇔ m1 provides a wider reliable envelope than m2 . 14

Predictive Interval Models for Non-parametric Regression

M2 is better than m1 because it satisfies the MIP constraint and it also gives the smallest normalized MIS value. Choosing the ratio to the maximum MIS value rescales the MIS value between 0 and 1 and lets us compare the strength of methods across different datasets. However we can not use the normalized MIS to compare two models (constructed on the same dataset) that obtain different MIP values but have equal or approximately equal MIS values. In this case, we have to compare them by their Equivalent Gaussian Standard Deviation, explained below. 4.2.2

Equivalent Gaussian Standard Deviation (EGSD)

If we have two reliable models (constructed on the same dataset) having different MIP values but approximately equal MIS values, we normally choose the one that gives the higher MIP. But the situation can get more complicated for models (constructed on the same dataset) with different MIS values and different MIP values. EGSD is a measure which can be used to compare interval prediction models, constructed on the same dataset, which have different MIP values. Such models can have different or equal MIS values. Let m be a β-content m . The idea interval prediction model built on the dataset S, yielding M ISSm and M IPS,β behind EGSD is to find the Equivalent Gaussian Distribution (EGD) for successful predicted intervals of m. We have seen that by taking intervals size on average equal to M ISSm , that m of the observations will be contained in their prediction interval. So EGD is the M IPS,β distribution of the size of predicted intervals obtained by model m1 that correctly contains their response variable. Therefore the EGD which has the smallest variance corresponds to the most efficient model. The Equivalent Gaussian Distribution for m is the normal distribution θ-content inter-quantile size of which will be equal to M ISSm . We have: θ = m . So the Equivalent Gaussian Standard Deviation of m is calculated by: M IPS,β EGSDSm =

M ISSm m , α = 1 − β. , where θ = M IPS,β 2Z1− α2 θ

Now by using each model’s EGSD, we can compare models with different values of M IP and M IS. EGSD measures the trade-off between average interval size and the fraction of successful predictions. Smaller EGSD values denote more effective interval prediction models. Finally, for the sake of readability, all found EGSD are normalized in each dataset. Thus the final value is the ratio of the method’s EGSDSm to the maximum EGSD value on the underlying dataset: normalizedEGSDSm =

EGSDSm . max (EGSDSi )

i∈(1,··· ,c)

Note that if the model m1 has smaller EGSD than the model m2 , it does not mean m2 ’s envelope is wider than m1 ’s envelope. As seen above smaller normalized MIS values mean smaller envelopes and smaller EGSD values means more effective models. 4.3

Figures

Plots and charts help us to compare different interval prediction methods on different datasets because a figure can visualize complex and big tables. Each plot is dedicated 15

Ghasemi Hamed and Serrurier

to one dataset and it compares dataset measures of different interval prediction methods on the same dataset whereas a chart compares a desired dataset measure for different methods and across different datasets. All the presented plots have the same x axis. This axis is labeled “Nominal MIP”, and it represents distinct values of the desired proportion (distinct β values). On the other hand, each plot type has a different y axis. This axis denotes the underlying dataset measure on the tested interval prediction models. 4.3.1

MIP plot

The MIP plot is similar to the well-known Q-Q plot with the difference that it compares MIP instead of quantiles. The x axis is denoted by “Nominal MIP” and it represents the desired proportion of inclusion (distinct values of β). The y axis is denoted by “Obtained MIP”. It represents the model’s MIP. Each point represents the model’s obtained MIP for its value on the “Nominal MIP” axis. This figure always has two lines: the “MIP constraint 0.05 for different line” and the “Nominal MIP line”. The “MIP constraint line” displays Fβ,n values of nominal MIP, and the “Nominal MIP line” represents the function y = x. By looking at this figure we can see the reliability of a method for different nominal MIP. The first value in the x axis where a line crosses the MIP constraint line will be called its failure MIP. It is obvious that the method having the higher failure MIP is the most reliable one. One can also use the MIP plot to rate the model’s precision. If a model obtains MIP values much higher than the desired nominal MIP, it means that the method is reliable but not precise. For example a model which obtains MIP values of 0.45, 0.9 and 0.99 for respective nominal MIP of 0.25, 0.75 and 0.95 is reliable but not precise. The most precise model is the one having the nearest line to the “Nominal MIP line”. Finally, the best model in this plot is the one which is the most precise and the most reliable. It means that the best model in a MIP plot is the one having the nearest line to the upper side of the “Nominal MIP line”. 4.3.2

EGSD plot

The y axis of an EGSD plot is labeled by “Normalized EGSD Value” and it represents the model’s normalized EGSD value. By looking at this figure, we can compare the efficiency of different models. It is obvious that the model having the highest line is the most inefficient model. We suggest using this plot along with the MIP plot to rate the efficiency of reliable methods. However one may ignore the reliability aspect and take advantage of this plot to compare the efficiency of different models. 4.3.3

MIS plot

The y axis of an EGSD plot labeled “Normalized MIS Value” and it represents the model’s normalized MIS value. By looking at this figure, we can compare the model which obtains the tightest reliable envelope. The model having the highest line provides the widest envelope. If a model does not satisfy the MIP constraint, its normalized MIS value is not computed. The MIS plot shows each model’s normalized MIS until its “failure MIP”. We suggest using this plot along with the EGSD plot. 16

Predictive Interval Models for Non-parametric Regression

4.3.4

Charts

Charts are used to compare one dataset measure on different datasets. We propose the following charts: • Mean Inclusion Percentage Chart (MIP chart): the goal of this chart is to compare the mentioned methods based on their fraction of response values located inside their predicted intervals. It just displays the MIP value and it usually does not contain important information. • MIS ratio chart: this chart displays the normalized MIS measure on different datasets. • Equivalent Gaussian Standard Deviation chart (EGSD chart): it displays the normalized EGSD measure on different datasets.

5. Predictive Interval Framework The goal of this section is to propose a new interval prediction framework. We introduce the concept of regression predictive intervals and regression Predictive Interval Model (PIM). Next, we propose a statistical test to verify if an “interval prediction model” is a “predictive interval model”. In the same context, we introduce two measures for rating interval prediction models. These measures rate the efficiency and the tightness of the obtained envelope. 5.1

Predictive Interval Models (PIMs)

In the frequentist interpretation of confidence intervals, a confidence interval for a parameter contains zero or one parameter. The parameter is fixed and confidence intervals change with different random samples. In the same way, the confidence level (γ) used in tolerance intervals for regression defined in (14) and confidence intervals for regression quantiles (explained in Appendix B) mean the following: the probability that the obtained intervals contain, under re-sampling, at least a proportion β of the conditional distribution of the response value Y (x) is γ. We know that the confidence level in Neyman-Pearson confidence intervals is independent of the observed sample. It means that if we obtain γ-confidence β-content tolerance intervals of an observed sample from a regression function, then the confidence level γ does not induce any posterior probability of including β proportion of the distribution of Y (x). Therefore, the confidence coefficient in frequentist confidence intervals cannot be interpreted as posterior probability. This idea is discussed in detail in Chapter 7 in Walley (1991). Hence, under the frequentist viewpoint of regression, the true conditional response variable’s inter-quantile is included with probability zero or one in the obtained interval (by using tolerance intervals for regression or confidence intervals for regression quantiles). Our goal is to obtain intervals that correctly bracket these inter-quantiles. They can be found in two ways: the first approach takes a very high confidence level like γ ≈ 1 and the second method finds the smallest confidence level 0 < γ0 < 1 which includes the true unknown model. We introduce the concept of predictive intervals which refer to both of these intervals. A predictive interval built on S, is guaranteed to contain for the query point x, 17

Ghasemi Hamed and Serrurier

at least a desired proportion of the conditional distribution of the response variable. It can be obtained with tolerance intervals for regression or confidence intervals for regression quantiles but these concepts have so far only been treated for linear models Definition 3 Let S = {(x1 , Y1 ) · · · , (xn , Yn )} denote a random sample where Yi = f (xi )+εi and εi is white noise. A β-content predictive interval for x, denoted by I(x)Pβ , is an interval such that: P (23) PY (x) Y (x) ∈ I(x)β S ≥ β, where I(x)Pβ = [L(x)Pβ , U (x)Pβ ]. Since we have observed S, I(x)Pβ is no longer random and the probability measure is just related to cover at least a proportion β of the conditional distribution of the response variable Y (x) for a specified combination of the predictors. Definition 4 Let S = {(x1 , Y1 ) · · · , (xn , Yn )} denote a random sample where Yi = f (xi )+εi and εi is white noise. A β-content predictive interval model, denoted by I(·)Pβ , is a function such that: (24) I(·)Pβ : Rp → I, where I = {[a, b]|a, b ∈ R ∪ {−∞, ∞}, a < b}, and for all x in the predictor space, the obtained interval is a β-content predictive interval described by (23). 5.2

Predictive Interval Model Test (PIM Test)

The goal of this part is to develop a statistical test with which we can rate the reliability of any interval prediction model claiming to provide β-content predictive intervals. A predictive interval model must provide predictive intervals for each point in the predictor space. We saw that the distribution of Y (x) changes for each value of x. So, in order to see whether an interval for the regression function at the point x contains at least a proportion β of the s distribution of Y (x), we need (for each combination of predictors x) a sample set from the distribution of Y (x) = f (x) + , and then we can observe if the constructed interval contains a proportion s distribution of the distribution of Y (x). In the same way, in order to verify if the methods works for an entire dataset {xi | ∈ (1, · · · , n)}, we need a distinct sample set for each xi and this sample must be drawn from Y (xi ). Since a sample set is required for each xi , i ∈ (1, · · · , n), the described procedure requires a huge dataset having many observations for each point x in the feature space which makes it impractical or impossible for multiple regression problems. However, we can make some approximations and use the results stated above to derive the following test. We first begin by defining a variable obtaining MIP on the dataset. Then we will see that this variable can be approximated by a normal distribution, so we use the quantiles of the standard normal distribution as the function b(n) used in Equation (22). 5.2.1

Simultaneous Inclusion for Predictive Intervals

A β-content predictive interval I(x)Pβ must contain at least β proportion of the conditional distribution of Y (x). Hence, the probability in (23) is just related to contain at least a proportion β of the conditional distribution of the Y (x). We define the function V (x) as: 18

Predictive Interval Models for Non-parametric Regression

( 1 V (x) = 0

if Y (x) ∈ I(x)Pβ , otherwise.

The above definition means that the probability that V (x) is equal to 1 is β, so V (x) has a Bernoulli distribution with p = β. V (x) ∼ Bernoulli(β).

(25)

Suppose that we have a dataset of ntrain observations T = {(x1 , Y1 ) · · · , (xntrain , Yntrain )} with which we build our model, and nv other observations S = {(xv1 , Y1v ) · · · , (xvnv , Ynvv )}, not contained in the original dataset as our test set. If we apply the function V (·) on the whole test set S and sum the result, we obtain: M IPβ =

n−1 v

nv X

V (xvi ).

(26)

i=1

Therefore, we can deduce that M IPS,β has a Binomial distribution. This is expressed formally by (27) where Binomial(nv , β) is a binomial distribution with n = nv and p = β. nv M IPβ ∼ Binomial(nv , β).

(27)

If nv is sufficiently large, we can assume that M IPβ has a normal distribution as: M IPβ ∼ N (β,

β(1 − β) ). nv

(28)

Thus in a PIM, the fraction of instances having their response value included in their predictive intervals is on average β. This means such predictive intervals for regression have in average a simultaneous content of β so, on average, they are like simultaneous regression tolerance intervals. For small to medium datasets, M IPβ is computed in a cross-validation or leave-one-out schema on the whole dataset which means that S = T .

5.2.2

Testing Predictive Interval Models

As we have seen in (28), the random variable M IPβ can usually be well approximated by a normal distribution. The test below is used to verify, with level α, if the interval prediction method does provide β0 -content predictive intervals for all x in the predictor space. H0 : β ≥ β0 versus H1 : β < β0 ,

(29)

then H0 can be rejected with significance α where: M IPβ < nv−1/2 β0 (1 − β0 )Zα = Fβα0 ,nv ,

(30)

where Zα is the α-quantile of the standard normal distribution. So if (30) is not true, we fail to reject the null hypothesis with significance level α, and accept the underlying model 19

Ghasemi Hamed and Serrurier

as a model providing β-content predictive intervals. In this work we used a significance level of α = 0.05, so for each dataset we compared the M IPβ ’s value on the test set with Fβ0.05 . Thus, any PIM must pass the PIM test as 0 ,nv defined below: . PIM Test: M IPβ ≥ Fβ0.05 0 ,nv

(31)

For the sake of simplicity, we refer to M IPS,β for a given dataset S and desired proportion β as MIP (Mean Inclusion Percentage). As we have seen in (28), the fraction of response values inside their β-content predictive intervals converges to β, so the test defined in (31), where α = 0.05 is used to verify if the obtained intervals, with a confidence level 0.95 and on average and not at least like in simultaneous tolerance internals, do simultaneously contain a proportion β0 of the distribution of Y (x) for all x in the predictor space. Remark The average simultaneous content of PIMs mentioned just above, means that: for a PIM built on the training set T , if we test the PIM with a large number of new observations (x∗i , Y (x∗i ))i∈{1,··· ,nv } , the fraction of the new response values included in their predictive intervals is guaranteed to be β. This is expressed formally in (28). Note that, this is not the same as the average content for any β-content interval prediction models. A β-content interval prediction model built on a specified training set T , is not guaranteed to contain, on average, a β proportion of successful predictions. However, if we have a large number l of β-content interval prediction model I(·)Tj ,β , built on a large number l of training set (Tj )j∈{1,··· ,l} , and we test each I(·)Tj ,β with a large number of unseen instances (x∗i , Y (x∗i ))i∈{1,··· ,nv } . In this case, the expected probability of each βcontent interval I(x∗i )Tj ,β to contain a proportion β of the distribution of Y (x∗i ) is β. This is expressed formally in (16). Thus, having a β-content interval prediction model built on the training set T , if we test the model with large number of training set and new testing observations, the fraction of response value included in their predictive intervals is on average β. An arbitrary β-content interval prediction method needs a large number of training set and new testing observations, or one large training set and a large number of new testing observations, to guarantee an M IPβ equal to β. However a PIM, must guarantee an M IPβ = β with any training set. 5.3

Hyper-parameter Tuning and Model Selection

This part addresses hyper-parameter tuning questions related to predictive interval explained in Section 5.1. We first convert the hyper-parameter tuning problem to an optimization problem. Then, we propose a simple optimization algorithm that takes advantage of existing least-squares regression method to find an efficient model for predicting both the mean and the predictive interval. Finally, we give an application with tolerance intervals for least-square regression. Note that, the dataset S does not change in the hyper-parameter tuning phase, so we do not use it to index our variables. 20

Predictive Interval Models for Non-parametric Regression

5.3.1

The Optimization Problem

Let λ denote the vector of hyper-parameter of the β-content interval prediction method I(·)S,β . The vector λ is divided into two set of elements. The first set is the vector of hyperparameter for the regression method and the second set is specific to the interval prediction method. Our goal is to find the optimal value of λ, for any β-content interval prediction model that is also a β-content predictive interval model (pass the PIM test). This result in the following problem: n

λ0 =

Argmin(M ISβλ ),

where

M ISβλ

1X = I(xi )λβ n

(32)

i=1

Subject to: PIM Tuning Constraint: M IPβλ0 = β

(33)

λ-Specific Constraints: depends on the PIM. Note that the MIP constraint is a hard constraint and there is no trade-off between satisfying this constraint and minimizing the MIS. We found λ0 which satisfies the constraint defined above. This results in intervals having the smallest MIS measure where MIP and MIS are computed based on a leave-one-out or 10-fold cross validation scheme on the training set. 5.3.2

The Optimization Algorithm

We propose the following hyper-parameter tuning method: • First, find the regression model with the smallest prediction error MSE. • Then use an optimization method that finds the λ0 that satisfies the tuning constraint and also results in intervals having the smallest MIS measure on the previously found regression model. • Note that the space of λ in the second step is restricted to λ values that have their regression hyper-parameter equal to the hyper-parameter of the regression model found in the first step. This process divide the optimization in two phase, the hyper-parameter of the regression method tuning and the hyper-parameter tuning of the interval prediction method. In order to obtain the smallest intervals (measured by MIS), we need the smallest values of prediction errors. So, choosing the regression model that minimizes the LOO or 10-fold cross validation MSE can give the most efficient PIM. This approach does not always find the optimal solution but remains a simple and efficient tuning algorithm. By using this algorithm, we can take advantage of existing regression packages to find the best regression model, and then use the aforementioned method to tune the the remaining hyper-parameters. Finally, this approach give us one model for predicting both the mean and the predictive interval.

21

Ghasemi Hamed and Serrurier

5.3.3

An Application with Tolerance Intervals

We know that β-content predictive intervals can be obtained via tolerance intervals for regression or via confidence interval on regression quantiles and such intervals are obtained upon regression models which may themselves have hyper-parameters (For the sake of brevity we continue this part with tolerance intervals for regression but the same procedure and statements hold for confidence interval on regression quantiles). Consider an example of constructing Predictive Interval Model (PIM)s by tolerance intervals on a KNN regression. This model has two hyper-parameters, the KNN regression’s hyper-parameter which is the number K, and the confidence level γ which is the coverage level in γ-coverage β-content tolerance intervals. So we have λ = (K, γ)T . First we find the regression’s hyperparameters K; it is K for KNN but it can be kernel related parameters in SVM regression or nothing in the linear regression (this hyper-parameter depends on the regression method). Once we have found the best regression model, we use an iterative algorithm that searches the smallest γ that satisfies the tuning constraint defined above. High values of γ will guarantee the PIM tuning constraint but the computed intervals can be very large, so the search begins with a high confidence value like γ = 0.9 or γ = 0.99 and we try to decrease γ and thus decrease the mean interval size. This procedure is repeated as long as the tuning constraints are satisfied and the search strategy is left to the user. Some datasets might require just 2 or 3 iterations but some others may work with small γ. It depends on the dataset and it can be influenced by the domain expert.

6. Tolerance Intervals for Local Linear Regression In the previous section we introduced the predictive interval framework. In this section we introduce two methods for obtaining tolerance intervals for local linear regression which in the next section, will be employed to obtain PIMs for LLR. We assume that the mean regression function is locally linear and the prediction error is locally homoscedastic. Our methods do not neglect the regression bias and find variable size intervals that work properly with biased regression models. The proposed tolerance intervals are constructed based on the leave-one-out or 10-fold cross validation prediction errors of the local linear regression. The local linear regression needs a regression bandwidth which could be found by any of the existing methods in the literature. In order to obtain our non-parametric predictive intervals, we need a second bandwidth, which is the tolerance interval bandwidth (LHNPE bandwidth). This work suggests two different tolerance interval bandwidths: a bandwidth having a fixed number of neighbors and a bandwidth having a variable one but both obtain variable size intervals. Another important subject is the regression bias. It is well known that the optimal smoothing non-parametric regression method consists of balancing between the bias and the standard deviation. This non-parametric bias does not vanish even with large sample sizes, so it is important for interval prediction methods to take it into account. The idea behind our tolerance intervals is to exploit the local density of prediction error (Yi − fˆ(xi )) in the LHNPE neighborhood (explained further) of the x∗ to find the most appropriate intervals that contain the desired proportion of the distribution of Y (x∗ ). We find tolerance intervals for the response variable by adding the regression estimates to the tolerance intervals for the prediction error. Prediction error’s tolerance intervals are centered on the estimation of 22

Predictive Interval Models for Non-parametric Regression

negative bias, so when added to the regression estimates, they remove the regression bias. Therefore, we obtain response variable’s tolerance intervals which correctly contains, with confidence γ, a proportion β of Y (x∗ ). 6.1

Theoretical Aspect

This part describes the theoretical context of tolerance intervals for local linear regression. We first define the concept of a Local Homoscedastic Normal Prediction Error (LHNPE) regression estimator. Then, we define the LHNPE neighborhood of a query point and in the end we will use a simple straightforward inference to obtain the formula of tolerance intervals for local linear regression. Definition 5 The oscillation of the function f : X → R on an open set U is defined as: ωf (U ) = supf (x) − inf f (x). x∈U

x∈U

Definition 6 A regression estimator fˆ(x) is a Local Homoscedastic Normal Prediction Error (LHNPE) if it satisfies the following conditions: • Normal distribution: the prediction error εpred = Y (x) − fˆ(x) has a normal distribux tion. ) • Almost constant distribution the prediction error: We suppose that the mean µ(εpred x and the standard deviation σ(εpred ) of the distribution for the prediction error have x small local oscillations. This is defined formally as: For all x, there exists an open set U 3 x, such that: ωµ(εpred ) (U ) ≤ υ1 and ωσ(εpred ) (U ) ≤ υ2 , x

x

where υ1 and υ2 are small fixed positive values. Definition 7 Let fˆ(x∗ ) be a LHNPE regression estimator for the query point x∗ . The LHNPE neighborhood for x∗ are instances for which the prediction error satisfies the LHNPE conditions. This neighborhood is described as below: Ksetx∗ = {(xi , Yi )|d(x∗ , xi ) ≤ b},

(34)

where d(x∗ , xi ) is a distance function in the feature space and b denotes the LHNPE bandwidth. Note that the LHNPE bandwidth Ksetx∗ is different from the regression bandwidth Regx∗ in local linear regression: Regx∗ = {(xi , Yi )|d(x∗ , xi ) ≤ breg }.

(35)

The regression bandwidth minimizes the regression bias-variance trade-off but the LHNPE bandwidth is used to find the neighborhood which satisfies the LHNPE conditions. The LHNPE neighborhood is almost always included in the regression neighborhood: Ksetx∗ ⊆ Regx∗ , 23

(36)

Ghasemi Hamed and Serrurier

∗ ∗ ˆ because the constant’s Y (x ) − f (x ) distribution in the neighborhood of the query point x∗ usually occurs inside its regression neighborhood. It is possible to find two different regression neighborhoods being next to each other having approximately the same prediction error distribution and not the same regression neighborhood. There are already several references on regression bandwidth Regx∗ selection in non-parametric regression. We do not treat this problem and the reader can find more details in Fan and Gijbels (1996) and H¨ardle (1990). Proposition 1 Let Y (x) = f (x) + εx denote a regression function and let fˆ(x) denote its Local Linear regression estimator. If our regression estimator satisfies the conditions below: • Normal error distribution: εx ∼ N (0, σx2 ) . 2 ˆ • Normal distribution of the local linear estimator: f (x) ∼ N f (x) + Biasfˆ(x) , σfˆ(x) , Fan et al. (1995) have shown that this assumption holds under certain regularity conditions. • fˆ(x) satisfies the LHNPE conditions defined above. where Biasfˆ(x∗ ) = E[fˆ(x∗ ) − f (x∗ )] is the estimator’s bias, σx2 is the variance of the error and σf2ˆ(x∗ ) is the variance of the estimator. Then the γ-confidence β-content regression tolerance interval for the query point x∗ is: T I(x∗ )Tγ,β = fˆ(x∗ ) + I(εpred x∗ )γ,β ,

(37)

∗ ˆ ∗ where εpred x∗ = Y (x ) − f (x ). T In the above equation, I(x∗ )Tγ,β and I(εpred x∗ )γ,β denote, respectively, the regression tolerance interval and the prediction error tolerance interval.

Proof: See Appendix B. Even though we have a biased prediction, our tolerance interval for Y (x∗ ) contains the desired proportion of the conditional distribution of the response variable. This is due to the fact that our tolerance intervals on the response variable I(x∗ )Tγ,β are computed based T on the tolerance intervals on the prediction error I(εpred x∗ )γ,β . LHNPE conditions assume that the prediction error has an unknown normal distribution with mean and variance being respectively the negative bias and the variance of the prediction error. So, for high values pred T T of γ and for β > 0.5, I(εpred x∗ )γ,β will contain the true bias. Therefore, adding I(εx∗ )γ,β to the biased regression estimate will remove the bias and give tolerance intervals that works properly with biased regression estimators.

6.2

Computational Aspect

By taking advantage of the LHNPE conditions for the local linear estimator, the tolerance interval on the prediction error at the point x∗ , described by (37), is approximated by the tolerance interval on prediction errors inside its LHNPE neighborhood. The prediction 24

Predictive Interval Models for Non-parametric Regression

error inside the LHNPE neighborhood of the query point is represented by Esetx∗ and it is defined formally as: Esetx∗ = {εpred |(xi , Yi ) ∈ Ksetx∗ }, where εpred = Yi − fˆ−i (xi ), i i

(38)

where fˆ−i (xi ) is the local linear estimation without using the ith observation, obtained by (4). Note that when (xi , Yi ) is in our training set, Yi − fˆ(xi ) becomes a residual and it depends on the random variable Yi ; however, Yi − fˆ−i (xi ) and Yi are independent. Hence, given an input vector x∗ , K the number of neighbors in Esetx∗ , β the desired content and γ the confidence level, the tolerance interval for the prediction error variable ˆσ εpred is computed by replacing θ, ˆ and n in Equations (9) and (10) which results in: x∗ v u 2 u (K − 1)(1 + K1 )Z1− 1−β t pred T 2 I(εx∗ )γ,β = θˆ ± cˆ σ , where c = , (39) 2 χ1−γ,K−1 X X pred (εpred − εpred εi and σ ˆ 2 = (K − 1)−1 = K −1 )2 . (40) θˆ = εpred i i i ε−i i ∈Esetx∗

εpred ∈Esetx∗ i

We propose to take the LHNPE neighborhood as the K-nearest neighbors to the query points where K can be a fixed or a variable number tuned on the dataset. So depending on the LHNPE neighborhood selection method, we have two different methods to obtain tolerance intervals for LLR but both methods require 10-fold cross validation or LOO errors of the whole training set. We denote this by error set: error set = {εpred |(xi , Yi ), i ∈ (1, · · · , n)}, where εpred = Yi − fˆ−i (xi ). i i

(41)

Algorithm 1 summarizes the required steps for obtaining tolerance intervals for local linear regression. Algorithm 1 Tolerance Interval for local linear regression 1: for all (xi , Yi ) ∈ trainingSet do 2: εpred ← Yi − fˆ−i (xi ) i 3: error set ← {error set, εpred } i 4: end for 5: for all x∗ ∈ testSet do 6: f val ← fˆ(x∗ ) 7: Ksetx∗ ← findToleranceNeighborhood(x∗ ) 8: Esetx∗ ← error of instances in Ksetx∗ , previously stored in error set T 9: I(εpred x∗ )γ,β ← β-content γ-coverage normal tolerance interval of Esetx∗ as in Equations

(39,40). pred

10: I(x∗ )Tγ,β ← f val + I(εx∗ )Tγ,β 11: end for

6.3

LHNPE bandwidth with Fixed K

In this method we take a fixed K number of the nearest neighbors of x∗ as its LHNPE neighborhood. These neighbors are returned by the function “findToleranceNeighborhood(x∗ )”. 25

Ghasemi Hamed and Serrurier

K is a hyper-parameter and is tuned on the training set. We denote this interval prediction method for LLR by “Fixed K”. Once the local linear model has been built and error set has been found on the training set, the computational complexity of interval prediction for a new instance is the same as an evaluation under the local linear regression. We select this neighborhood in such a way that it remains inside the regression neighborhood. This condition is respected appropriately by all points of the feature space of a dataset. Thus we have to take a LHNPE bandwidth that is coherent on the majority of points in the feature space. In our experiments, this condition is always satisfied except in the “Auto” dataset where the LHNPE bandwidth is a bit greater than the Regression bandwidth. 6.4

LHNPE bandwidth with Variable K

The idea behind this LHNPE bandwidth selection method is to find the “best” LHNPE bandwidth (best K) of each input vector x∗ . This method is summarized in Algorithm 2. For a fixed value of β, and for each input vector x∗ , the computation begins with an initial value of K, then the β-content γ-coverage normal tolerance interval of errors in Esetx∗ defined in (38) is calculated. This process is repeated for the same input vector x∗ but different T values of K, M INK ≤ K ≤ M AXK . Finally, the I(εpred x∗ )γ,β having the smallest size among the tolerance intervals computed by different values of K (different Esetx∗ ) is chosen as the desired interval and is added to fˆ(x∗ ). This iterative procedure leads us to choose the interval that has the best trade-off between the precision and the uncertainty to contain the response value. The more K increases, the less the local homoscedasticity assumptions match reality and this yields a prediction error variance different from the true one. If we find a variance higher than the true one, it could be partially compensated by the fact that the tolerance interval size decreases when the sample size increases. However, an increase in K may lead us to obtain smaller prediction variance; this issue is controlled by M AXK . On the contrary, when K is small, the LHNPE conditions are respected but the tolerance interval sizes increase just because the sample size is too small. Thus choosing the value of K that minimizes a fixed β-content γ-coverage tolerance interval ensures that we will have the best trade-off between the faithfulness of the local assumptions (LHNPE conditions) and the required sample size to guarantee the desired β proportion of the response value. The optimal value of K may vary much more on heterogeneous datasets. M INK and M AXK are global limits for the search process. M AXK stops the search process if the best value for K is not found before. This can occur when increasing the neighborhood, it gets contaminated with instances having smaller prediction errors than the prediction of the query point. In practice, these smaller prediction errors usually belong to a different subspace of the feature space with different error variances and/or prediction error distributions. Therefore these two bounds serve to restrict the search process in a region where it is most likely to contain the best neighborhood of x∗ . M AXK is usually included in the regression neighborhood. However one can take it greater than the regression bandwidth and let our search algorithm (Algorithm 2) find the neighborhood which gives the smallest tolerance interval. Once the local Linear model has been built and error set has been found on the training set, the computational complexity of interval prediction for a new instance is (M AXK − 26

Predictive Interval Models for Non-parametric Regression

Algorithm 2 LHNPE neighborhood with variable K 1: function findToleranceNeighborhood(x∗ ) 2: IntervalSizemin ← ∞ 3: Ksetreturn ← ∅ 4: for all i ∈ M INK , . . . , M AXK do 5: Ksetx∗ ← i nearest number of instances (xi , Yi ) ∈ trainingSet to x∗ 6: Esetx∗ ← ε−i i of instances in Ksetx∗ previously computed in error set pred T 7: I(εx∗ )γ,β ← β-content γ-coverage normal tolerance interval of Esetx∗ as in Equations

(39,40). pred

8: if size(I(εx∗ )Tγ,β ) ≤ IntervalSizemin then 9: Ksetreturn ← Ksetx∗ T 10: IntervalSizemin ← size(I(εpred x∗ )γ,β ) 11: end if 12: end for 13: return Ksetreturn 14: end function

M INK ) times higher than the complexity of an evaluation under the local linear regression. Because from the beginning to the Ksetx∗ -finding step, everything is similar to LLR, then in the interval calculation phase, LLR computes just one value and “Var K.” computes (M AXK − M INK ) intervals. More explanation on the LLR complexity can be found in Section 2.3

7. Predictive Interval Models for Local Linear Regression This section describes how to use tolerance intervals for local linear regression to obtain predictive interval models. First, we describe how the confidence level γ in these tolerance intervals can be used to obtain predictive interval models. Then, we see how to find the “best” value of γ that provides predictive interval model with the smallest mean interval size. 7.1

The General Formula

P The β-content predictive interval on the prediction error, denoted by I(εpred x∗ )β , is obtained by finding the predictive intervals hyper-parameters which satisfies the PIM tuning constraint in (33). Finally, the β-content predictive interval on the response variable is computed by adding local linear regression estimation to the error predictive interval: P I(x∗ )Pβ = fˆ(x∗ ) + I(εpred x∗ ) β .

As explained in 5.3, regression predictive intervals models have two types of hyperparameters. This first is the regression method’s hyper-parameter. In LLR, it is the bandwidth used for regression and it serves to find the error set. The second type of hyper-parameters are the predictive interval hyper-parameters. These hyper-parameters are (K, γ) or (M INK , M AXK , γ), respectively, for predictive intervals with fixed K and predictive intervals with variable K. 27

Ghasemi Hamed and Serrurier

7.2

Application with Linear Loess

We saw above, how to compute predictive interval models in the general form of local linear regression. This paragraph briefly reviews an application with the linear loess regression method. Loess is a version of linear polynomial regression that for each query point, takes its K nearest instances in the feature space as its neighborhood. We denote loess’s regression bandwidth with Kloess . Loess uses a first or second degree polynomial, so Linear loess refers to a loess with a first degree polynomial. Predictive intervals with Linear loess have three or four hyper-parameters: the linear loess bandwidth Kloess and the predictive hyper-parameters which are the confidence level γ and the LHNPE bandwidth. As seen above, (K) and (M INK , M AXK ) are respectively the LHNE bandwidth for predictive intervals with fixed K and predictive intervals with variable K. Based on (36), we usually have : M AXK ≤ Kloess or K ≤ Kloess . 7.3

Hyper-parameter Tuning

At this stage, we suppose that the loess bandwidth Kloess has been found. The only difference is that in variable K, we are looking for the pair (M INK , M AXK ) instead of K in fixed K. So we have λ = (Kloess , (γ, M INK , M AXK )) for variable K and λ = (Kloess , (γ, K)) in fixed K. The tuning procedure explained here is similar to the one discussed in 5.3. So once we have obtained the regression model, the PIM hyper-parameter tuning reduces to the constraint optimization problem listed below where all the constraints are hard constraints. Optimization problem for fixed K: n

(γ, K) = Argmin(M ISβλ ), where M ISβλ =

1X I(εxi )Tγ,β n i=1

M IPβλ0 = β PIM Tuning Constraint: Subject to Tuning Constraints: 0

Submitted 12/13; Published 00/00

Predictive Interval Models for Non-parametric Regression Mohammad Ghasemi Hamed

[email protected]

ENAC, MAIAA, F-31055 Toulouse, France

Mathieu Serrurier

[email protected]

IRIT - Universit´e Paul Sabatier Univ. de Toulouse, IRIT, F-31400 Toulouse, France

Nicolas Durand

[email protected]

IRIT - Universit´e Paul Sabatier ENAC, MAIAA, F-31055 Toulouse, France

Editor:

Abstract Having a regression model, we are interested in finding two-sided intervals that are guaranteed to contain at least a desired proportion of the conditional distribution of the response variable given a specific combination of predictors. We name such intervals predictive intervals. This work presents a new method to find two-sided predictive intervals for non-parametric least squares regression without the homoscedasticity assumption. Our predictive intervals are built by using tolerance intervals on prediction errors in the query point’s neighborhood. We proposed a predictive interval model test and we also used it as a constraint in our hyper-parameter tuning algorithm. This gives an algorithm that finds the smallest reliable predictive intervals for a given dataset. We also introduce a measure for comparing different interval prediction methods yielding intervals having different size and coverage. These experiments show that our methods are more reliable, effective and precise than other interval prediction methods. Keywords: Interval prediction, tolerance intervals, predictive intervals, local linear regression

1. Introduction Regression analysis is a statistical technique for estimating the value of one variable as a function of independent variables. They are widely applied in science and engineering, they are used in problems like function estimation, financial forecasting, and time series prediction. In the general form a regression equation has three variables: the response variable Y (x) , a function f (x) and a random error ε, where Y (x) = f (x) + ε. There are different kinds of regression techniques which estimate different characteristics of the conditional distribution of the response variable Y (x). The most common approaches estimate the mean of the random variable Y (x) and are usually known as least-squares techniques. Robust regression approaches are similar to least-squares techniques but they are designed to be c

2013 Mohammad Ghasemi Hamed and Mathieu Serrurier and Nicolas Durand .

Ghasemi Hamed and Serrurier

robust to outliers and violations of the least-squares assumptions. Another kind, called quantile regression, estimates the conditional quantiles of the response variable. In each category, the regression function can be estimated with a parametric linear, a parametric non-linear or a non-parametric method. This results in linear, non-linear or non-parametric regression models. Interval prediction is an important part of every regression modeling procedure because regression models are always built with finite sample sizes. Thus the predicted mean or quantile is an estimate of the true unknown conditional mean or quantile of the random variable Y (x). Therefore while dealing with finite size datasets, we need to make some statistical inferences. There are currently many interval prediction methods for the regression context, however each interval has its own specific interpretation and application. In this work we are interested in finding two-sided prediction intervals in regression models which contain, with a high confidence level, at least a desired proportion of the conditional response variable. Such intervals are mostly used in application demanding a high level of confidence, like quality control, environmental monitoring, industrial hygiene, exposure data analysis, aircraft trajectory prediction, security systems etc. We divide interval prediction approaches in regression into two main categories: The first category methods are based on the estimated conditional mean. These methods are usually based on least-squares models and propose interval prediction techniques that are centered on the estimation of the mean regression function. These approaches generally assume a non-biased regression model with a Gaussian error having constant variance. On the other hand we have quantile regression methods which directly estimate these intervals. Quantile regression methods are more robust to outliers and have less assumptions than the least-squares approaches. But they suffer from other weaknesses like slower speed of convergence and the crossing quantile effect (two different quantiles may cross or overlap each other). One of our contributions is the review and the comparison of different least-squares and quantile regression techniques used to find intervals which contain a desired proportion of the response variable. We take advantage of this work to address common misunderstood questions about interval prediction methods in the machine learning community. We explain their applications and review their drawbacks. As pointed out at the beginning paragraph, we are interested in finding intervals in regression models which contain, with a high confidence level, at least a desired proportion of the conditional response variable. For that purpose, we introduce a new type of interval prediction method named “predictive interval methods”. A predictive interval model is guaranteed to contain for any query point x, at least a desired proportion of the conditional distribution of the response variable. Such models can be obtained with tolerance intervals for regression or confidence interval on quantile regression, but these concepts have limited applications in the literature. So we propose tolerance intervals for Local Linear Regression (LLR). Then we use the tolerance intervals for LLR to obtain predictive interval models for LLR. Our predictive interval models are applied for two-sided interval prediction, however one can easily extend them to a one-sided interval prediction context. Then, we introduce a statistical test to check if an “interval prediction model” is a “predictive interval model”. In the same context, we 2

Predictive Interval Models for Non-parametric Regression

introduce two measures for ranking interval prediction models. These measures rate the efficiency and the tightness of the obtained envelope. Our predictive interval methods are based on LLR and give variable size intervals. We assume that the mean regression function is locally linear and that the prediction error is locally homoscedastic (heterocedastic in general). Our method does not neglect the regression bias and finds intervals that work properly with biased regression models. The proposed predictive intervals are based on the Leave-One-Out (LOO) or 10-fold cross-validation prediction errors of the local linear regression.

In order to validate our methods, we use several regression datasets to compare our predictive interval method for local linear regression with other interval prediction methods. The selected methods will be tested on their capacity to provide two-sided β-content predictive interval models. The models are compared by their reliability, efficiency, precision and the tightness of their obtained envelope. We also take advantage of our evaluation chapter to show that the conventional interval prediction method is not appropriate for high confidence interval prediction. It is almost always less efficient than our predictive interval methods and their envelope is almost always larger than the envelope obtained by our methods. Ghasemi Hamed et al. (2012) proposed a K-Nearest Neighbors (KNN) based interval prediction method which finds intervals that guarantee to contain, simultaneously for all instances in the predictor space, at least a proportion β of the conditional distribution of the response value. They called it simultaneous interval regression for KNN and they stated that, their method is similar to simultaneous tolerance intervals for KNN regression with a high confidence level. Their work differs from our contribution in at least three points: first, we do not look for models that guarantee the simultaneous condition. Our models could be obtained by tolerance intervals for regression and not simultaneous tolerance intervals for regression. The difference between these concepts is explained in Section 3. Second, our methods are based on LLR and use local distribution of the prediction error instead of local distribution of the conditional response variable. Third, we propose a test and two interval comparison measures to obtain and compare our models.

This paper is organized as follows: Section 2 is a background on regression and tolerance interval for least squares regression. Section 3 describes the state of the art in for interval prediction in regression. Section 4 introduces two efficiency measures which can be used to compare different interval prediction models. Section 5 introduces the concept of predictive interval models. Section 6 proposes a methods to obtain tolerance intervals for LLR under the Local Homoscedastic Normal Prediction Error (LHNPE) conditions. Section 7 describes how to use the tolerance intervals for LLR to find predictive interval models for LLR. Chapter 8 use experiments to compares our methods with other least squares and quantile regression method on nine benchmark datasets and the final section is a discussion with concluding remarks. 3

Ghasemi Hamed and Serrurier

2. Background 2.1

Context and Notation

We choose a fixed regression design where dataset S = (x1 , Y (x1 )), · · · , (xn , Y (xn )) is a random sample. The xi ’s are vectors of observations and Y (xi ) are random variables. These distributions are continuous probability distributions. We always suppose that there is one true mean regression function f (·) with a zero mean error and an unknown variance σ 2 . The most practical assumption is the Gaussian homoscedastic error, but it is not mandatory. S is a finite random sample, so the estimated regression model finds a pair of (fˆ, σ ˆ ); fˆ denotes the estimated regression function and σ ˆ is the estimated error standard deviation. This pair is a random vector in the probability space of regression models defined for the underlying regression type (for ex: Ordinary Least Squares (OLS)). Note that in the case of error being not normally distributed, the pair (fˆ, σ ˆ ) does not correctly represent the estimated regression model. Thus we will use the symbol PS instead of Pfˆ,ˆσ to refer to a probability distribution where the random vector is the estimated regression model based on the random sample S. We also use the following notation: • S = (x1 , Y (x1 )), · · · , (xn , Y (xn )): the random sample of regression, the training set; • f (·): the true and unknown regression function; • f (x): the conditional mean of the response variable for specified combination of the predictors; • fˆ(·): the estimated regression function; • fˆ(x): the estimated regression function at point x; • ε: the error variable; • εpred : the prediction error at point x, εpred = Y (x) − fˆ(x); x x • σ 2 : the true and unknown variance of the error variable; • σ ˆ 2 : the estimated variance of the error variable; • σf2ˆ(x) : the variance of the estimated regression function at point x; • x∗ : a point in the predictor space that does not exists in the training set; • Y (x): the conditional response variable for a given combination of the predictors, Y (x) = f (x) + ε; • Yi : the ith random response variable, Yi = Y (xi ); • yi : an observation of the random variable Yi ; • I(x)Tγ,β : β-content γ-coverage tolerance interval for the distribution of the response variable at point x; 4

Predictive Interval Models for Non-parametric Regression

• I(εpred )Tγ,β : β-content γ-coverage tolerance interval for the distribution of the predicx tion error at point x; • I(x)Pβ : β-content predictive interval for the distribution of Y (x); • I(εpred )Pβ : β-content predictive interval for the distribution of the prediction error at x point x; • Zp : the p-quantile of a standard normal distribution; • χ2p,n : the p-quantile of a chi-square distribution with n degrees of freedom. Note that, in this work we suppose that the prediction error for any point xi , is obtained with εpred = Y (xi ) − fˆ(xi ), where the mean estimate fˆ(xi ) does not use the xi observation (xi , yi ). 2.2

Least-squares Regression

Regression analysis is a statistical technique for estimating the value of one variable as a function of independent variables. In fixed design regression, there are n pairs of observations (x1 , Y1 ), · · · , (xn , Yn ), where xi is the vector of observations known as covariates and Yi is the response variable. In other words, the random variable Yi or Y (xi ) follows a mean function f (xi ) with a random error term εi defined as: Yi = f (xi ) + εi , where E(εi ) = 0.

(1)

The model assumes that εi are mutually independent and identically distributed (iid) random variables. The goal is to estimate the mean function f (·) by fˆ(·), being as close as possible to the unknown function f (·). The usual assumption is to suppose that the variance of the error is the same everywhere. This is known as homoscedasticity and the opposite hypothesis (variable error variance) is known as heteroscedasticity. In a least squares regression, the idea is to estimate the mean of Y (x) by fˆ(x) and based on some assumptions it results in finding the function that minimizes the Mean Squared Error (MSE), i.e. finding fˆ(·) that minimizes: n

M SE(f ) =

1X (yi − fˆ(xi ))2 . n i=1

If we have a homoscedastic error, the average risk of the regression estimator plus a constant value is equal to MSE. So in small to medium size datasets, leave-one-out or 10fold cross validation MSE are well-known estimators of the risk function. For more details on the risk, see Appendix B. 2.3

Local regression methods

Local Polynomial Regression (LPR) assumes that the unknown function f (·) can be locally approximated by a low degree polynomial. Local Polynomial Regression (LPR) fits a low degree polynomial model in the neighborhood (xi ) of the point x. The estimated vector of 5

Ghasemi Hamed and Serrurier

parameters used in the fitted LPR is the vector that minimizes a locally weighted sum of squares. Thus for each x a new polynomial is fitted to its neighborhood and the response value is estimated by evaluating the fitted local polynomial with the vector x as covariate. In general the polynomial degree (d) is 1 or 2; for d = 0, LPR becomes a kernel regression and when d = 1 it changes to LLR.

2.3.1

Definition of Local Polynomial Regression (LPR)

Suppose that the regression function f (·) at the point x can be approximated locally for z inside a neighborhood of x. The idea is to write the Taylor’s expansion for z inside a neighborhood of x as follows Fan and Gijbels (1996):

f (z) =

d X f j (x) j=0

j!

j

(z − x) ≡

d X

βj (z − x)j .

(2)

j=0

Equation (2) models the regression function by a polynomial function. Thus, for every observation z in the neighborhood of x, we write (2) and estimate the vector βx = (βx,0 , · · · , βx,d )T by the vector of parameters βˆx = (βˆx,0 , · · · , βˆx,d )T which minimizes the locally weighted sum of squares defined in Equation (3), and where Kb (·) represents a kernel function with bandwidth b. In fact, estimating f (x) for the random design as well as for the fixed design results in the locally weighted polynomial regression expressed by the equation below Fan and Gijbels (1996): βˆx = Argmin

n X

2 d X j Kb (xi − x) Yi − βx,j (xi − x)

β∈R(d+1) i=1

(3)

j=0

ˆ , · · · , βx,d ˆ )T . So the local polynomial estimation for point x is computed where βˆx = (βx,0 as follows: n X fˆ(x) = ai (x)Yi , (4) i=1

where a(x) = I1T βˆx and I1T = (1, 0, · · · , 0). Kernel functions K(·) are used to weight the observations. They are chosen so that observations closer to the fitting point x have bigger weights and those far from x have smaller weights. If K(·) is a kernel, then Kb (·) is also a kernel function. 1 u Kb (u) = K( ), where b > 0. b b Here, b, known as the bandwidth, is a constant scalar value used to select an appropriate scale for the data. In this article, we use the following kernel: 1 D(u) Kb (u) = K , b b 6

(5)

Predictive Interval Models for Non-parametric Regression

where D(·) is a distance function like the L2 -norm. Some authors including Cleveland (1979) and Cleveland and Devlin (1988), took the K-nearest neighbors of x as its neighborhood. In this case, for each x, b = Dk (x), where Dk (x) is the distance from the K-th nearest neighbors (the farthest neighbor) from the point x. For a detailed discussion see Atkeson et al. (1997). 2.3.2

Bandwidth Selection

A popular bandwidth selection method is the LOO technique suggested in Stone (1977) Stone (1977) which chooses the following bandwidth b:

b = Argmin

n X

(yi − fˆ−i (xi ))2 ,

(6)

i=1

where fˆ−i (xi ) is the estimation without using the ith observation. Estimating the bandwidth by LOO is a time-consuming task, so it is common to minimize the K-fold cross validation score with K = 5 or K = 10; this leads to an approximation of LOO. Plug-in bandwidth is another smoothing strategy which is a formula for the asymptotically optimal bandwidth. The plug-in bandwidth requires several unknown quantities that must be estimated from the data. In section 4.2 of Fan and Gijbels (1996), a plug-in bandwidth for linear weighted local linear regression is defined. One of the required parameters for this estimator is f (·)’s second derivative which is more difficult to estimate than f (·) itself. In this work we use 10-fold cross validation to find the best bandwidth of our dataset. 2.3.3

Loess

Loess was introduced by Cleveland and Delvin Cleveland and Devlin (1988), and is a multivariate version of LOWESS Cleveland (1979), which is another version of LPR. Loess is described by (4), where the polynomial degree is one d = 1 or two d = 2. For the bandwidth selection and weight calculation, loess is similar to KNN. Its weights are calculated with (5) where, u = (xi − x), D(·) is u’s L2 -norm in the predictor space and b is the Euclidean distance between the input vector x and its K th nearest neighbor. The weight function chosen by Cleveland and Delvin Cleveland and Devlin (1988) was the Tricube kernel, however it is not mandatory. In this work, linear loess is the non-parametric smoother function. Therefore, for each input vector x, we use (3), with d = 1, to estimate the vector of parameter βˆx from the training set. As we can see in (7), for each prediction the locally weighted linear regression problem is converted to a Weighted Least Squares (WLS) in which the weights are estimated by a kernel function. βˆx = arg min

n X

wi (yi − xTi β)2 ,

i=1

where wi = Kb (xi − x) ≥ 0 is the weight of the ith observation. 7

(7)

Ghasemi Hamed and Serrurier

2.4

Tolerance intervals

let X = (X1 , · · · , Xn ) denote a random sample from a continuous probability distribution. A tolerance interval is an interval that is guaranteed, with a specified confidence level γ, T sign is used to refer to to contain a specified proportion β of the population. The Iγ,β a β-content γ-coverage tolerance interval Krishnamoorthy and Mathew (2009). Then, we have: T (8) PX P (X ∈ Iγ,β |X) ≥ β = γ. When our sample set (of size n) comes from a univariate normal distribution, the lower and upper tolerance bounds (Xl and Xu , respectively) are are obtained as follows: Xl = θˆ − cˆ σ , Xu = θˆ + cˆ σ v u 2 u (n − 1)(1 + n1 )Z1− 1−β t 2 c= χ21−γ,n−1

(9) (10)

Where θˆ is the sample mean of the distribution, σ ˆ its sample standard deviation, χ21−γ,n−1 represents the 1 − γ quantile of the chi-square distribution with n − 1 degree of freedom and Z 2 1−β is the squared of (1 − 1−β 2 ) quantile of the standard normal distribution Howe 1−

2

(1969). 2.5

Tolerance intervals for least-squares regression

In the case of regression with constant error variance and normal distribution of errors, usually inter-quantiles of a normal distribution with mean zero and variance σ ˆ 2 , (being the error variance estimator) are used as an approximate solution to find intervals that contain a desired proportion of the distribution of the response variable for a given value of dependent variables. For instance, the 0.95 inter-quantile [fˆ(x) − 1.96ˆ σ , fˆ(x) + 1.96ˆ σ ] is often used as the interval containing 95% of the distribution of Y (x) (i.e., as a regression tolerance interval). As shown by Wallis Wallis (1951), this statement is not true since σ ˆ2 and fˆ(x) are only estimations of the true error variance σ 2 and the true mean function at point x, f (x). These estimations are always made on a finite sample and are then pervaded with uncertainty. Tolerance intervals for least squares regression have been introduced in order to take into account this uncertainty. These intervals are described formally by (11). We will refer to such intervals, β-content γ-coverage regression tolerance intervals and they T (x). are denoted by Iγ,β Z

T (x) Uβ,γ

P T (x) Uβ,γ

px (t)dt ≥ β

= γ,

(11)

where Y (x) = f (x) + ε and px (t) denotes the probability density function of Y (x) for a T (x) for Y (x) specified value of the predictor variable x. A two-sided tolerance interval Iγ,β is of the form fˆ(x) ± ρ(x)ˆ σ , where ρ(x) is the tolerance factor to be determined subject to the content β and the desired confidence level γ. Let C(x; fˆ, σ ˆ ) represent the content of this tolerance interval, 8

Predictive Interval Models for Non-parametric Regression

C(x; fˆ, σ ˆ ) = PY (x) fˆ(x) − ρ(x)ˆ σ ≤ Y (x) ≤ fˆ(x) + ρ(x)ˆ σ .

(12)

The tolerance factor ρ(x) satisfies the following condition: ˆ Pfˆ,ˆσ C(x; f , σ ˆ ) ≥ β = γ.

(13)

Equations (11) and (13) could also be expressed as follows: T Pfˆ,ˆσ PY (x) Y (x) ∈ Iγ,β (x) ≥ β = γ,

(14)

T T Iγ,β (x) = [LTβ,γ (x), Uβ,γ (x)] = [fˆ(x) − ρ(x)ˆ σ , fˆ(x) + ρ(x)ˆ σ ].

It is important to observe that tolerance intervals in regression are defined separately T (x ) and for each input vector. Therefore, for two different input vectors x1 and x2 , Iγ,β 1 T (x ) are different and the event Y (x ) ∈ I T (x ) is independent of Y (x ) ∈ I T (x ). Iγ,β 2 1 1 2 γ,β γ,β 2 For more details see Hahn and Meeker (1991) and Krishnamoorthy and Mathew (2009). This intervals has been studied for non-linear parametric in Carroll and Ruppert (1991). They use transformation and/or weighting for the construction of prediction and tolerance intervals for a new response following a non-linear regression fit. Their work addresses the case of normally distributed errors and the non-parametric case in which the error distribution is unknown. But the non-parametric case concerns the error distribution and not the regression fit, and tolerance intervals for non-parametric regression have not, so far, been applied to non-parametric regression.

3. State of the Art of the Interval Prediction Regression models are always built with finite sample size (n < ∞), thus the predicted mean or quantile is an estimate of the true unknown conditional mean or quantile of the random variable Y (x) = f (x) + ε. Therefore while dealing with datasets of finite size, we need to make some statistical inferences. This section reviews and gives a comparison of different least-squares and quantile regression techniques used to find such intervals. Besides, we take advantage of this section to address a misunderstood interval prediction method in the machine learning community. We explain its applications and review its drawbacks. 3.1

Interval Prediction Models

The goal of this paragraph is to emphasize the differences between intervals, interval prediction methods and interval prediction models. An interval prediction method is the procedure required for obtaining an interval. It is just the way to do it but when it is applied to a dataset, we obtain an interval prediction model. For example, a tolerance interval for regression is a type of interval. The method to obtain it in linear models is described in Krishnamoorthy and Mathew (2009) and, when applied to a dataset, the model which gives the tolerance interval for each point in the predictor space is the interval prediction model. 9

Ghasemi Hamed and Serrurier

Definition 1 A regression β-content interval prediction model, built on the random sample S, is function I(·)β from the predictor space Rp to the response variable space R such that: I(·)β : Rp → I, where I = {[a, b]|a, b ∈ R ∪ {−∞, ∞}, a < b}. and, the expected content of the intervals is at least β: ES P Y (x) ∈ I(x)β S ≥ β.

(15)

(16)

Thus when the size of our training set goes to infinity and under certain conditions, a β-content interval prediction model finds intervals that on average contain, at least, a β of the distribution of Y (x). This is a quite broad definition which covers all the interval prediction method for Y (x) and we will use it for such purpose. Our works deals with the regression models, so we omit to mention the regression word and use “interval prediction model” instead of “regression interval prediction model”. Note that test and model selection techniques are always applied to models and not to methods. However when a method is more efficient than its competitors on several datasets or in a general theoretical framework, we can state that this method is more efficient than others. 3.2

Least-Squares Based Interval Prediction

We review briefly some well-known statistical inference techniques applied to least-squares regression models. There is an extensive literature on this topic and the goal of this section is to emphasize that least-squares interval prediction methods are not restricted to large sample techniques. However, there are still some subjects like tolerance intervals and simultaneous intervals that need further study. We will see further that prediction and tolerance intervals have some equivalents in the quantile regression set-up, but confidence band and simultaneous tolerance intervals seem to be restricted to the least-squares world. 3.3

Conventional Interval prediction

One of the most common interval prediction techniques used in practice is to take [fˆ(x) − Z 1−β SSE, fˆ(x) + Z1− 1−β SSE]) as the interval which contains a β proportion of Y (x)’s 2

2

population,where SSE 2 is the average MSE given by a LOO or a 10-fold cross validation scheme. One might assume that the intervals expressed below have similar properties to the regression tolerance interval defined in the next section. ˆ ˆ = β. (17) P Y (x) ∈ f (x) − Z 1−β SSE, f (x) + Z1− 1−β SSE 2

2

We assume that: • the error variance for all x’s is constant (homoscedasticity). • the estimator’s variance σf2ˆ(x) is constant for all x. • fˆ(x) is an unbiased estimator of f (x). 10

Predictive Interval Models for Non-parametric Regression

• the error ε, and fˆ(x), are independent and both have normal distributions. Equation (17) becomes asymptotically valid, but it remains non-applicable for datasets of finite size. For more details on the proof of our statements, refer to Appendix B. Unfortunately, it is a common practice in the Machine Learning community to employ this method for obtaining intervals having the properties of prediction intervals, tolerance intervals or simultaneous tolerance intervals. The conventional interval prediction method has some drawbacks: • First of all, the estimation does not take into account the regression sample size like prediction interval, confidence bands and tolerance intervals. • It just estimates asymptotic global inter-quantile for the conditional response variable. • It supposes that the estimated regression function is non-biased. The problem of finding intervals that satisfy (17) is treated by tolerance for in leastsquares regression. 3.3.1

Inference on the conditional mean f (x)

This part describes interval prediction techniques that obtain intervals that contain with a confidence level the conditional mean at point x. • Point-wise confidence interval for f (x): The confidence interval for the mean regression function Iβpw (x) contains asymptotically, a desired proportion β of the conditional distribution of the estimated mean function fˆ(x) for each combination of predictors H¨ardle (1990). Pfˆ(f (x) ∈ Iβpw (x)) = β.

(18)

• Simultaneous Confidence band for the conditional mean function, for all x ∈ X : this is the idea of γ-confidence band Iγcb (x) for the regression. These intervals [Uγ (x), Lγ (x)] create an envelope around the entire mean regression function f (·) such that, for all x ∈ X , the probability that the true f (x) is contained in the band is simultaneously γ. Pfˆ f (x) ∈

Iγcb (x)

for all x ∈ X

= γ, where Iγcb (x) = [Uγ (x), Lγ (x)]

(19)

where X is the domain of x. 3.3.2

Inference on the response variable Y (x) = f (x) + ε

This part describes interval prediction techniques that obtain intervals that contain a desired proportion of the conditional distribution of the response variable. These methods are closely related to the methods explained just above. • Prediction interval for Y (x) : they are also called expectation tolerance intervals for regression IβP red (x) which contains on average and not at least, a desired proportion 11

Ghasemi Hamed and Serrurier

β of the conditional distribution of the response variable Y (x) for each combination of predictors. They are described by the equation below: P red ˆ = β where Y (x) = f (x) + ε Efˆ,ˆσ P Y (x) ∈ Iβ (x)|fˆ, σ

(20)

For a detailed discussion about the differences between prediction and tolerance intervals, the reader can find more in Paulson (1943); Hahn and Meeker (1991); Krishnamoorthy and Mathew (2009). T (x) are explained • Tolerance interval for regression: tolerance interval for regression Iγ,β in 2.5. The interval contains, with a confidence level γ, at least a desired proportion β of the distribution of Y (x).

• Simultaneous tolerance intervals for regression: β-content γ-coverage simultaneous regression tolerance intervals, described in Krishnamoorthy and Mathew (2009), create an envelope around the entire mean regression function f (·) such that for all x ∈ X , the probability that Y (x) is contained in the envelope is β, and this coverage is guaranteed with a confidence level γ. They are can be described by (12) and (13) where (13) must be replaced by the equation below: ˆ Pfˆ,ˆσ min C(x; f , σ ˆ ) ≥ β = γ. (21) x∈X

Note that tolerance intervals and simultaneous tolerance intervals for least squares regression have been well studied for linear regression but the application of these methods in the non-linear and particularly the non-parametric case are limited in the literature. 3.4

Quantile Regression Based Interval prediction

A quantile regression model can estimate one conditional quantile so one-sided and twosided interval estimation are treated separately. 3.4.1

One-sided interval prediction

• Quantile regression: one-sided intervals obtained by the estimation of the conditional quantile are similar to one-sided prediction intervals in least-squares models. • Confidence intervals on regression quantiles: the obtained one-sided interval contains, with a confidence level γ, at least a desired proportion β of Y (x) Kocherginsky et al. (2005); Koenker (1994). They have so far been studied for linear models, and they are similar to one-sided tolerance intervals for regression explained in 2.5. 3.4.2

Two-sided interval prediction

in order to obtain two-sided (1 − α)-content conditional intervals (β = 1 − α), one must build two distinct quantile regression models: a lower α2 -quantile regression model and an upper (1 − α2 )-quantile regression model. 12

Predictive Interval Models for Non-parametric Regression

• Quantile regression: This is done by a pair of upper and lower quantile regression model. These intervals are estimations and they are similar to two-sided prediction intervals in least-squares models. • Confidence intervals on regression quantiles: These two-sided intervals contain with a γ confidence level, a proportion 1 − α of the Y (x). As noted, we need a pair of ( α2 , 1 − α2 ) quantile regression models but each model now itself needs a one-sided confidence interval on regression quantile. Once we have built the upper and lower quantile regression models, we must obtain a lower (one-sided) (1 − τ2 ) confidence interval on the lower α2 -quantile regression model and an upper (one-sided) (1 − τ2 ) confidence interval on the upper (1 − α2 )-quantile regression model. By applying the Bonferroni inequality, one can merge the pair of (1 − τ2 ) confidence intervals to obtain a joint confidence statement with a probability greater or equal to γ = 1 − τ . More details on this combination can be found in Appendix B. It is important to emphasize that although these intervals are theoretically feasible, there has not been any work, until now, which treats the problem of two-sided interval prediction with one-sided confidence intervals on regression quantiles. Such intervals are similar to two-sided γ-coverage 1 − α-content least-squares tolerance intervals and they are explained in 2.5. As discussed in Koenker (2005), two different quantile regression models may cross or overlap each other, which is called as quantile crossing. Thus two-sided interval prediction is more meaningful by enforcing the non-crossing constraint. However after enforcing this constraint, the conditional quantile estimator may not converge to the true conditional quantile. Thus we have to choose between a “non-correct” or non-convergent estimator.

4. Comparing Interval Prediction Models For a given dataset, we may have several interval prediction models but we need some quality measure to compare them. For this purpose, we define the dataset measures listed below. These measures are then used as building blocks for some graphical charts and plots explained further in this section. The idea is to provide graphical tools which can help us to compare the effectiveness of different interval prediction methods through different datasets. 4.1

Direct Dataset Measures

For each of the datasets the following quality measures can be computed. Note that the βcontent intervals I(xi )β = [L(xi )β , U (xi )β ] must be obtained for observations not contained in the training set S. So for small to medium datasets, we obtain these measures with a cross-validation or a LOO schema. • MIP: Mean Inclusion Percentages: the fraction of the response values that are contained in the β-content interval I(xi )β . M IPβ = n−1

n X i=1

13

V (xi ).

Ghasemi Hamed and Serrurier

where is V (xi ) is defined as: ( 1 if Y (xi ) ∈ I(xi )β , V (xi ) = 0 otherwise. • MIS: Mean of Interval Size. M ISβ = n

−1

n X

size(I(xi )β ).

i=1

• σis : sample standard deviation of interval sizes. σis = n

−1

n X (size(I(xi )β ) − M ISβ )2 , i=1

where size(I(x)β ) = U (xi )β − U (xi )β . In to verify the reliability of an interval prediction method, we introduce the following constraint. Definition 2 Let S be a sample of size n and b(n) be an function of n, a β-interval prediction model is a reliable model if we have: MIP Constraint: M IPβ ≥ b(n).

(22)

This definition will further be used in the next section. 4.2

Composed Dataset Measures

We use the above quality measures to define the following composed measures: 4.2.1

Normalized MIS

Suppose that we want to test c different β-content methods (“M ethod1 ”, “M ethod2 ” ,..., “M ethodc ”) on the dataset S. They give us c distinct models and each model has a Mean of Interval Size (MIS), so we have: M ISS1 , M ISS2 ,..., M ISSc . But depending on the dataset and β’s value, one model may satisfy the MIP constraint or not. For a model that does not satisfy this constraint, we do not compute its normalized MIS. For each model its normalized MIS is equal to the ratio of its MIS to the maximum MIS on this dataset normalizedM ISSi =

M ISSi . max (M ISSi )

i∈(1,··· ,c)

If we have : m1 m2 M ISSm1 ≥ M ISSm2 and M IPS,β ≥ b(n) and M IPS,β ≥ b(n)

⇔ m1 provides a wider reliable envelope than m2 . 14

Predictive Interval Models for Non-parametric Regression

M2 is better than m1 because it satisfies the MIP constraint and it also gives the smallest normalized MIS value. Choosing the ratio to the maximum MIS value rescales the MIS value between 0 and 1 and lets us compare the strength of methods across different datasets. However we can not use the normalized MIS to compare two models (constructed on the same dataset) that obtain different MIP values but have equal or approximately equal MIS values. In this case, we have to compare them by their Equivalent Gaussian Standard Deviation, explained below. 4.2.2

Equivalent Gaussian Standard Deviation (EGSD)

If we have two reliable models (constructed on the same dataset) having different MIP values but approximately equal MIS values, we normally choose the one that gives the higher MIP. But the situation can get more complicated for models (constructed on the same dataset) with different MIS values and different MIP values. EGSD is a measure which can be used to compare interval prediction models, constructed on the same dataset, which have different MIP values. Such models can have different or equal MIS values. Let m be a β-content m . The idea interval prediction model built on the dataset S, yielding M ISSm and M IPS,β behind EGSD is to find the Equivalent Gaussian Distribution (EGD) for successful predicted intervals of m. We have seen that by taking intervals size on average equal to M ISSm , that m of the observations will be contained in their prediction interval. So EGD is the M IPS,β distribution of the size of predicted intervals obtained by model m1 that correctly contains their response variable. Therefore the EGD which has the smallest variance corresponds to the most efficient model. The Equivalent Gaussian Distribution for m is the normal distribution θ-content inter-quantile size of which will be equal to M ISSm . We have: θ = m . So the Equivalent Gaussian Standard Deviation of m is calculated by: M IPS,β EGSDSm =

M ISSm m , α = 1 − β. , where θ = M IPS,β 2Z1− α2 θ

Now by using each model’s EGSD, we can compare models with different values of M IP and M IS. EGSD measures the trade-off between average interval size and the fraction of successful predictions. Smaller EGSD values denote more effective interval prediction models. Finally, for the sake of readability, all found EGSD are normalized in each dataset. Thus the final value is the ratio of the method’s EGSDSm to the maximum EGSD value on the underlying dataset: normalizedEGSDSm =

EGSDSm . max (EGSDSi )

i∈(1,··· ,c)

Note that if the model m1 has smaller EGSD than the model m2 , it does not mean m2 ’s envelope is wider than m1 ’s envelope. As seen above smaller normalized MIS values mean smaller envelopes and smaller EGSD values means more effective models. 4.3

Figures

Plots and charts help us to compare different interval prediction methods on different datasets because a figure can visualize complex and big tables. Each plot is dedicated 15

Ghasemi Hamed and Serrurier

to one dataset and it compares dataset measures of different interval prediction methods on the same dataset whereas a chart compares a desired dataset measure for different methods and across different datasets. All the presented plots have the same x axis. This axis is labeled “Nominal MIP”, and it represents distinct values of the desired proportion (distinct β values). On the other hand, each plot type has a different y axis. This axis denotes the underlying dataset measure on the tested interval prediction models. 4.3.1

MIP plot

The MIP plot is similar to the well-known Q-Q plot with the difference that it compares MIP instead of quantiles. The x axis is denoted by “Nominal MIP” and it represents the desired proportion of inclusion (distinct values of β). The y axis is denoted by “Obtained MIP”. It represents the model’s MIP. Each point represents the model’s obtained MIP for its value on the “Nominal MIP” axis. This figure always has two lines: the “MIP constraint 0.05 for different line” and the “Nominal MIP line”. The “MIP constraint line” displays Fβ,n values of nominal MIP, and the “Nominal MIP line” represents the function y = x. By looking at this figure we can see the reliability of a method for different nominal MIP. The first value in the x axis where a line crosses the MIP constraint line will be called its failure MIP. It is obvious that the method having the higher failure MIP is the most reliable one. One can also use the MIP plot to rate the model’s precision. If a model obtains MIP values much higher than the desired nominal MIP, it means that the method is reliable but not precise. For example a model which obtains MIP values of 0.45, 0.9 and 0.99 for respective nominal MIP of 0.25, 0.75 and 0.95 is reliable but not precise. The most precise model is the one having the nearest line to the “Nominal MIP line”. Finally, the best model in this plot is the one which is the most precise and the most reliable. It means that the best model in a MIP plot is the one having the nearest line to the upper side of the “Nominal MIP line”. 4.3.2

EGSD plot

The y axis of an EGSD plot is labeled by “Normalized EGSD Value” and it represents the model’s normalized EGSD value. By looking at this figure, we can compare the efficiency of different models. It is obvious that the model having the highest line is the most inefficient model. We suggest using this plot along with the MIP plot to rate the efficiency of reliable methods. However one may ignore the reliability aspect and take advantage of this plot to compare the efficiency of different models. 4.3.3

MIS plot

The y axis of an EGSD plot labeled “Normalized MIS Value” and it represents the model’s normalized MIS value. By looking at this figure, we can compare the model which obtains the tightest reliable envelope. The model having the highest line provides the widest envelope. If a model does not satisfy the MIP constraint, its normalized MIS value is not computed. The MIS plot shows each model’s normalized MIS until its “failure MIP”. We suggest using this plot along with the EGSD plot. 16

Predictive Interval Models for Non-parametric Regression

4.3.4

Charts

Charts are used to compare one dataset measure on different datasets. We propose the following charts: • Mean Inclusion Percentage Chart (MIP chart): the goal of this chart is to compare the mentioned methods based on their fraction of response values located inside their predicted intervals. It just displays the MIP value and it usually does not contain important information. • MIS ratio chart: this chart displays the normalized MIS measure on different datasets. • Equivalent Gaussian Standard Deviation chart (EGSD chart): it displays the normalized EGSD measure on different datasets.

5. Predictive Interval Framework The goal of this section is to propose a new interval prediction framework. We introduce the concept of regression predictive intervals and regression Predictive Interval Model (PIM). Next, we propose a statistical test to verify if an “interval prediction model” is a “predictive interval model”. In the same context, we introduce two measures for rating interval prediction models. These measures rate the efficiency and the tightness of the obtained envelope. 5.1

Predictive Interval Models (PIMs)

In the frequentist interpretation of confidence intervals, a confidence interval for a parameter contains zero or one parameter. The parameter is fixed and confidence intervals change with different random samples. In the same way, the confidence level (γ) used in tolerance intervals for regression defined in (14) and confidence intervals for regression quantiles (explained in Appendix B) mean the following: the probability that the obtained intervals contain, under re-sampling, at least a proportion β of the conditional distribution of the response value Y (x) is γ. We know that the confidence level in Neyman-Pearson confidence intervals is independent of the observed sample. It means that if we obtain γ-confidence β-content tolerance intervals of an observed sample from a regression function, then the confidence level γ does not induce any posterior probability of including β proportion of the distribution of Y (x). Therefore, the confidence coefficient in frequentist confidence intervals cannot be interpreted as posterior probability. This idea is discussed in detail in Chapter 7 in Walley (1991). Hence, under the frequentist viewpoint of regression, the true conditional response variable’s inter-quantile is included with probability zero or one in the obtained interval (by using tolerance intervals for regression or confidence intervals for regression quantiles). Our goal is to obtain intervals that correctly bracket these inter-quantiles. They can be found in two ways: the first approach takes a very high confidence level like γ ≈ 1 and the second method finds the smallest confidence level 0 < γ0 < 1 which includes the true unknown model. We introduce the concept of predictive intervals which refer to both of these intervals. A predictive interval built on S, is guaranteed to contain for the query point x, 17

Ghasemi Hamed and Serrurier

at least a desired proportion of the conditional distribution of the response variable. It can be obtained with tolerance intervals for regression or confidence intervals for regression quantiles but these concepts have so far only been treated for linear models Definition 3 Let S = {(x1 , Y1 ) · · · , (xn , Yn )} denote a random sample where Yi = f (xi )+εi and εi is white noise. A β-content predictive interval for x, denoted by I(x)Pβ , is an interval such that: P (23) PY (x) Y (x) ∈ I(x)β S ≥ β, where I(x)Pβ = [L(x)Pβ , U (x)Pβ ]. Since we have observed S, I(x)Pβ is no longer random and the probability measure is just related to cover at least a proportion β of the conditional distribution of the response variable Y (x) for a specified combination of the predictors. Definition 4 Let S = {(x1 , Y1 ) · · · , (xn , Yn )} denote a random sample where Yi = f (xi )+εi and εi is white noise. A β-content predictive interval model, denoted by I(·)Pβ , is a function such that: (24) I(·)Pβ : Rp → I, where I = {[a, b]|a, b ∈ R ∪ {−∞, ∞}, a < b}, and for all x in the predictor space, the obtained interval is a β-content predictive interval described by (23). 5.2

Predictive Interval Model Test (PIM Test)

The goal of this part is to develop a statistical test with which we can rate the reliability of any interval prediction model claiming to provide β-content predictive intervals. A predictive interval model must provide predictive intervals for each point in the predictor space. We saw that the distribution of Y (x) changes for each value of x. So, in order to see whether an interval for the regression function at the point x contains at least a proportion β of the s distribution of Y (x), we need (for each combination of predictors x) a sample set from the distribution of Y (x) = f (x) + , and then we can observe if the constructed interval contains a proportion s distribution of the distribution of Y (x). In the same way, in order to verify if the methods works for an entire dataset {xi | ∈ (1, · · · , n)}, we need a distinct sample set for each xi and this sample must be drawn from Y (xi ). Since a sample set is required for each xi , i ∈ (1, · · · , n), the described procedure requires a huge dataset having many observations for each point x in the feature space which makes it impractical or impossible for multiple regression problems. However, we can make some approximations and use the results stated above to derive the following test. We first begin by defining a variable obtaining MIP on the dataset. Then we will see that this variable can be approximated by a normal distribution, so we use the quantiles of the standard normal distribution as the function b(n) used in Equation (22). 5.2.1

Simultaneous Inclusion for Predictive Intervals

A β-content predictive interval I(x)Pβ must contain at least β proportion of the conditional distribution of Y (x). Hence, the probability in (23) is just related to contain at least a proportion β of the conditional distribution of the Y (x). We define the function V (x) as: 18

Predictive Interval Models for Non-parametric Regression

( 1 V (x) = 0

if Y (x) ∈ I(x)Pβ , otherwise.

The above definition means that the probability that V (x) is equal to 1 is β, so V (x) has a Bernoulli distribution with p = β. V (x) ∼ Bernoulli(β).

(25)

Suppose that we have a dataset of ntrain observations T = {(x1 , Y1 ) · · · , (xntrain , Yntrain )} with which we build our model, and nv other observations S = {(xv1 , Y1v ) · · · , (xvnv , Ynvv )}, not contained in the original dataset as our test set. If we apply the function V (·) on the whole test set S and sum the result, we obtain: M IPβ =

n−1 v

nv X

V (xvi ).

(26)

i=1

Therefore, we can deduce that M IPS,β has a Binomial distribution. This is expressed formally by (27) where Binomial(nv , β) is a binomial distribution with n = nv and p = β. nv M IPβ ∼ Binomial(nv , β).

(27)

If nv is sufficiently large, we can assume that M IPβ has a normal distribution as: M IPβ ∼ N (β,

β(1 − β) ). nv

(28)

Thus in a PIM, the fraction of instances having their response value included in their predictive intervals is on average β. This means such predictive intervals for regression have in average a simultaneous content of β so, on average, they are like simultaneous regression tolerance intervals. For small to medium datasets, M IPβ is computed in a cross-validation or leave-one-out schema on the whole dataset which means that S = T .

5.2.2

Testing Predictive Interval Models

As we have seen in (28), the random variable M IPβ can usually be well approximated by a normal distribution. The test below is used to verify, with level α, if the interval prediction method does provide β0 -content predictive intervals for all x in the predictor space. H0 : β ≥ β0 versus H1 : β < β0 ,

(29)

then H0 can be rejected with significance α where: M IPβ < nv−1/2 β0 (1 − β0 )Zα = Fβα0 ,nv ,

(30)

where Zα is the α-quantile of the standard normal distribution. So if (30) is not true, we fail to reject the null hypothesis with significance level α, and accept the underlying model 19

Ghasemi Hamed and Serrurier

as a model providing β-content predictive intervals. In this work we used a significance level of α = 0.05, so for each dataset we compared the M IPβ ’s value on the test set with Fβ0.05 . Thus, any PIM must pass the PIM test as 0 ,nv defined below: . PIM Test: M IPβ ≥ Fβ0.05 0 ,nv

(31)

For the sake of simplicity, we refer to M IPS,β for a given dataset S and desired proportion β as MIP (Mean Inclusion Percentage). As we have seen in (28), the fraction of response values inside their β-content predictive intervals converges to β, so the test defined in (31), where α = 0.05 is used to verify if the obtained intervals, with a confidence level 0.95 and on average and not at least like in simultaneous tolerance internals, do simultaneously contain a proportion β0 of the distribution of Y (x) for all x in the predictor space. Remark The average simultaneous content of PIMs mentioned just above, means that: for a PIM built on the training set T , if we test the PIM with a large number of new observations (x∗i , Y (x∗i ))i∈{1,··· ,nv } , the fraction of the new response values included in their predictive intervals is guaranteed to be β. This is expressed formally in (28). Note that, this is not the same as the average content for any β-content interval prediction models. A β-content interval prediction model built on a specified training set T , is not guaranteed to contain, on average, a β proportion of successful predictions. However, if we have a large number l of β-content interval prediction model I(·)Tj ,β , built on a large number l of training set (Tj )j∈{1,··· ,l} , and we test each I(·)Tj ,β with a large number of unseen instances (x∗i , Y (x∗i ))i∈{1,··· ,nv } . In this case, the expected probability of each βcontent interval I(x∗i )Tj ,β to contain a proportion β of the distribution of Y (x∗i ) is β. This is expressed formally in (16). Thus, having a β-content interval prediction model built on the training set T , if we test the model with large number of training set and new testing observations, the fraction of response value included in their predictive intervals is on average β. An arbitrary β-content interval prediction method needs a large number of training set and new testing observations, or one large training set and a large number of new testing observations, to guarantee an M IPβ equal to β. However a PIM, must guarantee an M IPβ = β with any training set. 5.3

Hyper-parameter Tuning and Model Selection

This part addresses hyper-parameter tuning questions related to predictive interval explained in Section 5.1. We first convert the hyper-parameter tuning problem to an optimization problem. Then, we propose a simple optimization algorithm that takes advantage of existing least-squares regression method to find an efficient model for predicting both the mean and the predictive interval. Finally, we give an application with tolerance intervals for least-square regression. Note that, the dataset S does not change in the hyper-parameter tuning phase, so we do not use it to index our variables. 20

Predictive Interval Models for Non-parametric Regression

5.3.1

The Optimization Problem

Let λ denote the vector of hyper-parameter of the β-content interval prediction method I(·)S,β . The vector λ is divided into two set of elements. The first set is the vector of hyperparameter for the regression method and the second set is specific to the interval prediction method. Our goal is to find the optimal value of λ, for any β-content interval prediction model that is also a β-content predictive interval model (pass the PIM test). This result in the following problem: n

λ0 =

Argmin(M ISβλ ),

where

M ISβλ

1X = I(xi )λβ n

(32)

i=1

Subject to: PIM Tuning Constraint: M IPβλ0 = β

(33)

λ-Specific Constraints: depends on the PIM. Note that the MIP constraint is a hard constraint and there is no trade-off between satisfying this constraint and minimizing the MIS. We found λ0 which satisfies the constraint defined above. This results in intervals having the smallest MIS measure where MIP and MIS are computed based on a leave-one-out or 10-fold cross validation scheme on the training set. 5.3.2

The Optimization Algorithm

We propose the following hyper-parameter tuning method: • First, find the regression model with the smallest prediction error MSE. • Then use an optimization method that finds the λ0 that satisfies the tuning constraint and also results in intervals having the smallest MIS measure on the previously found regression model. • Note that the space of λ in the second step is restricted to λ values that have their regression hyper-parameter equal to the hyper-parameter of the regression model found in the first step. This process divide the optimization in two phase, the hyper-parameter of the regression method tuning and the hyper-parameter tuning of the interval prediction method. In order to obtain the smallest intervals (measured by MIS), we need the smallest values of prediction errors. So, choosing the regression model that minimizes the LOO or 10-fold cross validation MSE can give the most efficient PIM. This approach does not always find the optimal solution but remains a simple and efficient tuning algorithm. By using this algorithm, we can take advantage of existing regression packages to find the best regression model, and then use the aforementioned method to tune the the remaining hyper-parameters. Finally, this approach give us one model for predicting both the mean and the predictive interval.

21

Ghasemi Hamed and Serrurier

5.3.3

An Application with Tolerance Intervals

We know that β-content predictive intervals can be obtained via tolerance intervals for regression or via confidence interval on regression quantiles and such intervals are obtained upon regression models which may themselves have hyper-parameters (For the sake of brevity we continue this part with tolerance intervals for regression but the same procedure and statements hold for confidence interval on regression quantiles). Consider an example of constructing Predictive Interval Model (PIM)s by tolerance intervals on a KNN regression. This model has two hyper-parameters, the KNN regression’s hyper-parameter which is the number K, and the confidence level γ which is the coverage level in γ-coverage β-content tolerance intervals. So we have λ = (K, γ)T . First we find the regression’s hyperparameters K; it is K for KNN but it can be kernel related parameters in SVM regression or nothing in the linear regression (this hyper-parameter depends on the regression method). Once we have found the best regression model, we use an iterative algorithm that searches the smallest γ that satisfies the tuning constraint defined above. High values of γ will guarantee the PIM tuning constraint but the computed intervals can be very large, so the search begins with a high confidence value like γ = 0.9 or γ = 0.99 and we try to decrease γ and thus decrease the mean interval size. This procedure is repeated as long as the tuning constraints are satisfied and the search strategy is left to the user. Some datasets might require just 2 or 3 iterations but some others may work with small γ. It depends on the dataset and it can be influenced by the domain expert.

6. Tolerance Intervals for Local Linear Regression In the previous section we introduced the predictive interval framework. In this section we introduce two methods for obtaining tolerance intervals for local linear regression which in the next section, will be employed to obtain PIMs for LLR. We assume that the mean regression function is locally linear and the prediction error is locally homoscedastic. Our methods do not neglect the regression bias and find variable size intervals that work properly with biased regression models. The proposed tolerance intervals are constructed based on the leave-one-out or 10-fold cross validation prediction errors of the local linear regression. The local linear regression needs a regression bandwidth which could be found by any of the existing methods in the literature. In order to obtain our non-parametric predictive intervals, we need a second bandwidth, which is the tolerance interval bandwidth (LHNPE bandwidth). This work suggests two different tolerance interval bandwidths: a bandwidth having a fixed number of neighbors and a bandwidth having a variable one but both obtain variable size intervals. Another important subject is the regression bias. It is well known that the optimal smoothing non-parametric regression method consists of balancing between the bias and the standard deviation. This non-parametric bias does not vanish even with large sample sizes, so it is important for interval prediction methods to take it into account. The idea behind our tolerance intervals is to exploit the local density of prediction error (Yi − fˆ(xi )) in the LHNPE neighborhood (explained further) of the x∗ to find the most appropriate intervals that contain the desired proportion of the distribution of Y (x∗ ). We find tolerance intervals for the response variable by adding the regression estimates to the tolerance intervals for the prediction error. Prediction error’s tolerance intervals are centered on the estimation of 22

Predictive Interval Models for Non-parametric Regression

negative bias, so when added to the regression estimates, they remove the regression bias. Therefore, we obtain response variable’s tolerance intervals which correctly contains, with confidence γ, a proportion β of Y (x∗ ). 6.1

Theoretical Aspect

This part describes the theoretical context of tolerance intervals for local linear regression. We first define the concept of a Local Homoscedastic Normal Prediction Error (LHNPE) regression estimator. Then, we define the LHNPE neighborhood of a query point and in the end we will use a simple straightforward inference to obtain the formula of tolerance intervals for local linear regression. Definition 5 The oscillation of the function f : X → R on an open set U is defined as: ωf (U ) = supf (x) − inf f (x). x∈U

x∈U

Definition 6 A regression estimator fˆ(x) is a Local Homoscedastic Normal Prediction Error (LHNPE) if it satisfies the following conditions: • Normal distribution: the prediction error εpred = Y (x) − fˆ(x) has a normal distribux tion. ) • Almost constant distribution the prediction error: We suppose that the mean µ(εpred x and the standard deviation σ(εpred ) of the distribution for the prediction error have x small local oscillations. This is defined formally as: For all x, there exists an open set U 3 x, such that: ωµ(εpred ) (U ) ≤ υ1 and ωσ(εpred ) (U ) ≤ υ2 , x

x

where υ1 and υ2 are small fixed positive values. Definition 7 Let fˆ(x∗ ) be a LHNPE regression estimator for the query point x∗ . The LHNPE neighborhood for x∗ are instances for which the prediction error satisfies the LHNPE conditions. This neighborhood is described as below: Ksetx∗ = {(xi , Yi )|d(x∗ , xi ) ≤ b},

(34)

where d(x∗ , xi ) is a distance function in the feature space and b denotes the LHNPE bandwidth. Note that the LHNPE bandwidth Ksetx∗ is different from the regression bandwidth Regx∗ in local linear regression: Regx∗ = {(xi , Yi )|d(x∗ , xi ) ≤ breg }.

(35)

The regression bandwidth minimizes the regression bias-variance trade-off but the LHNPE bandwidth is used to find the neighborhood which satisfies the LHNPE conditions. The LHNPE neighborhood is almost always included in the regression neighborhood: Ksetx∗ ⊆ Regx∗ , 23

(36)

Ghasemi Hamed and Serrurier

∗ ∗ ˆ because the constant’s Y (x ) − f (x ) distribution in the neighborhood of the query point x∗ usually occurs inside its regression neighborhood. It is possible to find two different regression neighborhoods being next to each other having approximately the same prediction error distribution and not the same regression neighborhood. There are already several references on regression bandwidth Regx∗ selection in non-parametric regression. We do not treat this problem and the reader can find more details in Fan and Gijbels (1996) and H¨ardle (1990). Proposition 1 Let Y (x) = f (x) + εx denote a regression function and let fˆ(x) denote its Local Linear regression estimator. If our regression estimator satisfies the conditions below: • Normal error distribution: εx ∼ N (0, σx2 ) . 2 ˆ • Normal distribution of the local linear estimator: f (x) ∼ N f (x) + Biasfˆ(x) , σfˆ(x) , Fan et al. (1995) have shown that this assumption holds under certain regularity conditions. • fˆ(x) satisfies the LHNPE conditions defined above. where Biasfˆ(x∗ ) = E[fˆ(x∗ ) − f (x∗ )] is the estimator’s bias, σx2 is the variance of the error and σf2ˆ(x∗ ) is the variance of the estimator. Then the γ-confidence β-content regression tolerance interval for the query point x∗ is: T I(x∗ )Tγ,β = fˆ(x∗ ) + I(εpred x∗ )γ,β ,

(37)

∗ ˆ ∗ where εpred x∗ = Y (x ) − f (x ). T In the above equation, I(x∗ )Tγ,β and I(εpred x∗ )γ,β denote, respectively, the regression tolerance interval and the prediction error tolerance interval.

Proof: See Appendix B. Even though we have a biased prediction, our tolerance interval for Y (x∗ ) contains the desired proportion of the conditional distribution of the response variable. This is due to the fact that our tolerance intervals on the response variable I(x∗ )Tγ,β are computed based T on the tolerance intervals on the prediction error I(εpred x∗ )γ,β . LHNPE conditions assume that the prediction error has an unknown normal distribution with mean and variance being respectively the negative bias and the variance of the prediction error. So, for high values pred T T of γ and for β > 0.5, I(εpred x∗ )γ,β will contain the true bias. Therefore, adding I(εx∗ )γ,β to the biased regression estimate will remove the bias and give tolerance intervals that works properly with biased regression estimators.

6.2

Computational Aspect

By taking advantage of the LHNPE conditions for the local linear estimator, the tolerance interval on the prediction error at the point x∗ , described by (37), is approximated by the tolerance interval on prediction errors inside its LHNPE neighborhood. The prediction 24

Predictive Interval Models for Non-parametric Regression

error inside the LHNPE neighborhood of the query point is represented by Esetx∗ and it is defined formally as: Esetx∗ = {εpred |(xi , Yi ) ∈ Ksetx∗ }, where εpred = Yi − fˆ−i (xi ), i i

(38)

where fˆ−i (xi ) is the local linear estimation without using the ith observation, obtained by (4). Note that when (xi , Yi ) is in our training set, Yi − fˆ(xi ) becomes a residual and it depends on the random variable Yi ; however, Yi − fˆ−i (xi ) and Yi are independent. Hence, given an input vector x∗ , K the number of neighbors in Esetx∗ , β the desired content and γ the confidence level, the tolerance interval for the prediction error variable ˆσ εpred is computed by replacing θ, ˆ and n in Equations (9) and (10) which results in: x∗ v u 2 u (K − 1)(1 + K1 )Z1− 1−β t pred T 2 I(εx∗ )γ,β = θˆ ± cˆ σ , where c = , (39) 2 χ1−γ,K−1 X X pred (εpred − εpred εi and σ ˆ 2 = (K − 1)−1 = K −1 )2 . (40) θˆ = εpred i i i ε−i i ∈Esetx∗

εpred ∈Esetx∗ i

We propose to take the LHNPE neighborhood as the K-nearest neighbors to the query points where K can be a fixed or a variable number tuned on the dataset. So depending on the LHNPE neighborhood selection method, we have two different methods to obtain tolerance intervals for LLR but both methods require 10-fold cross validation or LOO errors of the whole training set. We denote this by error set: error set = {εpred |(xi , Yi ), i ∈ (1, · · · , n)}, where εpred = Yi − fˆ−i (xi ). i i

(41)

Algorithm 1 summarizes the required steps for obtaining tolerance intervals for local linear regression. Algorithm 1 Tolerance Interval for local linear regression 1: for all (xi , Yi ) ∈ trainingSet do 2: εpred ← Yi − fˆ−i (xi ) i 3: error set ← {error set, εpred } i 4: end for 5: for all x∗ ∈ testSet do 6: f val ← fˆ(x∗ ) 7: Ksetx∗ ← findToleranceNeighborhood(x∗ ) 8: Esetx∗ ← error of instances in Ksetx∗ , previously stored in error set T 9: I(εpred x∗ )γ,β ← β-content γ-coverage normal tolerance interval of Esetx∗ as in Equations

(39,40). pred

10: I(x∗ )Tγ,β ← f val + I(εx∗ )Tγ,β 11: end for

6.3

LHNPE bandwidth with Fixed K

In this method we take a fixed K number of the nearest neighbors of x∗ as its LHNPE neighborhood. These neighbors are returned by the function “findToleranceNeighborhood(x∗ )”. 25

Ghasemi Hamed and Serrurier

K is a hyper-parameter and is tuned on the training set. We denote this interval prediction method for LLR by “Fixed K”. Once the local linear model has been built and error set has been found on the training set, the computational complexity of interval prediction for a new instance is the same as an evaluation under the local linear regression. We select this neighborhood in such a way that it remains inside the regression neighborhood. This condition is respected appropriately by all points of the feature space of a dataset. Thus we have to take a LHNPE bandwidth that is coherent on the majority of points in the feature space. In our experiments, this condition is always satisfied except in the “Auto” dataset where the LHNPE bandwidth is a bit greater than the Regression bandwidth. 6.4

LHNPE bandwidth with Variable K

The idea behind this LHNPE bandwidth selection method is to find the “best” LHNPE bandwidth (best K) of each input vector x∗ . This method is summarized in Algorithm 2. For a fixed value of β, and for each input vector x∗ , the computation begins with an initial value of K, then the β-content γ-coverage normal tolerance interval of errors in Esetx∗ defined in (38) is calculated. This process is repeated for the same input vector x∗ but different T values of K, M INK ≤ K ≤ M AXK . Finally, the I(εpred x∗ )γ,β having the smallest size among the tolerance intervals computed by different values of K (different Esetx∗ ) is chosen as the desired interval and is added to fˆ(x∗ ). This iterative procedure leads us to choose the interval that has the best trade-off between the precision and the uncertainty to contain the response value. The more K increases, the less the local homoscedasticity assumptions match reality and this yields a prediction error variance different from the true one. If we find a variance higher than the true one, it could be partially compensated by the fact that the tolerance interval size decreases when the sample size increases. However, an increase in K may lead us to obtain smaller prediction variance; this issue is controlled by M AXK . On the contrary, when K is small, the LHNPE conditions are respected but the tolerance interval sizes increase just because the sample size is too small. Thus choosing the value of K that minimizes a fixed β-content γ-coverage tolerance interval ensures that we will have the best trade-off between the faithfulness of the local assumptions (LHNPE conditions) and the required sample size to guarantee the desired β proportion of the response value. The optimal value of K may vary much more on heterogeneous datasets. M INK and M AXK are global limits for the search process. M AXK stops the search process if the best value for K is not found before. This can occur when increasing the neighborhood, it gets contaminated with instances having smaller prediction errors than the prediction of the query point. In practice, these smaller prediction errors usually belong to a different subspace of the feature space with different error variances and/or prediction error distributions. Therefore these two bounds serve to restrict the search process in a region where it is most likely to contain the best neighborhood of x∗ . M AXK is usually included in the regression neighborhood. However one can take it greater than the regression bandwidth and let our search algorithm (Algorithm 2) find the neighborhood which gives the smallest tolerance interval. Once the local Linear model has been built and error set has been found on the training set, the computational complexity of interval prediction for a new instance is (M AXK − 26

Predictive Interval Models for Non-parametric Regression

Algorithm 2 LHNPE neighborhood with variable K 1: function findToleranceNeighborhood(x∗ ) 2: IntervalSizemin ← ∞ 3: Ksetreturn ← ∅ 4: for all i ∈ M INK , . . . , M AXK do 5: Ksetx∗ ← i nearest number of instances (xi , Yi ) ∈ trainingSet to x∗ 6: Esetx∗ ← ε−i i of instances in Ksetx∗ previously computed in error set pred T 7: I(εx∗ )γ,β ← β-content γ-coverage normal tolerance interval of Esetx∗ as in Equations

(39,40). pred

8: if size(I(εx∗ )Tγ,β ) ≤ IntervalSizemin then 9: Ksetreturn ← Ksetx∗ T 10: IntervalSizemin ← size(I(εpred x∗ )γ,β ) 11: end if 12: end for 13: return Ksetreturn 14: end function

M INK ) times higher than the complexity of an evaluation under the local linear regression. Because from the beginning to the Ksetx∗ -finding step, everything is similar to LLR, then in the interval calculation phase, LLR computes just one value and “Var K.” computes (M AXK − M INK ) intervals. More explanation on the LLR complexity can be found in Section 2.3

7. Predictive Interval Models for Local Linear Regression This section describes how to use tolerance intervals for local linear regression to obtain predictive interval models. First, we describe how the confidence level γ in these tolerance intervals can be used to obtain predictive interval models. Then, we see how to find the “best” value of γ that provides predictive interval model with the smallest mean interval size. 7.1

The General Formula

P The β-content predictive interval on the prediction error, denoted by I(εpred x∗ )β , is obtained by finding the predictive intervals hyper-parameters which satisfies the PIM tuning constraint in (33). Finally, the β-content predictive interval on the response variable is computed by adding local linear regression estimation to the error predictive interval: P I(x∗ )Pβ = fˆ(x∗ ) + I(εpred x∗ ) β .

As explained in 5.3, regression predictive intervals models have two types of hyperparameters. This first is the regression method’s hyper-parameter. In LLR, it is the bandwidth used for regression and it serves to find the error set. The second type of hyper-parameters are the predictive interval hyper-parameters. These hyper-parameters are (K, γ) or (M INK , M AXK , γ), respectively, for predictive intervals with fixed K and predictive intervals with variable K. 27

Ghasemi Hamed and Serrurier

7.2

Application with Linear Loess

We saw above, how to compute predictive interval models in the general form of local linear regression. This paragraph briefly reviews an application with the linear loess regression method. Loess is a version of linear polynomial regression that for each query point, takes its K nearest instances in the feature space as its neighborhood. We denote loess’s regression bandwidth with Kloess . Loess uses a first or second degree polynomial, so Linear loess refers to a loess with a first degree polynomial. Predictive intervals with Linear loess have three or four hyper-parameters: the linear loess bandwidth Kloess and the predictive hyper-parameters which are the confidence level γ and the LHNPE bandwidth. As seen above, (K) and (M INK , M AXK ) are respectively the LHNE bandwidth for predictive intervals with fixed K and predictive intervals with variable K. Based on (36), we usually have : M AXK ≤ Kloess or K ≤ Kloess . 7.3

Hyper-parameter Tuning

At this stage, we suppose that the loess bandwidth Kloess has been found. The only difference is that in variable K, we are looking for the pair (M INK , M AXK ) instead of K in fixed K. So we have λ = (Kloess , (γ, M INK , M AXK )) for variable K and λ = (Kloess , (γ, K)) in fixed K. The tuning procedure explained here is similar to the one discussed in 5.3. So once we have obtained the regression model, the PIM hyper-parameter tuning reduces to the constraint optimization problem listed below where all the constraints are hard constraints. Optimization problem for fixed K: n

(γ, K) = Argmin(M ISβλ ), where M ISβλ =

1X I(εxi )Tγ,β n i=1

M IPβλ0 = β PIM Tuning Constraint: Subject to Tuning Constraints: 0