Classifying bounded rationality in limited data sets: a Slutsky matrix approach

Given any observed finite sequence of prices, wealth, and demand choices, we propose a way to measure and classify the departures from rationality in a systematic fashion, by connecting violations of the underlying Slutsky matrix properties to the length of revealed demand cycles. The approach complements our previous study (Aguiar and Serrano in J Econ Theory 172:163–201, 2017), which is based on the entire demand function. The methodology can be easily applied in experimental demand data sets.


Introduction
The Strong Axiom of Revealed Preference (SARP) completely characterizes whether a finite set of prices and demand choices can be rationalized. However, this binary approach is incomplete, in the sense that we do not know by how much behavior departs from rationality. Furthermore, we learn little about the demand data that fails to satisfy SARP. This has motivated an important body of literature that has focused on how to measure the size of rationality violations. The revealed preference approach (henceforth RP) is the preferred method to test the rationality hypothesis in consumer behavior, due to its nonparametric nature. The leading contributions of this approach to testing rationality are Afriat (1973) and Varian (1983), which revolve around Afriat Efficiency Index (henceforth AEI). The prevalence of the RP approach is due to the simplicity of its implementation for the commonly used data sets, and to its flexibility, explained by its nonparametric nature. However, in the words of Varian (1983) "the RP approach fails to summarize the data in a useful way." In a recent contribution, Aguiar and Serrano (2017) propose an index of violations of rationality based on the Slutsky matrix. Their Slutsky matrix norm (SMN) approach helps to answer the question of how far is a given behavior (demand function) from rationality, using the entire observed Slutsky matrix function distance to its closest rational Slutsky matrix function. Moreover, the methodology provides a useful classification of the violations of the classical axioms of revealed demand. The main limitation of the approach, however, is its reliance on infinite data, making its applicability questionable.
In this paper, we demonstrate how the approach in Aguiar and Serrano (2017) can be adapted to finite data sets. In doing so, we attempt to provide a complementary approach to the RP methodology, stemming from the tradition of Antonelli (1951), Slutsky (1915), and Hurwicz and Uzawa (1971) by using the Slutsky matrix to test the empirical implications of consumer behavior in a finite data set environment. In particular, we build and implement a methodology that may help to measure and classify boundedly rational demand data by means of an index of deviations from rationality that has a useful decomposition of SARP-inconsistent behavior.
We use classical results from the RP approach to show that nonrational behavior will be accounted for by a Slutsky matrix function that fails to satisfy the Slutsky regularity conditions for any extension of the data set. Conversely, if a data set can be rationalized in the sense of Afriat (1973), there exists an extension thereof that offers a rationalization in the sense of Hurwicz and Uzawa (1971). An implication of this observation is that testing rationality in the RP approach and our modification of the SMN approach with finite data is equivalent. In particular, a data set that violates SARP will have a positive Slutsky norm for any extension of the data set, with an informative decomposition of SARP-inconsistencies. These results are obtained because the length of revealed demand cycles, revealed demand axioms, and properties of the Slutsky matrix are neatly connected. To link finite and infinite environments, we exploit the fact that any sequence of data points can be interpolated by a continuously differentiable function.
Thus, our main contribution is to propose a way to classify consumer behavior according to its Slutsky matrix norm in limited data sets. We adapt the decomposition of the Slutsky norm into the different violations of axioms of revealed demand for finite data. Our results seem to hold well in simulations. 1 To the best of our knowledge, this is the only measure of departures from rationality that allows such a decomposition analysis. In addition, the Slutsky matrix norm differs from the AEI (Afriat 1973), the most frequently used measure of violations of rationality, in that the former is a positive index of rationality, whereas the latter is normative. Indeed, the Slutsky matrix norm measures the error a modeller would make when predicting the correct elasticity behavior of a consumer, if she makes the rationality assumption. In contrast, the AEI quantifies the minimum wasted income that the consumer has incurred without improving his own welfare. Other well-known indices of departures from rationality that can be called normative are the Money Pump Index (Echenique et al. 2011) and the Minimum Cost Index (Dean and Martin 2015). For other positive indices, see Varian (1983) and any other goodness of fit index, concerning failures in predicting out-of-sample demand quantities (behavioral nearness), under the rationality assumption. Relating our approach to some of these, we also provide theoretical results that connect quantitatively the SMN with the AEI and the Behavioral Nearness problem (i.e., the least distance from any given demand to its best rational demand approximation). This is the paper's outline. Section 2 presents the primitives of our analysis and the model. Section 3 presents an auxiliary equivalence result between the RP and the SMN approaches that provides a logical bridge between the finite data set environment and the Slutsky matrix function approach. Section 4 contains our main results and develops a new class of interpolators of consumer choice data sets that have a minimal Slutsky norm and have desirable properties. Section 5 implements simulation exercises to study the numerical behavior of the minimal Slutsky norm interpolators and a comparison with Afriat's index. Section 6 discusses formally the connection of the SMN with other measures of bounded rationality. Finally, we present a brief literature review in Sect. 7 and conclude in Sect. 8. The proofs are collected in an "Appendix".

The model: testing rationality with limited data sets
Our primitive is a finite array of prices, wealth levels, and demand choices O K = {( p k , w k ), x k } K k=1 for an individual or decision unit. The observation x k ∈ R L + is a L dimensional vector of quantities, corresponding to L goods, that we observed being chosen by the consumer at the price-wealth pair ( p k , w k ) ∈ R L ++ × R ++ . These consumption choices may or may not be rational.
The consumption set is R L + so the finiteness of the observed data does not mean that the consumer chooses from finitely-many options. Rather, our problem is that, as analysts, we can observe only a finite number of price-wealth pairs with their corresponding choices.
Consider a demand function x : P × W → R L + , going from Z = P × W , a compact space of price-wealth pairs ( p, w), P ⊆ R L ++ , W ⊆ R ++ , to the consumption set. We assume x satisfies Walras' law: L l=1 p l x l ( p, w) = w for all price-wealth pairs.
Footnote 1 continued with one another, and that failures of symmetry (Ville axiom/Path Independence) are more prevalent than failures of negative semidefiniteness (WARP).
This demand is a deterministic choice rule that represents the behavior of a consumer at each given price-wealth pair. The demand functions considered can be thought (without loss of generality) to belong to a closed and bounded set of demand functions X (Z) ⊂ C 1 (Z, R L + ). We assume that this compact space has the C 1 (Z, R L + ) norm. 2 When we have two vectors of the same length say v1, v2 ∈ R L we write its inner product as v1v2. Definition 1 Data Generating Demand Function (DGDF). We say that a demand function Given that our interest is to connect with approaches based on the entire (infinite) functional data, we introduce the following theoretical construct. We say that x ∈ X (Z) is the "true" DGDF if for any data set O K or "sample" of individual choices for a given price-wealth situation ( For example, a true DGDF does not exists if we observe two different choices for the same price-wealth situation, hence excluding the case of choice correspondences. We also assume that Walras' law holds throughout, for all O K , p k x k = w k and all x ∈ X (i.e., px( p, w) = w for all ( p, w) ∈ P × W ). Behaviorally, when we face deterministic choices that fulfill Walras' law, we are concerned with testing whether O K can be rationalized by a locally non satiated strictly convex preference relation.
In addition, we need a second ingredient, which can be expressed as the extensions of a finite data set O K . Every finite data set O K has an associated set of functions that describe all possible extensions, which are also elements of X (Z). Definition 2 Extensions of a consumer's data set. We say that a subset of demand functions The following claim is trivial: Claim 1 For finite K and any O K its set of extensions X K (Z) = ∅ if for any k, m ∈ {1, . . . , K }, whenever p k = p m and w k = w m , it is the case that x k = x m .
For instance, we can always find a smooth x ∈ X (Z) using a number of interpolation techniques for O K , under the condition above (such as an interpolator of polynomial degree or one based on B-splines, among others).

RP and Slutsky matrix approaches to test rationality
The RP approach to testing and measuring departures from rationality in limited data sets relies on the SARP. The main concept needed is that of a revealed demand cycle.
If we can find a revealed demand cycle C D,T for T ≥ 2, then we have a violation of SARP. Namely, we define the relation R as follows: x t Rx t−1 whenever p t x t ≥ p t x t−1 , which is read as x t being "directly revealed preferred" to x t−1 . Also, define the relation R as follows: x t Rx s whenever one can find a sequence x t Rx 1 Rx 2 R · · · x n Rx s , which we read as x t being "revealed preferred" to x s . It is clear that in C D,T we have x T Rx T −1 Rx T −2 · · · x 1 Rx 0 , which implies that x T Rx 1 , but since x 0 = x T , we also have x 1 Rx T , thus violating SARP. We say that a revealed demand cycle is strict whenever C D,T is such that for some t ∈ {1, . . . , Another characterization of rationality for demand functions x ∈ X (Z) was provided by Hurwicz and Uzawa (1971) in the form of restrictions over the Slutsky matrix function. This characterization requires the knowledge of the whole demand function (i.e., infinite data).
Definition 4 Let Z ⊂ P × W be given, and denote by ( p, w) an arbitrary pricewealth pair in Z. 4 Then the Slutsky matrix function S ∈ M(Z) 5 is defined pointwise: for a given demand x ∈ X (Z). The Slutsky matrix function S of a rational demand x ∈ X (Z) must satisfy the Slutsky regularity conditions. Namely, S is symmetric (property σ ) or s i j ( p, w) = s ji ( p, w) for all ( p, w) ∈ Z, S is singular in prices (property π ) or S( p, w)p = 0 and S( p, w) p = 0 for all ( p, w) ∈ Z, and S is negative semidefinite (property ν) or S( p, w) is negative semidefinite for all ( p, w) ∈ Z. Hurwicz and Uzawa (1971) proved that the converse is also true, that is if x ∈ X (Z) has an associated Slutsky matrix function that satisfies σ, π, and ν, then it can be generated by maximizing a continuous utility function. 6

Ville cycles, weak WARP, and revealed demand cycles
Note that when attempting to evaluate by how much a data set O K departs from being rationalized, multiple paths can be followed. In fact, there is a large literature of measuring departures from rationality in finite data sets. Most of them share the common feature that their measures are a function of the revealed demand cycles C D,T for T ≥ 2. One central question that we tackle is how the properties of the revealed demand cycle relate to the Slutsky matrix of a demand function. The key to do this is to draw a connection between the revealed demand cycles from finite data and both the Ville cycles and the Weak WARP defined for infinite data.
Roughly, recall that the symmetry of the Slutsky matrix function is equivalent to the Ville Axiom of Revealed Preference (VARP)/Path Independence (Hurwicz and Richter-HR henceforth-Hurwicz and Richter 1979). To state this axiom, we need to define a real income path.
Definition 5 (Real income path). A real income path consists of both a wealth path w : [0, b] → W , and a price path p : [0, b] → P, having that (w(τ ), p(τ )) is a piecewise continuously differentiable path in Z.
Thus, we are allowing for continuity of the derivative to fail at a countable subset of points. Jerison and Jerison (1992) define a rising real income path whenever We define a Ville Cycle in our setting as follows: Observe that if there is a rising real income situation ∂w ∂τ (τ ) > ∂ p ∂τ (τ )x( p(τ ), w(τ )), and the price-wealth path forms a cycle ( p(0), w(0)) = ( p(b), w(b)), then the situation is equivalent (almost everywhere) to , w(τ )). Axiom 1 Ville Axiom of revealed preference (VARP). A demand function x ∈ X is said to satisfy VARP if it does not have a Ville cycle C V (S),b for all S ≥ 1 and b > 0.
Next, we state the weak version of WARP, which is equivalent to the NSD of the Slutsky matrix.
Axiom 2 Weak version of the weak axiom of revealed preference (Weak WARP). 7 We say that a demand function x ∈ X satisfies Weak WARP if when we have px( p, w) ≤ w then it follows that px( p, w) ≥ w.
Observe that, under the restrictions on the sampling scheme (which rules out nondeterministic choice), Weak WARP is simplified. In fact, for our purposes, we take Weak WARP to require this: if px( p, w) < w then px( p, w) > w when ( p, w) = ( p, w).
An additional condition that rational consumers fulfill is the property of "no money illusion" or homogeneity of degree zero.
Finally, we state an additional axiom, that is equivalent to Weak WARP under homogeneity of degree zero, and that is the Wald Axiom. The Wald axiom requires that if we have a sequence (possibly a pair) of observations such that p k x k = w for all k ∈ {1, . . . , K }, then: p k x( p l , w) < w implies p l x( p k , w) > w. 8

Preliminary results
We are ready to make the connection between the finite and the infinite data approaches to characterize rationality. The RP approach is concerned with measuring departures from SARP when there is finite data, while the SMN approach, measuring whether the Slutsky matrix norm is positive, uses functional data (i.e., the actual DGDF). It follows that a global connection between both approaches must rely on how to extend a data set O K = {p k , w k , x k } K k=0 to the whole region Z. The set of extensions can be very large, generally infinite. So our first interest is to know if a data set that violates SARP, when extended, produces a Slutsky matrix function that is nonrational. Also, we are interested in the question of whether a demand function with a nonrational Slutsky matrix will be able to generate a data set that violates SARP. The answer in the affirmative is provided by Proposition 0, which follows from three well-known characterizations of rationality, the ones by Afriat, Hurwicz-Richter, and Hurwicz-Uzawa, when adapted to a limited data set O K .
Proposition (0) The next three statements are equivalent: 1. A given data set O K with K ≥ 2 has at least a revealed demand cycle. 2. All elements x ∈ X K (Z) of the set of extensions of the data set either violate Weak WARP or violate VARP. 3. All elements x ∈ X K (Z) in the set of extensions of the data set have an associated Slutsky matrix that fails at least one Slutsky regularity condition (σ, π or ν).
We will show only that (1) is equivalent to (3), in the following lemma.
Lemma 1 Any given data set O K = {p k , w k , x k } K k=1 for K ≥ 2 contains at least one revealed demand cycle if and only if all elements x ∈ X K in the set of extensions have an associated Slutsky matrix function that fails σ, π or ν.
Next, we draw connections between some properties of the Slutsky matrix function for the set of extensions of a finite data set O K and the length of the revealed demand cycles. We proceed next to draw connections between revealed demand cycles and properties of the Slutsky matrix function: Corollary 1 A necessary and sufficient condition for some data set O K = {p k , w k , x k } K k=1 for K ≥ 2 observations to contain at least one revealed demand cycle is that the true DGDF x has an associated Slutsky matrix function that fails σ, π, or ν.
Several brief remarks are in order: Remark 1 Our argument in the foregoing corollary applies the reasoning of Afriat's and Varian's theorems in a slightly different manner by showing that there cannot exists a Walrasian demand completion x ∈ X K (Z) that at the same time can be rationalized by a utility function and made compatible with a data set that contains a revealed demand cycle. This result implies that, when there is a data set that can be rationalized in the sense of Afriat, we can find at least one demand function completion that can be rationalized in the sense of Hurwicz and Uzawa (1971).

Remark 2
The proofs of Lemma 1 and Corollary 1 use Hurwicz and Uzawa (1971) integrability theorem to define a utility function for an arbitrary compact set Z ⊆ P × W instead of locally relying on a specific cycle. In other words, for the case of a data set that can be rationalized, there is at least one element x ∈ X K (Z) that has a Slutsky matrix function that satisfies the regularity conditions σ, π, and ν. Therefore, we can identify such an element x ∈ X K (Z) as the outcome of maximizing a unique quasiconcave utility function subject to a linear budget constraint.

Slutsky matrix norms for finite data: classifying consumer behavior
There is a need to classify experimental data sets about consumer behavior in a useful way, in order to understand how rationality is being violated. The SMN (Slutsky matrix norm) approach, developed in Aguiar and Serrano (2017), provides a natural way to do this since the SMN can be decomposed additively in terms of the intensity of violations of the Slutsky regularity conditions. The SMN measures the departures from rationality by computing a norm of the smallest perturbing error matrix function E such that S − E is a rational Slutsky matrix. This approach requires functional data (i.e., the knowledge of the true DGDF). However, as will be detailed in this section, the SMN can be modified to be applied in cases where we have access only to a finite data set.
Definition 7 (SMN approach) The measure of bounded rationality for a given Slutsky dz is the weighted Frobenious norm with W (z) a (positive semidefinite and symmetric) weighting matrix and μ a probability measure on Z that is assumed to be measurable. The two main results of Aguiar and Serrano (2017) are that any Slutsky matrix function can be decomposed into two parts, a rational one and a behavioral error part. In fact, S = S r + E where S r = S σ,π,ν is the projection of S on the space of matrix functions that satisfy all three Slutsky conditions and E is the sum of three orthogonal complement matrix functions, namely, E = E σ + E π + E ν . Here, E σ measures the violations of symmetry, E π corresponds to the violations of π , and E ν captures the violations of NSD. Finally, the Slutsky matrix norm is decomposed in three parts Recall that we have the following relations: 9 • (i) If Weak WARP holds, then ||E π || W = 0 and ||E ν || W = 0 (i.e., the Slutsky matrix is negative semidefinite and singular in prices). 10 • (ii) If the Ville Axiom holds, then ||E σ || W = 0 (i.e., the Slutsky matrix is symmetric). • (iii) If homogeneity of degree zero holds, then ||E π || W = 0 (i.e., the Slutsky matrix is singular in prices). • (iv) If the Wald axiom holds, then ||E ν || W = 0 (i.e., the Slutsky matrix is negative semidefinite).
The decomposition in Aguiar and Serrano (2017) remains meaningful in finite data sets. Proposition 0 has the strong implication that, if the true DGDF violates one of the axioms of revealed preference, then all of the extensions of O K for any K have a positive value for the corresponding Slutsky matrix norm. We shall pursue such extensions as an interpolation exercise given the limited data set, and we shall typically seek interpolators that minimize the Slutsky norm. In doing so, the actual value of the decomposition is also exhibited. We shall close the section with a different approximation exercise: instead of seeking extensions in the set of all allowable demands, we shall approximate this functional space by means of Sieves spaces, of help for computational purposes. In what follows we will fix W (z) = 1, without loss of generality, and we denote the corresponding matrix function norm as || · ||.

The minimal Slutsky matrix norm of a limited data set
We first provide a way to measure by how much a limited data set departs from rational behavior. We define the least distance from any given data set extension to rationality under the SMN: The measure of bounded rationality for a given data set O K is given by where E x is the Slutsky error matrix corresponding to an extension x ∈ X K (Z).
We denote α * (O K ) as α * K for short, as we fix the data set O K . This is the smallest SMN-distance possible to rationality from any demand function that interpolates a data set. With the minimal Slutsky matrix norm, a classification of nonrational behavior is provided on the basis of the properties of the set of extensions. The minimal SMN is additively decomposable In the rest of the section we provide the statements and discussion of our main results.

Proposition 1 A test for rationality in limited data sets corresponds to the minimal
This result provides the first measure of bounded rationality that is additively decomposable into necessary conditions for rational behavior.
Notice also the following key (but direct) property of the Minimal SMN: In addition, the minimizers of the problem posed in Proposition 1 are interpolators of demand data that have interesting properties in their own right. Specifically, we can understand Proposition 1 as a generalized integrability result in the following sense: Proposition 2 If x K , * ∈ argmin x∈X K (Z) ||E x || 2 then: • x K , * can be rationalized (by a twice continuously differentiable strictly concave locally non satiated utility function) when α * K = 0. • x K , * can be generated by maximizing a complete, regular Quah (2005) The first two cases considered in Proposition 2 provide two different notions of rationalization of a finite data set. The third case is different because it does not have an explicit notion of maximization. In fact, it can be compatible with utility minimization subject to a linear budget constraint (Hurwicz and Richter 1979). One could view the scalar function φ as a mapping that is sufficient for describing demand behavior locally. In particular, it can be interpreted as a function describing local preferences in the sense of Balasko and Tvede (2010) by means of a vector field. The classification of consumer behavior on the basis of the Slutsky properties is presented in Table 1. Observe that not all possible combinations have been studied. Those that have a full characterization were presented in Proposition 2. For the rest, (a) Shafer (1977) provides an example of a demand that is homogeneous of degree zero -HD0-but fails σ, ν. In particular, he proposes the following demand system for L = 3 and c > 1: (2014) with a Cobb-Douglas/CES utility and linear attention is an example of failures of σ, π while satisfying ν (Aguiar and Serrano 2017). In particular, the following Cobb-Douglas sparse max satisfies this property: , with a psychological price (e) If E σ = 0 under Walras' law it implies E π = 0 because p S( p, w) = S( p, w)p then HD0 must hold when Z is connected due to Euler's Homogeneous Function Theorem.

Computing the minimal Slutsky matrix norm: limiting behavior and sieves spaces
We next provide an upper bound (possibly not the sharpest one) that helps to compute the error of the Slutsky matrix norm associated with the error of the extension of a data set. Notice that these extensions are deterministic and they pass through all observed points; the error is with respect to the true DGDF in a domain of interest, assuming that the true DGDF is sufficiently smooth.
Here we analyze how to provide an upper bound for the distance between the true value of E = a(x) for the DGDF and the finite sample values that we could get from any extension of O K , say x K ∈ X K (Z). For a given sample and an extension (e.g., if x K is a cubic spline interpolator), we usually have some information about the upper bound of the error ||x − x K || ≤ K . That is, while the error is zero at the points in O K , it may be positive in other points in the region Z. Under mild assumptions, such as smoothness of the DGDF, there are known upper bounds for K for several interpolation techniques. In the next result we use this information to bound the distance of the values of the Slutsky error map a(·) for any given extension x K .

Proposition 3 For every O K , with x denoting its true DGDF and any extension x K
In other words, if we have enough observations such that K is small enough, the Slutsky matrix norm of any interpolator for that data is close enough to the value of the Slutsky matrix norm of the true DGDF. Continuity of the Slutsky matrix norm error is established in Claim 2 in the "Appendix".

Remark 3 We can allow a family of interpolators based on the SMN. For each set
We say that x * ≡ lim K →∞ X K is the true DGDF, the unique limit of the sequence of extensions. Therefore, lim K →∞ [α K min , α K max ] = {α * }, the measure of bounded rationality at the true DGDF.
Next, we present a result that differs from the previous ones in one important respect. Namely, keeping the data set O K fixed, we do not consider all its unrestricted extensions. Rather, we approximate the space of functions where we search for the minimal Slutsky norm interpolator demand function. Such an approximation result helps in the practical implementation of the results provided in Proposition 1. The test provided in that result is a variational problem that has no closed-form solution. To be able to implement this test numerically, we have to ensure that we can approximate the result with a limited functional space. In fact, consider an increasing sequence of sets of This is usually called a Sieves space (e.g., think of a space of polynomial functions approximating our space of demand functions, in which h is the highest degree of the polynomial). We define analogously the allowable set of extensions of a data set X K h (Z) = X K (Z) ∩ X h under the h th approximating space. We only consider the case when X K h (Z) is nonempty, in other words, h is sufficiently large to guarantee nonemptiness given the data set. The next result shows that the correspondence of Slutsky norm minimizers is "continuous at h = ∞" , or more formally, a consistent approximation.

Remarks on computational complexity
The results in this section provide guidelines for practical work. If we have a large data set (with K large enough) we could use any interpolator, possibly a fast one for computational reasons, and it will be close to the true DGDF and the distance to the true Slutsky matrix norm will be small as well. In contrast, if K is small, we could use a large Sieves space (h large enough) to find an interpolator that has a Slutsky matrix norm that is close enough to the lower bound of the true value. We emphasize that the computational complexity of Spline Interpolation for order of polynomials h, which is an example of a sieve space, and for K interpolation points is O(h 2 K ) for the univariate case (Toraichi et al. 1987). In the multivariate case, we consider tensor products of univariate splines that depend on the dimension of the consumption space L. Since the derivatives of the interpolator can be obtained in a recursive way from the splines basis, in practice the derivation step adds no substantial computational time, other than evaluation, which can be vectorized in the algorithmic implementation.
The computation of the Slutsky matrix norm is trivial, since Aguiar and Serrano (2017) provide a close form expression for it. The only object needed to compute the Slutsky matrix norm of a given interpolator is the computation of the negative semidefinite part of a matrix and its residual E ν at all points in the data set. The complexity of the pointwise eigenvalue decomposition of the Slutsky matrix of size L × L is O(L 3 ) (Pan and Chen 1999). In this sense, our approach permits the user to adjust the computational complexity of its computation with a sacrifice in numerical precision. By choosing low degree spline interpolation we are effectively close to a parametric exercise, close in spirit to Halevy et al. (2014). In contrast, by increasing the size of h we approximate a fully nonparametric approach to bounded rationality. Our approach will become computationally more complex when the consumption space dimension grows. In this regard, the computational flexibility of our approach ought to be contrasted with the computational complexity of other methods to measure departures from rationality. Namely, the Money Pump Index is known to be NP-hard (Dean and Martin 2015), and the Minimum Cost Index is also NP-hard (Shiozawa et al. 2015). The AEI does not suffer from the computational issues of the indices just mentioned.

Simulation study
In order to complement our results for the computation of the minimal Slutsky norm interpolators in finite samples with restricted functional spaces (e.g., piecewise polynomial interpolators of finite degree), we provide a simulation study of the behavior of the testing procedures provided in Sect. 4 for a small number of observations and for interpolators chosen from small functional spaces. The results are encouraging. They exhibit fast convergence when the true DGDF corresponds to a classical boundedly rational model proposed by Shafer (1977): . The parameter c ∈ R controls the violations of rationality. When c = 0, this demand system corresponds to a rational Cobb-Douglas consumer with the same preferences over the first two goods and no interest in consuming the third one. Homogeneity of degree 0 and Walras' law hold for all values of c. For 0 < c < 1, the only property of the Slutsky matrix being violated is symmetry (σ ). For c > 1, both symmetry (σ ) and NSD (ν) fail.
We implement our simulation study in the budget-share form of this demand function, and we focus on computing the lower bound of the budget-share elasticities version of the Slutsky matrix norm (Aguiar and Serrano 2017). Formally, the budget-share elasticity Slutsky matrix norm is the Slutsky matrix norm with a weight matrix W ( p, w) = 1 √ w diag( p). This variant of the Slutsky matrix norm is unit-free. The Slutsky matrix norm is the unknown quantity of interest that we want to bound below, and in general, to obtain a good approximation, we use where || · || M,W is the weighted Frobenious matrix norm in the space R L×L , and μ : Z → [0, 1] is a probability density function that corresponds to the sampling scheme chosen by an observer of prices and wealth. For us, μ(z) corresponds to a probability density such that the vector log(z) has a multivariate normal distribution probability formed as the product of L + 1 normal distributions with zero mean and standard deviation 1/20.
Notice that μ is known to the experimenter because it is the sampling scheme generator process. The choice of this particular distribution is irrelevant and we do not need to estimate it. We note that our exercise is deterministic.
In practice, the observer obtains only a finite sample O K = {p k , x k } K k=1 such that w k = p k x k and in this example x k = x s f ( p k , w k ). We obtain the budget shares of the data b k l = p k l x k l /w k . The budget-share form of the demand system expressed in terms of logarithms of prices and logarithm of wealth, which we take as the true DGDF is: (w)). Here, the vector entry ln( p) i = ln( p i ). The Slutsky matrix at a point ( p, w), in its budget-share elasticity form, can be computed for numerical stability purposes from the budget shares expressed in terms of logged prices and wealth as follows: where δ i j = 1 if i = j and zero otherwise. Using corollary (1) we approximate the lower bound of ||E s f || W for the fixed sample O K . The lower bound is α K = min x∈X K (Z) ||E x || W where X K (Z) is the set Table 2 Numerical approximation of the square of the minimal Slutsky norm of a set of extensions, for different sample size and different size of functional space of interpolators of extensions of O K that belongs to X (Z ). We expand on the methodological details in "Appendix" (9.8).
The effects of the number of observations and polynomial degrees on the accuracy of the estimation We obtain a random sample of size K ∈ {20, 50, 100} i.i.d. draws from μ(z) and x s f with its budget share b s f such that we obtain: The key parameter c is fixed at three different values c ∈ {0, 1 2 , 2}, to generate different intensities of both types of violations (i.e., of σ and ν). We estimate the Budget-Share Slutsky matrix, The results of the simulation are provided in Table 2 and show that even for K = 50, which is a common data set size (see Ahn et al. 2014) the SMN test works as well as the revealed preference test. In addition, the quality of the approximation to the true value increases in both the sample size K and the degree of the polynomial h. The effects of sample size on the decomposition of violations A key feature of our methodology is the decomposition of the size of bounded rationality into its components (σ, π, ν). By construction, we can obtain the lower bounds of each type of violation. In this example the approximated values will be contrasted with the true values to show that the performance of our procedure is encouraging here as well. For concreteness, we present only the results for h = 5 for each element of the decomposition in a vector. The results of the simulation are provided in Table 3 and show that even for K = 50 we can get small absolute errors when estimating the SMN using standard non parametric estimators of the conditional expectation. In any case, the results of these simulations are encouraging in terms of their speed of convergence of an out-of-the-box estimator of the SMN to its true value.

Relation to AEI
We continue our simulation study, looking at the comparison between the popular AEI and the minimal SMN. We consider only h = 5 and K = 50, while the data generation of prices and wealth is the same as in the previous sections. We allow the bounded rationality parameter in the Shaffer model, c to take values from 2 to 20. We chose the c parameter numbers to get a range in the AEI roughly from 0.99 to 0.95. We observe that both the AEI and the minimal SMN grow monotonically in the c parameter. In this sense, both the AEI and SMN are ordinally equivalent for this example. We provide a formal study of the connection between the two indices in the sequel. Here we confine ourselves to the numerical properties of the measures of departures from rationality. Afriat (1973) considers that a high AEI (very close to 1) is evidence of a high goodness of fit of the rationality consumer. Although there is no formal threshold of when to consider that the AEI is high enough to be deemed close to rationality, it is common to use a threshold of 0.95 or 0.99. 11 Our results presented in Table 4 provide numerical evidence that very high levels of the AEI (0.965), which are usually interpreted as evidence in favor of the rationality hypothesis, can be associated to data sets with a very high SMN. Recall that a high SMN implies that the modeller is making a high prediction error. In fact, the α minimal SMN measures the minimal error a modeller would make in predicting the elasticity behavior (for price changes when they are compensated in the Slutsky sense) under the assumption of rationality. Indeed, we observe that in the worst case, which corresponds to a parameter c = 20, the minimal SMN calculated using our methodology is α = √ 1960.243 = 140.01. Our numerical computation of the minimal SMN is very close to the true value (α 50,5 = 140.008). When the AEI is very high (0.9999) we have an associated SMN index of α = √ 0.511 = 0.71, which is smaller, but still sizeable. Our numerical computation of the SMN is very close to the true value (α 50,5 = 0.716). 12 We emphasize that, beyond the obvious benefits of having different measures of rationality to evaluate whether we can consider a data set close to the null of utilitymaximizing behavior, the SMN provides a useful decomposition of the measure into the Slutsky regularity conditions. We observe that for most values of the parameter c, the error that corresponds to violations of the law of demand (ν) are more important than the violations that correspond to the property σ . We also observe that higher values of the bounded rationality parameter c are associated with a higher relative weight of the violations of the law of demand in terms of the total SMN. We can observe how this information provides us with an additional insight about the nature of bounded rationality in this model. If a modeller wants to effectively predict the elasticity behavior of this boundedly rational consumer, she should drop the regularity conditions ν and σ , with a priority on the former.

Applications to experimental data sets
We used the methods developed in this paper in the online Supplement to Aguiar and Serrano (2017). In particular, we compute the Minimal SMN for the experimental data set of Ahn et al. (2014), which consists of K = 50 budget allocation tasks regarding the purchase of Arrow securities.
In that experimental data set, we find evidence that the violations of ν are less prevalent in the sample than the violations of σ . The violations of π are not possible due to the experimental design. We refer the reader to the online Supplement to Aguiar and Serrano (2017) for details.

The SMN and its local convergence to the afriat approach through the Jerison-Jerison index
The most well-known measure in the RP approach is the AEI. An important question is how the Slutsky matrix norm relates numerically to this index. We provide its definition. : Definition 9 (Afriat Effiency Index, AEI) The AEI of a data set O K , with at least one C D,T with T ≥ 2 is: and zero otherwise.
AEI is such that G ∈ [0, 1] and researchers interpret its measure as a "loss of efficiency" or distance from a rational behavior benchmark: the larger it is, the larger gap between actual expenditure and expenditure on a nonchosen bundle that becomes chosen for different prices, suggesting strong swings of (irrational) behavior. For a fixed cycle C D,T we call min t∈{0,..., The connection between the SMN approach and AEI is established through the Jerison-Jerison modified Slutsky matrix index. Indeed, an earlier approach, also based on the Slutsky matrix, is proposed in the work of Jerison and Jerison (2012), where a local measure of departures from rationality is proposed in the form of a family of indices.

Definition 10 (JJ-Index) The Jerison and Jerison index is defined as
where S( p, w) is the Slutsky matrix evaluated at a reference point ( p, w) ∈ P × W and {v t } T t=0 is a collection of v t ∈ R L vectors such that v 0 = v T . Jerison and Jerison (2012) establish a remarkable connection between Afriat's inefficiency cost measure of irrationality and the JJ index. Both coincide in a local ball around some price and wealth reference point. Here we will revisit this result, showing that their measure can be seen as a quadratic form associated with the minimal correcting matrix E from Aguiar and Serrano (2017).

A generalization of the slutsky matrix norm
Our intent in this section is to focus on a generalized SMN that has as a special case the index of Jerison and Jerison (2012), and relate it to the Afriat index. The space of matrix-valued functions M(Z) has some nice properties associated with the Slutsky regularity conditions σ, π, ν. As shown in Aguiar and Serrano (2017) the spaces M(Z) σ of symmetric matrices, M(Z) σ,π of symmetric matrices that are singular in prices, and M(Z) σ,π,ν of symmetric, singular in prices, and negative semidefinite matrices are closed and convex subspaces under the topology induced by the Weighted Frobenius norm. Using the weighted inner product F, H W in the space, we define the projections of any Slutsky matrix S ∈ M(Z) on the spaces of interest. With it, we have the same unique orthogonal decomposition as in Aguiar and Serrano (2017) with S = S r + E with E = E σ + E π + E ν . However, it is possible to change the norm, in fact we can use any pseudonorm or quasinorm to compute our measure of bounded rationality.

Definition 11 (Generalized Slutsky Error Seminorm)
A generalized Slutsky error seminorm is a mapping = n • a such that is the composition of a n : M(Z) → R + seminorm on the space M(Z) and the Slutsky error mapping a : X (Z) → M(Z) (i.e., a(x) = E).
We establish now that the JJ index can be obtained as a subcase of the Generalized Slutsky error seminorm. The JJ index definition depends on the Slutsky matrix S = S r + E, not only its error matrix E. Ideally, we want a measure of violations of rationality that depends only on the departures of rationality and on nothing else (i.e. on the matrix E and not on the matrix S r ). We show this is the case for the supremum of the JJ index. We next prove a nice feature of the discrete JJ index that, to the best of our knowledge, had not been previously pointed out.
Recall from Aguiar and Serrano (2017) that E = E σ + E π + E ν is defined as the minimal perturbation matrix function that yields a rational Slutsky matrix function, decomposed in its symmetry, singularity, and NSD error parts. Then: j ( p, w)).

Lemma 3 The JJ index is equal to
This result shows that the JJ index can be decomposed additively into the JJ index of a rational Slutsky matrix, which is always nonpositive γ ({v t } T t=1 , S r ( p, w)) ≤ 0, because the eigenvectors of S r are all nonpositive and the JJ index is an average of quadratic forms, and an unsigned, sometimes nonnegative, part (i.e., it may be nonnegative for some cycle {v t } T t=1 ).
Looking at the case of infinite data sets, we can begin with a local result, and then provide a global connection as well. Jerison and Jerison connect the JJ index with the Afriat index. Here we establish the connection with the SMN using our previous result. We define V T ( p ) as the set of sequences of the type {v t } T t=0 where v t ∈ V ⊂ R L . The set V is compact, v 0 = v T and T ≥ 1 is fixed. Additionally, defining p t = p + v t and |v t | = |p − p t | ≤ p for all t ∈ {0, . . . , T }, we require that the related cycle be the set of cycles of the type {v t , u t } T t=0 where u t = w t − w such that |u t | ≤ p η. Using this notation, we can rewrite the Afriat index of an RP cycle as G (( p, w) , the supremum over the Afriat inefficiency index if we are allowed to sample price and wealth at will). Now we establish the desired result regarding the supremum of the JJ index in V T ( p ) and its relation with the Generalized Slutsky error matrix norm. (v, S( p, w)

Lemma 4 Given a set of cycles V T ( p ) and for a fixed T ≥ 1 we have the supremum of the JJ index sup{γ
The statement says that the supremum of the JJ index is the composition of a pseudonorm on the space of matrix functions and the mapping a, because it only depends on the matrix E. This holds only if V T ( p ) is a compact neighborhood. Evidently, the SMN is a special case of the generalize definition that we have proposed in this subsection. The SMN is essentially the only norm that is associated with the inner product of the space M(Z), and for that reason, it provides the orthogonal decomposition that allows us to classify violations of the Slutsky regularity properties, but in some cases like the present one we can investigate other norms to understand its connections with other notions of "distance" from rationality.

Convergence results
With the previous results in hand, the next result requires that the analyst be able to sample at will from prices and wealth and that the Slutsky matrix be known at the reference point, which requires infinite data. In contrast, we have been assuming in this paper that we are given a data set O K so the sampling process is given. Hence, the next proposition should be seen mainly as a way to connect theoretically the traditional RP Afriat inefficiency measure of rationality and the SMN approach in arbitrarily large data sets. In words, it says that when the ratio p → 0, the Afriat inefficiency index converges to zero at the rate of −2 p , in proportion to the supremum of the JJ index in the set of cycles considered. The key assumption is that wealth across the path is such that |w t − w| ≤ p η: Proposition 5 Given a set of cycles V T ( p ) and V T ( p ,η) w , for a fixed T ≥ 1, the Afriat inefficiency index converges to zero proportionally to the supremum of the JJ index of the Slutsky matrix error norm E( p, w):

The behavioral nearness problem and the "Almost Implies Near" principle
We refer to the problem of trying to find the closest rational demand to a given demand as the "behavioral nearness" problem (Anderson 1986). At a general level, as discussed in Aguiar and Serrano (2017), the behavioral nearness problem presents several serious difficulties, which was our motivation to take the Slutsky matrix route. Intuitively, there should be a close relationship between the two approaches. In order to make this relationship explicit, we will make extensive use of Anderson (1986) "almost implies near" (AN) principle and its recent elaboration, developed by Boualem and Brouzet (2012). At the end of the subsection we adapt the principle to finite data sets.
Assume that the set of demand functions X (Z) is equipped with the norm be the set of rational demand functions (i.e., x r ∈ R(Z) is the solution to maximizing a complete, locally nonsatiated and transitive preference over a linear budget constraint).

Definition 12
Define the distance of x ∈ X (Z) to the set of rational demands R(Z) by the "least" distance from an element to a set: The matrix nearness problem allows us to represent property R-a shorthand to refer to the Slutsky regularity properties-by the Slutsky correction map a with the AN property, as defined next.
Definition 13 (Boualem and Brouzet 2012) A function a : G → Y (with G and Y metric spaces) satisfies the "almost implies near" (AN) property at C ∈ Y , if for all > 0, there exists δ > 0 such that for every g ∈ G, the inequality ||a(g) − C|| Y < δ implies the existence of an element g 0 ∈ G satisfying a(g 0 ) = C and ||g 0 − g|| G < .
The Slutsky correction mapping a : X (Z ) → M(Z ), with X (Z ) and M(Z ) as defined above, represents property R when for every x ∈ R(Z ): where 0 represents the zero matrix function of L × L dimension in the metric space M(Z ), and E = S r − S denotes a solution of the program in the definition of the Slutsky norm. The analytical expression of the (unique) solution to such a problem, as well as its properties, were derived previously (Aguiar and Serrano 2017).
The "almost implies near" (AN) principle allows us to assert that for all > 0 there exists δ > 0 such that for all x ∈ X (Z ), whenever a(x) = E and ||E|| < δ, one can find x r ∈ X (Z ) such that a(x r ) = 0 and ||x − x r || C1 < . In the name of the principle, the "almost" part refers to δ > 0 or property R being δ-satisfied (matrix nearness), and the "near" part to > 0 (behavioral nearness). 14 Given the additional restriction that X (Z ) is compact, we have the following result, which links the Slutsky matrix norm approach with the Varian and Jerison-Jerison measure of the "least distance" to the closest rational demand function in the compact subset X (Z ).
Proposition 6 For all > 0, there exists δ > 0 such that for all x ∈ X (Z ), the inequality ||E|| ≤ δ implies the existence of a rational demand function x r 1 ∈ X (Z ) satisfying a(x r 1 ) = 0 and ||x − x r || C1 ≤ . Moreover if δ → 0 then (δ) → 0. Thus, there is an ordinal equivalence between the two problems, in the sense that if one takes two degrees of approximation 1 ≤ 2 , we have that δ 1 ≤ δ 2 . We underscore the fact that the AN property is stated for every > 0, not necessarily arbitrarily small, and therefore, we are able to account for violations of rationality of any "size". In particular, we have established an equivalence of testing rationality in the behavioral nearness setting as in Epstein and Yatchew (1985) and in our Slutsky matrix norm framework.
For the case of finite data sets, this result can be used to establish the equivalence between the behavioral nearness problem and the Minimal SMN.

Definition 14 (Finite data behavioral nearness)
The behavioral nearness measure of bounded rationality for a given data set O K is given by We can establish the following corrollary.
Corollary 3 For all > 0, there exists δ > 0 such that for all O K , the inequality

Literature review
The current research is related to the work initiated by Chiappori and Rochet (1987), Matzkin and Richter (1991) and culminated by Lee and Wong (2005) that prove the equivalence of SARP and rationalization by a smooth demand generated by maximizing a smooth utility function. Their work unifies the binary tests of rationality from both RP and smooth approaches. Our results focus on the realm of quantifying departures from rationality. In particular, we provide a minimal Slutsky norm interpolator of any finite data set, in the form of a continuously differentiable demand. When the data set satisfies SARP, then the minimal Slutsky norm is zero and the interpolator can be generated by maximizing a twice continuously differentiable utility function as in Hurwicz and Uzawa (1971). Our results provide a more general sense of integrability, since if the data set fails SARP but satisfies WARP (known also as Weak WARP), the minimal Slutsky norm interpolator can be generated by regular preferences in the sense of Quah (2005), that are nontransitive. Also related is the recent work of Nishimura et al. (2013), which provides a bridge between the revealed preference approach for limited data sets and the Richter congruence axiom (1996) for complete data sets. Jerison and Jerison (2012) is the closest work to ours. They provide a study of the relation of the Slutsky matrix and revealed demand cycles that generalizes the findings of Shafer (1977). However, our work differs fundamentally from Jerison and Jerison (2012), among other things, in that we assume a finite data set of prices and observed choices, while these authors assume an infinite amount of observations. Because we never have access to infinite data, our work is the first to allow the use of the Slutsky matrix in a laboratory data set environment.
We have provided a complementary framework to the RP approach to testing consumer behavior, as initiated by Varian (1983), Afriat (1973), and continued in the works of Echenique et al. (2011), Dean and Martin (2015), Apesteguia and Ballester (2015) and others. Our measure differs from this tradition in that ours is a positive measure of bounded rationality, in contrast to the more common welfare or normative approaches to measure bounded rationality, which implicitly assume that the consumer wants to optimize, failing in his goal. In contrast, we are concerned with failures in doing comparative statics analysis for any given consumer behavior when we assume rationality (possibly contrary to the fact).
We leave as an open avenue of research to relate our results with the contribution of Halevy et al. (2014), which proposes a parametric procedure to recover preferences based on minimizing a measure of behavioral closeness that considers the specification error (due to the choice of a parametric family) and an inconsistency index that uses the money-metric notion (a normative index of distance from rationality). We conjecture that we can replace the money metric by a parametric Slutsky matrix norm to produce a demand function that minimizes the comparative statics errors in prediction given the rationality restriction and the data.

Conclusion
We have provided a framework to adapt the results in our companion paper (Aguiar and Serrano 2017) to finite data. In doing so, we have presented a unification of the RP and Hurwicz-Uzawa characterizations of rationality in consumer theory. In particular, we have concluded that: (i) a limited data set that satisfies SARP admits at least one continuous differentiable extension (demand function that interpolates the data) that is integrable in the sense of Hurwicz-Uzawa; and (ii) the violations of the Slutsky regularity conditions by the set of extensions of a limited data set correspond to demand cycles of different length in the RP approach. One advantage of our unified approach is that it allows a classification of consumer behavior. Finally, the modified SMN measure of departures from rationality is a positive or objective index, and as such, it allows interpersonal comparisons. We have tested it in simulations, and applied it elsewhere to experimental data. Our empirical findings are that insisting on the Slutsky matrix symmetry hypothesis leads to making a higher error than assuming its NSD. To the best of our knowledge, this is the first evidence brought forward on the claims of the higher robustness of WARP vis-á-vis the Ville axiom, as already suggested in Kihlstrom et al. (1976).

Compliance with ethical standards
Ethical Statement (i) We declare that our research article is in compliance with the Ethical Standards of the SERIEs and our home institutions The University of Western Ontario and Brown University. (ii) We have not received any funding for this research. (iii) We declare we have not conflict of interest regarding this research. (iv) We do not need an ethical approval as our paper is a theoretical piece. (v) We do not need an informed consent as our paper is a theoretical piece.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Since the demand x ∈ X L (Z) is the maximizer of the utility function u, we have Du(x t ) = λ t p t for λ t > 0 by local non satiation for all t ∈ T . This implies u( Since we have a revealed demand cycle, we have that p t [x t−1 − x t ] < 0 for all t, which implies u(x t ) > u(x t−1 ) for t ∈ {1, . . . , T }. However, the presence of the cycle in the data set also implies that u(x T ) = u(x 0 ), given that x T = x 0 , which is a contradiction. Therefore, every element x ∈ X L (Z) must have a Slutsky matrix that violate either σ, π or ν.

Proof of Lemma 2
Proof First, we establish (i).
Say we observe a finite data set O K K ≥ 3, and we find a strict revealed demand cycle C D,T = {p t , x t } T t=0 , for T ≥ 3. Consider X T ⊆ X to be the subset of demand functions that are consistent with the observed decisions: We know that the DGDF must be an element of X T by Walras' law since p t x t = w t , so we must prove that all elements of X T have at least one Ville Cycle C V (S),b for S ≥ 1.
Assume, to the contrary, that there is at least one x ∈ X T that satisfies the Ville axiom. In particular, this implies that such a function can generate the data set O K and at the same time exhibit no Ville cycles.
The absence of Ville cycles C V (S),b for S ≥ 1 implies by HR that there is an integrating factor λ(x(τ )) that is positive for all τ ∈ [0, b] and a function z : x ([0, b] x(τ )) and with the property that x(0) = x 0 , x(1) = x 1 , . . . , x(T ) = x T and x(0) = x(T ) and similarly p(τ ) goes through all observed prices. Let the distance between observations in the revealed demand cycle define the length of the intervals of the grid τ t+1 − τ t = ||x t+1 − x t || R L , fix τ 0 = 0, and define recursively τ t for t ≥ 1 (i.e., define b = T −1 t=0 ||x t+1 − x t || R L ). Integrating along the path, we have (0)) = 0 by the observation that x T = x 0 . However, by linearity of the integral over an interval, we have . Now, since we have a strict cycle p t x t ≥ p t x t−1 for all t ∈ {0, . . . , T }, and px t > p t x t−1 for some t ∈ {0, . . . , T } and T ≥ 3. Also, by the assumption that there are no cycles C D,2 (T = 2) and no Ville cycles, then there is a quasiconcave utility function z (in fact, strictly quasiconcave since we ruled out revealed indifference) such that This contradicts the result that τ T 0 ∂z(τ ) ∂τ dτ = z(x T ) − z(x 0 ) = 0 since both quantities are numerically equivalent. Therefore, each x ∈ X T violates the Ville axiom so the DGDF must have at least one Ville cycle C V ,b S for S ≥ 1 and some b > 0.
If there are C D,T f or T = 2, then by definition every x ∈ X T fails Weak WARP, because every x ∈ X T has to interpolate the data set that has cycles for T = 2. Then by Kihlstrom et al. (1976) we know that ν should fail for the given extension in Z, since every extension x ∈ X T fails Weak WARP.

Proof of Proposition 1
Proof Observe that the set of extensions X K (Z) = {x ∈ X (Z)|x k = x( p k , w k ) ∀k ∈ {1, . . . , K }} is compact and the objective function is continuous. Then, there is at least one solution to the optimization problem. By Proposition 0, if O K is generated by a rational DGDF, then E x r = 0 for some rational demand x r ∈ X K (Z) and since ||E x || ≥ 0 for all x ∈ X K (Z), then x r = argmin x∈X K (Z) ||E x || 2 . When O K is not generated by a rational DGDF, then all x ∈ X K (Z) have ||E|| > 0 and by construction the value α * K > 0 is the lower bound of the true value of the Slutsky error norm, still part of the set, by compactness. The "moreover" statement dealing with the decomposition of the norm in the different effects follows from Lemmas 1, and 2.

Proof of Proposition 2
Proof The first property follows from Hurwicz and Uzawa (1971) because Z is assumed to be compact, Walras' law holds and E x K , * = 0 which means that the Slutsky regularity conditions hold. Then it follows that x K , * can be generated by maximizing a twice continuously differentiable utility function subject to a linear constraint. By Kim and Richter (1986) and Mas-Colell (1974), this implies that there is a strictly concave locally non satiated utility function. The second property follows from Quah (2005), where it is proved that a demand that has a singular in prices Slutsky matrix that is NSD can be rationalized by preferences that are complete and nontransitive, but that are regular as defined by the author. 16 The third property follows from the proof of Hurwicz and Uzawa (1971) and Jerison and Jerison (1992) that uses only symmetry of the Slutsky matrix, thus ||E σ,x K * || 2 = 0 to construct a scalar function φ : Z → R that can generate the data by the differential equation x( p, w) = −∇ p φ( p, w)/∇ w φ( p, w) (Roy's Identity) such that Walras' law holds. This means that while the demand system is integrable, in this case φ is not necessarily an indirect utility function and in fact its Hessian may not be NSD.

Proof of Proposition 3
Proof Following Aguiar and Serrano (2017), we denote by a(x) = E the map that assigns to each demand function the smallest (in the Frobenius norm sense) matrix that would make its Slutsky matrix function inherit all the regularity properties. Now we prove that the Gateaux derivative for the map a(x) = E exists.
Let a : X (Z) → M(Z), be such that a(x) = E and M(Z)= C(R L+1 , R L × R L ). We are going to prove that a is Gateaux differentiable.
We first prove that s is Gateaux differentiable: ∂s(x+tv) , along direction v ∈ C 1 (Z), the limit exists under the compactness of Z and continuity assumptions on x and its derivatives, where C 1 (Z) is a compact set of continuously differentiable functions that contains X (Z).
The mapping σ,π by Aguiar and Serrano (2017) is linear, The mapping ρ ν by Aguiar and Serrano (2017) is a polar-projection, and by Higham (1986) (theorem 2.5) this projection is Gateaux differentiable ∂ ν (S+t V ) ∂t | t=0 = L ν (S, V ) exists and is a linear operator in the space of matrix functions V ∈ M(Z).
By the Gateaux derivative chain rule ∂a(x+tv) ∂t | t=0 = a (v) exists and is defined as Notice that letting = ν • σ,π and ι the identity function in the space of matrix functions, we say that ∂(ι− )(S+t V ) ∂t | t=0 = L r (S, V ) it exists by the previous argument. Then a (v) = L r (s(x), s x (v)) by the fact that a (v) is linear. We define κ = ||a || = max v∈C 1 (Z) ||a (v)|| we know this bound exists because of the compactness of C 1 (Z) and continuity of a (it is linear). The intermediate value theorem for the Gateaux derivative between Banach spaces says that ||a(x) − a(x K )|| ≤ ||a || · ||x − x K ||.
Let ||a(x) − a(x K )|| = η, then η ≤ ||a || · , with ||a || ≤ ||ι − || · ||s ||. We can get a sharp upper bound for the norm of the map a , estimated, as follows. Notice that , being a projection map, has by definition || || ≤ 1. Further, ι − is also a projection to the orthogonal space of the projection , and hence, ||ι − || ≤ 1. Also, ||s x || = We have established so far that any x ∈ X K can be approximated by a sequence with elements x h ∈ X K h . Now, we notice that a is continuous under the C 1 norm on X (claim (3) in the "Appendix"), and that means that ||E x || : X K → R + is also a continuous mapping under these conditions, by Theorem 3.1 in Chen (2007) 18 we conclude that α * h → α * as h → ∞, and by Wong (1984) 19 (theorem 2.5) we also conclude that for any x * ∈ argmin x∈X K

Continuity of the Slutsky error map
Claim 2 The map s : X (Z) → M(Z) defined as s(x) = S is continuous.
Proof First, we will prove that D p : X (Z) → M(Z) and D w : are not only closed linear operators, but are also continuous maps. In general, differential operators are closed but not continuous. However, in this specific domain, D p , D w are defined everywhere by assumption, additionally D p and D w are closed operators, and finally X (Z), M(Z) are Banach spaces with the norms || · || C1 and || · || respectively, and so is C(Z , R L ), the space of continuous functions f : Z → R L with supremum norm || · || ∞,L . Then, by the closed graph theorem, we can conclude that D p and D w are continuous maps. Second, take a convergent sequence in X (Z), {x n } n∈N → x. To finish the proof we want to show that lim n→∞ s(x n ) = s(x). By continuity of D p , D w and by the properties of the limit of a product of vectors, it follows that lim n→∞ s(x n ) = lim n→∞ D p x n + lim n→∞ D w x n [lim n→∞ x] = S, where s(x) = S, thus proving continuity of s.

Claim 3
The map a : X (Z) → M(Z) defined elementwise as a(x) = S − S r is continuous.
Proof The continuity of the map a follows directly from the continuity of the Slutsky map s and the continuity of the projections maps that generates S r . Formally, a = • s where = (ι − ρ ν • ρ π • ρ σ ) is a projection mapping, ι is the identity map in M(Z) and ρ σ is the projection on the space of symmetric matrices, ρ π is the projection in the space of symmetric matrices that are singular with prices in its eigenspace associated with the null eigen-value, and ρ ν is the projection on the space of symmetric, singular in prices and negative semidefinite matrices. By Claim 2, we know that s : X (Z ) → M(Z ) is continuous. It remains to show that the projection maps are indeed continuous. For this we need that the range of the projection map is a closed subspace under the metric induced by the norm of M(Z ). In Aguiar and Serrano (2017) this is proven to be the case for each projection, in fact each range is convex and closed. It follows that a is continuous.
variable with respect to which we want to differentiate, say ln( p 1 ), derive the univariate B-spline corresponding to ln( p 1 ) and obtain the tensor product with respect to the remaining B-splines (for ln( p 2 ), ln( p 3 ), ln(w)) to obtain a matrix B l,ln( p 1 ) of dimension K × H , 20 the partial derivative of the budget share b l with respect to ln( p 1 ) at the data points, or the vector b l, p 1 = { ∂b l (ln( p),ln(w)) ∂ln( p 1 ) | p= p k ,w=w k } K k=1 can be obtain by multiplying B l,ln( p 1 ) a = b l, p 1 for the same vector of weights as before. Using this procedure for all partial derivatives, we can obtain the Slutsky matrix evaluated at the data points. We call it S b ( p k , w k ) to denote its dependence on a given extension in the restricted space. 5. We obtain the Slutsky error matrix E b ( p k , w k ) (applying the formula in Aguiar and Serrano (2017)) for each data point and we approximate the integral ||E s f || W , by the numerical approximation ||E b h || W = 1 K K k=1 ||E b ( p k , w k )|| M,W for any given b h ∈ X K ,b h (Z). 21 6. We use a Spectral Projection Gradient (SPG) large scale optimization algorithm to solve this optimization problem. The reader can notice that the minimization is with respect to the weights with a fixed X K ,b h (Z). (a) We initialize the algorithm by finding a feasible point, that is we first find any extension x 0 ∈ X K ,b h (Z), and then we use it as an starting point for finding the extension with the minimal Slutsky matrix norm. (b) For this last point we provide more details. The problem of finding the Minimal SMN for a finite data set is possibly non-convex: α * K = min x∈X K (Z) ||E x || 2 (SM N 1).
The mapping E x is not concave on the demand x ∈ X K (Z). We note that the restriction that x ∈ X (Z) implies that x ∈ X (Z) and h k (x) = x( p k , w k ) − x k , such that h k (x) = 0 for all k = 1, · · · , K . Let h(x) = (h k (x)) K k=1 ∈ R K . The euclidean norm in R K is denoted by || · || R K .
We can follow Bertsekas (1979) to pose the following penalized problem, for a given constant c > 0: From Bertsekas (1979) we know that: (i) For any c > 0, if x * ∈ X (Z) solves SMN2 then it solves SMN1. (ii) For any c > 0, the Minimal SMN associated to SMN1 is equivalent to the minimal SMN associated with SMN2, i.e., α * K c = α * K . Finally, (iii) for c > 0 sufficiently large, there exists a unique solution to SMN2. We have transformed the non-convex SMN1 problem into a strictly convex problem SMN2. For practical purposes c > 0 can be chosen as a very high positive number. For any c > 0, the decomposition of α * K c = α σ * K c + α π * K c + α ν * K c is going to be close to the true decomposition ||E x r || 2 = ||E x r ,σ || 2 + ||E x r ,π || 2 + ||E x r ,ν || 2 , for the DGDF x r , when K is large as in Proposition 3. This is true, because the distance between the DGDF and the interpolator that solves SMN2 (and SMN1) converges to 0. In practice, the practitioner can pick a sufficiently large c > 0 and solve the problem above in terms of its b-Spline approximation.

Proof of lemma (3)
Proof Aguiar and Serrano (2017) prove that we can decompose any observed Slutsky matrix in two components S = S r + E locally. Then we can write γ ({v t } T t=1 , S) = γ ({v t } T t=1 , S r ( p, w)+ E( p, w)) at the point ( p, w). Then we observe that the JJ index is linearly separable 1 E( p, w)).

Proof of lemma (4)
Proof Notice that by subadditivity of the supremum sup v γ (v, S( p, w)− S r ( p, w)) ≤ sup v γ (v, S( p, w)) − sup v γ (v, S r ( p, w)) and by the properties of the JJ index (Remark 2 in Jerison and Jerison 2012) we have sup v γ (v, S r ( p, w)) = 0 because S x r is symmetric and NSD. Then sup v γ (v, S( p, w) − S r ( p, w)) ≤ sup v γ (v, S( p, w)). Now, recall that E( p, w) = S( p, w) − S r ( p, w), and we want to prove that sup v γ (v, E( p, w)) ≥ sup v γ (v, S( p, w)). In fact, this inequality follows from the properties of the JJ index (Remark 2 in Jerison and Jerison 2012), because the following two conditions hold: (i) E( p, w) − S( p, w) = −S r ( p, w) is both symmetric and PSD. (ii) E( p, w) p = S( p, w) p − S r ( p, w) p = 0 because p S( p, w) = 0 and p S r ( p, w) = 0 by Walras' law, and by construction respectively. Thus we conclude that sup v γ (v, S( p, w) − S r ( p, w)) ≥ sup v γ (v, S( p, w)). Because of the previous two inequalities we establish the result.

Proof of proposition (6)
Proof The proof uses the fact that the solution to the matrix nearness problem is E = S r − S, as shown in Aguiar and Serrano (2017). We want to show that a(x) = S r − S is AN at 0 ∈ M(Z ). By Claim 3, found in the "Appendix", a : X (Z ) → M(Z ) is continuous when X (Z ) is endowed with the || · || C 1 norm. Additionally, recall that the set X (Z ) is compact under our assumption. Then we conclude [applying Proposition 3.1 in Boualem and Brouzet (2012)] that a is (AN) everywhere, i.e., a(x) = S r −S = C has the AN property for all C ∈ M(Z ). In particular, a is AN at 0 ∈ M(Z ). Moreover, it follows that lim δ→0 (δ) = 0 (applying Proposition 2.6 in Boualem and Brouzet (2012)).