A Frequentist Approach to Revealed Preference Analysis

Extracted source text · arXiv 2208.03737

%2multibyte Version: 5.50.0.2960 CodePage: 65001

\documentclass[12pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[margin=1.2in]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{physics}
\usepackage[normalem]{ulem}
\usepackage[bottom]{footmisc}
\usepackage{mathtools,amsthm,amssymb,physics}
\usepackage{smartdiagram}
\usepackage{multirow}
\usepackage{diagbox}
\usepackage{natbib}

\setcounter{MaxMatrixCols}{10}
%TCIDATA{OutputFilter=LATEX.DLL}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{Codepage=65001}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Created=Thursday, December 24, 2020 14:04:39}
%TCIDATA{LastRevised=Wednesday, February 24, 2021 21:40:45}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="DocumentShell" CONTENT="Standard LaTeX\Blank - Standard LaTeX Article">}
%TCIDATA{Language=American English}
%TCIDATA{CSTFile=40 LaTeX article.cst}

 \usepackage{pgfplots}
\pgfplotsset{width=12cm,compat=1.9}
\usepackage{pst-func}
\psset{unit=2cm}
        \usepackage{hyperref}

        \hypersetup{colorlinks=true,urlcolor=blue,citecolor=blue,linkcolor=red}
        
        
        
        \usepackage[center]{caption}
	\usepackage{comment}
	\usepackage{setspace}
 	
	\usepackage{epsfig}
	
	\usepackage{graphics}
	
	\usepackage{lscape}

	\usepackage[english]{babel}
	
	\usepackage{color}
	
	\DeclareMathOperator*{\argmax}{arg\,max}

	\DeclareMathOperator*{\argmin}{arg\,min}

   \newcommand{\one}{\mathbf 1}
   \newcommand{\Rea}{\mathbb R}
   

 
        

        \theoremstyle{plain}\newtheorem {corollary}{Corollary}

        

        \theoremstyle{plain}\newtheorem {proposition}{Proposition}

        \theoremstyle{plain}\newtheorem {thm}{Theorem}[section]
         \theoremstyle{plain}\newtheorem {prop}{Propostion}[section]
        \theoremstyle{plain}\newtheorem {claim}{Claim}[thm]
        \theoremstyle{plain}\newtheorem*{lem}{Lemma}

        \theoremstyle{definition}\newtheorem {assumption}{Assumption}

        \theoremstyle{definition}\newtheorem{mydef}{Definition}

        \theoremstyle{remark} \newtheorem{example}{Example}

        \theoremstyle{remark} \newtheorem{exercise}{Exercise}

        \theoremstyle{remark} \newtheorem*{rem}{Remark}
         \theoremstyle{remark} \newtheorem*{pid}{Proof Idea}
         
\begin{document}
	\bibliographystyle{te}

      

\title{Finite Tests from Functional Characterizations\thanks{%
The authors are grateful to Herakles Polemarchakis, Costas Cavounidis, and Robert Akerlof for their supervision. We also want to thank Motty Perry, Daniele Condorelli, Ben Lockwood, Sharun Mukand, Carlo Perroni,  and seminar participants at CRETA (Warwick). We also thank Victor Aguiar and Ludovic Renou for very useful discussions and encouragement. Of course, any errors that remain in the paper, as well as the opinions expressed herein, are our own.}}
\author{Charles Gauthier\thanks{KU Leuven; \href{mailto:charles.gauthier@kuleuven.be}{\tt charles.gauthier@kuleuven.be}}\quad  Raghav Malhotra\thanks{University of Leicester; \href{mailto:r.malhotra@leicester.ac.uk} {\tt r.malhotra@leicester.ac.uk}} \quad Agust\'{i}n Troccoli Moretti\thanks{University of Warwick; \href{mailto:agustin.troccoli-moretti@warwick.ac.uk}{\tt agustin.troccoli-moretti@warwick.ac.uk}}}

\date{\today}
\maketitle

\begin{abstract}
Classically, testing whether decision makers belong to specific preference classes involves two main approaches. The first, known as the functional approach, assumes access to an entire demand function. The second, the revealed preference approach, constructs inequalities to test finite demand data. This paper bridges these methods by using the functional approach to test finite data through preference learnability results. We develop a computationally efficient algorithm that generates tests for choice data based on functional characterizations of preference families. We provide these restrictions for various applications, including homothetic and weakly separable preferences, where the latter's revealed preference characterization is provably NP-Hard. We also address choice under uncertainty, offering tests for betweenness preferences. Lastly, we perform a simulation exercise demonstrating that our tests are effective in finite samples and accurately reject demands not belonging to a specified class.
\end{abstract}
  
        \bigskip
        {\bf Keywords}: revealed preference, finite data, preferences, weak separability %one-sided tests
    
    
        {\bf JEL classification}: C12, C91, D0, D11, D12
\pagebreak


\section{Introduction}

In empirical analysis of decision making, analysts frequently encounter the challenge of verifying whether a rational decision maker (DM) adheres to a specific class of choice behavior from finite choice data.\footnote{For example, verifying DMs for weak separability or expected utility.} Such tests are generally conducted using the revealed preference (RP) approach that involves checking the feasibility of a system of inequalities. However, for some preference classes revealed preference tests may not be tractable. In contrast, testing if the DM's entire demand function belongs to these classes may be relatively simple.\footnote{Weak separability is an example of one such class; the test of the demand function is easy to conduct, but the RP characterization is known to be NP-Hard \citep{echenique2014testing}.} This paper provides an alternative to the revealed preference paradigm by adapting tests of demand functions to finite choice data, allowing us to exploit the gap in simplicity between RP and functional tests.

We show how to use recent results on preference learnability \citep{beigman2006learning} to adapt functional tests to finite datasets.\footnote{\cite{chambers2021recovering} prove similar finite sample extrapolation results when the analyst observes binary comparisons.} We depart from the RP tradition by shifting the focus from testing the dataset itself to testing the DM. An RP test always rejects a dataset if no preference from the class of interest can generate observed demands and never rejects a dataset if there is a preference from the class of interest that rationalizes the data. In contrast, our tests only guarantee that the probability of a false rejection or a false acceptance can be made arbitrarily small as a computable function of the sample size. In return for these potential errors, we are able to unite functional and finite data testing approaches and gain tractability.

%Our tests are one-sided \textemdash the probability that any dataset will be falsely rejected is a computable function of the sample size, and can be made arbitrarily close to zero as samples sizes increase.  However, they we cannot explicity compute the probability we fail to reject a dataset that cannot be rationalized. 

%Nevertheless, we show that the probability of our tests failing to reject a non-rationalizable dataset vanishes as more data are drawn. In return for this potential error, we are able to unite functional and finite data testing approaches and gain tractability.



%I first show that a naive approach based on the classical convergence result of \cite{mascolell77-2} does not directly apply, and address this challenge by using recent work on preference learnability \citep{beigman2006learning,kubler2020identification}.\footnote{To our knowledge, the only other paper that constructs a test of finite data from a procedure relating to derivatives is \citet*{aguiar2018classifying}, which uses finite data to extend the measure of irrationality for demand functions defined in \citet*{aguiar2017slutsky}.} I then show that a slight modification of the revealed preference paradigm is required for our test.
%Why are the recent results on learnability required for our contribution? 
Classical results on learnability show that if price-demand pairs are generated from a preference relation, then any rationalizing preference converges to the true underlying preference relation \citep{mascolell77-2}. A naive approach would thus sample data, pick any preference that generates a demand function rationalizing the data, and test whether the demand function is from some class of preferences. Suppose that we follow this procedure and find that a rationalizing demand function is from the class of interest. Since we did not check every rationalizing demand function, we cannot say that the true demand is from this class. Suppose, instead, we find a rationalizing demand function that is not from the class of interest. Again, since we did not check every rationalizing demand function, we cannot say that the true demand is not from this class.\footnote{This problem relates to the notion of recursive enumerability \citep*{chambers2017general} in that (in)consistency with the theory cannot be shown in a finite number of steps.}


%We cannot infer that the true demand is in this class as we cannot say that every rationalizing demand function is from the class. Suppose instead we find that the rationalizing demand function is not in the class of interest. We cannot infer that the true demand function is not from the class as we cannot say that every rationalizing demand is not from the class.


%We cannot infer that the true demand is from this class as we cannot say that every rationalizing demand in in this class. may have chosen a rationalizing demand function in the class by luck. Suppose instead we find that the rationalizing demand function is not from the class of interest. We cannot infer that the true demand function is not from the class as we may have chosen a rationalizing demand function outside the class by bad luck alone.

%there may be a rationalizing demand function from the class.

%as we cannot say that every rationalizing demand function is not from it.






%Take a naive approach to constructing finite tests using functional restrictions. \citet*{mascolell77-2} proved that if price-demand pairs are generated from an underlying preference, then \textit{any} rationalizing preference will converge to the true underlying preference. Naively, one would think that one could just sample data, pick any preference (demand function) that rationalizes the data, and then test that demand for weak separability. 

%Now suppose we test the demand after observing $n$ samples and this demand passes the test can the analyst claim that the DM has a utility from some class we want to test. Clearly not, we may have picked a suitable utility from all candidates by chance alone. Now suppose the reverse happens, and the rationalizing preference fails the test, again nothing can be inferred; we cannot say that \textit{every} rationalizing preference fails the test.

The previous discussion shows that no conclusion can be drawn about whether the true preference relation belongs to some class of interest unless we test every rationalizing demand. The results on learnability allow us to circumvent this issue by computing an ex-post bound\footnote{By ex-post bound, we mean that the bound depends on the dataset the analyst samples.} on how far \textit{any} rationalizing demand can be from the true demand.\footnote{\cite{beigman2006learning} show that such bound can be computed efficiently under reasonable conditions on preferences.} We then show that if the rationalizing preference is sufficiently far from a given class of preferences, then we can infer that the true preference is not from the said class with arbitrary certainty. We heavily borrow from the Probably Approximately Correct (PAC) learning framework and thus call our tests probably approximately correct tests. These are in contrast to revealed preference tests that are exact and do not involve any probabilistic statement.\footnote{Revealed preference tests return a binary outcome $\{0,1\}$. The dataset is either rejected $0$ or not rejected $1$.}\footnote{To our knowledge, the only other paper that constructs a test of finite data from a procedure relating to derivatives is \citet*{aguiar2018classifying}. They use finite data to extend the measure of irrationality for demand functions defined in \citet*{aguiar2017slutsky}.}

We now give a short outline of our main argument. Let $\mathcal{M}$ denote the set of all ``rational" preferences. Suppose a decision maker has a preference $\succeq \in \mathcal{M}$ with corresponding demand function $x_\succeq(p,I)$. In what follows, we may omit the dependence of demands on prices $p$ and income $I$. We wish to test if $\succeq$ belongs to some class of preferences $\mathcal{C} \subset \mathcal{M}$. We assume the analyst has access to a uniformly continuous \textit{functional restriction} $\mathcal{R}: \mathcal{M} \to \mathbb{R}$ such that $\mathcal{R}(x_\succeq) = 0$  if and only if $\succeq \in \mathcal{C}$. 

By uniform continuity, there exists a smooth monotone function $\gamma: \mathbb{R}_{+} \to \mathbb{R}_{+}$ with $\gamma(0)=0$ such that for all $\succeq$, $\succeq'$ $\in \mathcal{M}$
\[|\mathcal{R}(x_{\succeq}) - \mathcal{R}(x_{\succeq'})| \leq  \gamma\left(\int_\mathcal{P} |x_\succeq(p)-x_{\succeq'}(p)|dp\right).\]
Suppose the data are generated by the true demand function $x_{\succeq^*}$. After sampling some dataset, the analyst constructs a rationalizing demand function $x_\succeq$. Assume for now that we can infer that the generalization error $erf(\succeq,\succeq^*) := \int_\mathcal{P} |x_\succeq(p)-x_{\succeq^*}(p)|dp$ of $\succeq$ is at most $\epsilon$.\footnote{This is an ``ex-post error bound".} From the above, we have
\begin{align*}
    \mathcal{R}(x_{\succeq})-\mathcal{R}(x_{\succeq^*}) &\leq  \gamma(erf(\succeq,\succeq^*)) 
    \implies \mathcal{R}(x_{\succeq^*}) \geq \mathcal{R}(x_{\succeq})- \gamma(\epsilon).
\end{align*}
Observe that $\mathcal{R}(x_{\succeq^*}) > 0$ whenever $\mathcal{R}(x_{\succeq}) > \gamma(\epsilon)$. Thus, if the analyst observes $\mathcal{R}(x_{\succeq}) > \gamma(\epsilon)$, he can infer $\mathcal{R}(x_{\succeq^*}) \neq 0$ such that $\succeq^* \notin \mathcal{C}$. 

Next, by \cite{mascolell77-2} the rationalizing demand function $x_n(p,I)$ converges to the true demand $x_{\succeq^*}$ as $n$ grows, where $n$ denotes the size of the dataset. Therefore, by continuity, we have $\{\mathcal{R}(x_{\succeq_n})\}_{n=1}^\infty \to \mathcal{R}(x_{\succeq^*})$. We can show that under suitable assumptions, the ex-post bound $\{\epsilon_n\}_{n=1}^\infty$ converges to zero with probability greater than $1-\delta$ for any $\delta>0$. Thus, by continuity, we have $\{\gamma(\epsilon_n)\}_{n=1}^\infty \to 0$. In other words, if the demands do not fall in the class of preferences $\mathcal{C}$, for every $\delta>0$, there is $n_0 \in \mathbb{N}$ such that $\mathcal{R}(x_{\succeq_n}) > \gamma(\epsilon_n)$ for all $n \geq n_0$ with probability greater than $1-\delta$. Hence, we can conclude that $\mathcal{R}(x_{\succeq^{*}}) > 0$ such that $\succeq^*\notin \mathcal{C}$ with probability $1 - \delta$.

%This informal exposition makes clear that a functional restriction $\mathcal{R}$ has to satisfy two properties for our algorithm:
%\begin{enumerate}
%    \item It must be uniformly continuous.
%    \item It must be a characterization, or an if and only if condition. 
%\end{enumerate}

%Our approach departs from the RP tradition in that our focus shifts from testing the dataset itself to testing the DM. Consequently, although our test never rejects a dataset that is rationalizable, it can fail to reject a dataset that cannot be rationalized by a preference from $\mathcal{C}$. In comparison, a RP test always rejects a dataset if there is no preference from the class of interest that generates demands. Nevertheless, we show that the probability that our tests fail to reject a dataset that is not rationalizable vanishes as more data are drawn. 

In summary, if we can infer that the maximum error is less than $\epsilon$ with probability $1-\delta$, our tests possess the following properties:
\begin{enumerate}
    \item A dataset that can be rationalized by a utility function from a class of interest is rejected with probability less than $\delta$.
    \item A dataset that cannot be rationalized by a utility function from a class of interest is rejected with probability $1-\delta$.
\end{enumerate}

These properties imply that our tests can never prove that a data set is consistent or inconsistent with the theory. Contrary to RP tests, we reject consistent datasets with probability approaching zero, and reject inconsistent datasets with probability approaching one. It is this difference in size and power that allows us to construct a polynomial time test for weak separability. In other words, the NP-Hardness of testing weak separability \citep{echenique2014testing} is a feature of the knife-edge nature of RP tests.

%These properties of our tests imply that we can never prove that a data set is consistent or inconsistent with the theory. This feature can be likened to the concepts of recursive enumerability and recursivity used in \cite*{chambers2017general}. In their language, our tests are recursively enumerable as a dataset can be shown to be inconsistent with a class of preferences in a finite number of steps, but they are not recursive as to show consistency with a class of preferences requires a countably infinite number of steps. Contrary to RP tests, we only reject inconsistent datasets with probability approaching one. It is this difference in power that allows us to construct a polynomial time test for weak separability. In other words, the NP-Hardness of testing weak separability \citep{echenique2014testing} is a feature of the knife-edge nature of RP tests.



%Somehow reduce all this stuff to one or two paragraphs. 
Recent results on preference learnability \citep{beigman2006learning} show that we can infer that the maximum generalization error is less than $\epsilon$ with probability $1-\delta$, where delta is a function of the sample. Our procedure depends purely on PAC learnability and abstracts from the specific nature of the optimization problem of the agent and the family of choice sets observed by the analyst. As such, it is applicable to choice under risk and pairwise comparisons, among others. Perhaps counterintuitevely, our procedure can easily accommodate measurement error as shown by \cite{bartlett1994fat}. All we require is for the class of rational demands to have a finite fat-shattering dimension, a condition that is satisfied for the class of income-Lipschitz demand functions.\footnote{The fat-shattering dimension is to real-valued functions what the VC dimension is to discrete-valued functions. In our setup, it provides a measure of complexity of the class of demand functions.}


%We show how to adapt our procedure to specific cases by constructing restrictions for the case where demands are generated by homothetic and weakly separable preferences. We also develop a procedure to test whether goods are substitutes or complements. Moving onto choice under uncertainty, we develop a test that accepts all preferences from the betweenness class\footnote{Characterized by \cite{chew1989axiomatic} and \cite{dekel1986axiomatic}} but is stronger than any test known in the literature.

To operationalize our approach, we construct functional restrictions for a variety of classes of demands. First, we consider demands generated by the class of homothetic and weakly separable preferences. Then, we show that our procedure can be used to test whether demands are substitutes or complements. Lastly, we consider choice under uncertainty and develop a test that accepts all preferences from the betweenness class \citep{dekel1986axiomatic,chew1989axiomatic} but is stronger than any test known in the literature.


We implement our algorithm for homotheticity and weak separability via a simulation exercise. For practical purposes, we use the common AIDS demand model as it provides a first order approximation to the set of all rational demand functions. Note that this parametric specification is not required for our theoretical results, however. Our simulations show that our tests perform well in finite samples and correctly reject demands that are not homothetic and weakly separable. Therefore, our approach may have several applications where analysts often rely on heuristic methods to overcome computational complexities, such as in \cite{Varian1983} and \cite{fleissig2003}.


%We show that functional restrictions are quite easy to compute for many classes of interest, only involving cross derivatives of demand functions.


%\footnote{We demonstrate that the NP-Hardness of testing for weak separability \citep{echenique2014testing} is a feature of the knife edge nature of RP tests. Indeed, we construct a polynomial time test by relaxing the test to have an asymptotic power equal to one.} 

%[Talk about application here]
%The testing procedure we described requires the analyst to compute the ex-post bound $\epsilon$ requires a known Lipschitz constant $\alpha$. 


%Under suitable assumptions on preferences, \cite{beigman2006learning} show that $\epsilon$ can be computed in polynomial time as a function of the size of the dataset. 


%If we are only concerned with the theoretical computational complexity of our procedure, this is independent of $\alpha$ because it needs only be computed once and the computational cost is independent of sample size and repeated preference tests. Of course, in practice this may be very difficult to compute. However, the cases we consider only use cross derivatives of demand functions thus could possibly be reduced to simple analytic problems about uniform continuity of derivates in function spaces.\footnote{We demonstrate that the NP-Hardness of testing for weak separability \citep{echenique2014testing} is a feature of the knife edge nature of RP tests. If some slack is allowed, a polynomial time test can be constructed.}


%Interestingly, our tests have a one size fits all approach to testing and treat difference preference classes with functional tests similarly. Also, theoretically, it is interesting to notice that if we assume that the preference we consider has known Lipschitz constants, these tests are never NP-Hard, whereas revealed preference characterizations may well be.

%This paper proposes a theoretically sound and credible alternative to construct a computationally efficient test in finite data.\footnote{from now we refer to such tests as feasible.}


%Our results need finite fat-shattering dimension, this assumption does not make parametric restrictions on the underlying demand model. HOwever, to illustrate how our method would work in practice, we resort to a parametric approximation of the class of all demand functions. We use the AIDS demand model as this is a first order approximation to all demands, under this restriction we show that our tests are able to reject homotheticity and weak separability reasonably well. The parametric assumption is not required for our theoretical results, but makes an algorithmic procedure easy to implement.


Section \ref{sec:setup} describes our setup and notation. Section \ref{sec:Gentests} highlights how to construct our tests if the analyst has access to a functional characterization for a class of preferences. Section \ref{sec:applications} obtains functional characterizations for common classes of preferences, substitutes and complements, and choice under uncertainty. Section \ref{sec:implementation} evaluates the empirical performance of our approach for the classes of homothetic and weakly separable preferences. Section \ref{sec:extensions} studies extensions of our approach, such as the presence of measurement error. Section \ref{sec:conclusion} concludes.

 
 

% The literature uses two primary approaches to examining the rationality of decision makers: one approach assumes the analyst has access to the demand function, enabling the use of restrictions involving derivatives; the other is the revealed preference (RP) approach, which derives algebraic conditions (inequalities) on finite choice data.  To quote, ``\textit{The distinction between the two approaches is very important in empirical work.
% The calculus approach assumes the entire demand function is available for analysis,
% while the algebraic approach assumes only a finite number of observations on consumer
% behaviour is available.}" \citep{varian1983non}

% This schism also extends to testing for properties more restrictive than rationality. Specifically, when confronting finite data, analysts have usually only appealed to the revealed preference/algebraic approach.\footnote{To our knowledge, the only other paper that constructs a test of finite data from a procedure relating to derivatives is \citet*{aguiar2018classifying}, which uses finite data to extend the measure of irrationality for demand functions defined in \citet*{aguiar2017slutsky}.} However, this approach relies on finite inequalities, often computationally hard to enumerate. Testing weak separability is simple if the demand function is known, but finding a revealed preference characterization for finite datasets using revealed preference inequalities is computationally hard \citep{echenique2014testing}. I show that this hardness is 'knife-edge' and arises from the RP paradigm tests being 'exact' or two-sided, simultaneously wanting to accept all correct datasets and reject all incorrect datasets.\footnote{In the language of statistics, they have both power and size 1 if the null and alternative are defined aptly.}

%To summarize we construct a PAC test with the following properties. Fixing $\delta>0$, we have a test which:
%\begin{itemize}
%    \item Whenever it fails a DM, the probability of this being wrong is at most $\delta$.
%    \item Further, if the DM has a preference we would which should fail, the probability they fail goes to 1.
%\end{itemize}
%We cannot compute an explicit bound for the second probability, so our tests are asymptotically complete.


\subsection{Related Literature}

The functional approach to testing decision-makers originated in the work of \citet*{slutsky1915} and \citet*{antonelli71} who derived necessary and sufficient conditions for demand functions to arise from utility maximization.\footnote{This is the so-called ``integrability problem" for demand functions. For a review, see \citet*{hurwicz1971problem}} For a detailed review of functional tests for classes of preferences, see \citet*{DeatonMuell1980}. Since these tests rely on the whole demand function, they require access to infinite data. We depart from this literature by extending those functional tests to finite data.
 
The closest work linking restrictions on demand functions and finite data is \citet*{aguiar2018classifying}. In their paper, they extend the measure of bounded rationality defined in \citet*{aguiar2017slutsky} based on the Slutsky matrix to finite data. Their focus is on measuring and classifying bounded rationality with finite price-demand data and linear budgets. In contrast, our approach provides tests for general restrictions under preference monotonicity that is applicable to broader datasets such as pairwise comparisons.


The RP approach is standard to test the consistency of a finite dataset with the utility maximization hypothesis. The approach originated in the work of \citet*{samuelson1938,samuelson1939,samuelson1947,samuelson1948} and was further refined by \citet*{afriat1967construction} and \cite{varian82}. In particular, \cite{varian82} established that the Generalized Axiom of Revealed Preference (GARP) is a necessary and sufficient condition for any finite dataset to be consistent with utility maximization. The appeal of GARP stems from the ease with which the rationality of a data set can be verified through simple algebraic inequalities. 


Since those seminal contributions, RP theory has been exploring various extensions such as functional form restrictions and inter-temporal models. Significant contributions include \citet*{kubler2014asset} for expected utility with objective (known) probabilities and \citet*{echeniquesaito15} for subjective probabilities. A similar problem for ``translation-invariant" preferences is considered in \citet*{chambersetal16}. \citet*{polisson2020rp} give a general method to construct RP inequalities that applies to several classes of preferences over risk and uncertainty.\footnote{For recent extensive reviews, see \citet*{CrawfordEmpirical2014,EcheniqueRPreview2019,demuynck2019samuelson}.}

The RP literature concentrates on exhaustive restrictions on finite datasets that characterize\footnote{See \citet[p.~xv]{chambers_echenique_2016}.} a model and largely uses the sufficiency of first-order conditions.\footnote{The only revealed preference test that is not a characterization which we are familiar with is for probabilistic sophistication \citep*{Epstein2000probsoph}.} In some instances, those tests can pose a significant computational challenge. Indeed, \citet*{echenique2014testing} and \citet*{Cherchyeinteger2015} show that testing for weak separability is NP-Hard. Accordingly, these tests have to rely on non-polynomial time algorithms such as mixed integer programming \citep*{Cherchyeinteger2015,Hjertstrandmixint2020}, an efficient approach for small to medium sized datasets.

The deterministic RP approach has been generalized to a stochastic environment with measurement error by \cite{AK2021}. Despite its appeal, their framework inherits the computational burden of testing classes of preferences whose RP restrictions are NP-Hard. Indeed, their approach involves simulations that require solving a (possibly NP-Hard) problem many times rather than just once. Consequently, tractability issues are exacerbated in their stochastic setting. %In contrast, our framework exploits functional restrictions that avoid reliance on RP restrictions. 

%We propose a different approach to weaken RP tests' completeness property to another condition that we posit (i.e., Asymptotic Completeness). In my setup, \textit{there may be bad data that passes our test, but the probability of such data occurring vanishes as the sample size increases.} To the best of my knowledge, this is the first paper to use learnability results for preferences to construct finite data tests. 

% I first show that a naive approach based on the classical convergence result of \cite{mascolell77-2} does not directly apply, and address this challenge by using recent work on preference learnability \citep{beigman2006learning}.\footnote{To our knowledge, the only other paper that constructs a test of finite data from a procedure relating to derivatives is \citet*{aguiar2018classifying}, which uses finite data to extend the measure of irrationality for demand functions defined in \citet*{aguiar2017slutsky}.} I then show that a slight modification of the revealed preference paradigm is required for our test.



% The paper is structured as follows. Next, we describe the setup and preliminaries in detail and discuss the notion of learnability, showing its applicability. Using certification, I then illustrate our result using an example (i.e., weak separability) and show that our test satisfies the conditions that I discussed earlier. I then generalize our results to different families of choice sets and sampling procedures. I finally conclude and discuss some possible directions for future research.


\section{Setup}\label{sec:setup}

We consider individual decision-making where the analyst only has access to finite choices made by the DM. The DM chooses $l$-dimensional bundles $x\in \mathcal{X}\subset\mathbb{R}_{+}^l$ according to some preference $\succeq\subseteq\mathcal{X}\times \mathcal{X}$, where $\mathcal{X}$ is a compact convex set. We associate every preference with its graph and write $x \succeq y$ if $(x,y) \in$ $\succeq$, to be read as $x$ is ``at least as good as" $y$. We refer to the set of complete, transitive, twice differentiable, strongly convex, and monotone preferences as $\mathcal{M}\subset 2^{\mathcal{X}\times\mathcal{X}}$.\footnote{Preferences are \textit{strongly convex} just in case for any $x\neq y$, $x\succeq y \Rightarrow \alpha x + (1-\alpha) y \succ y$ for all $\alpha \in (0,1)$; while preferences are said to be \textit{monotone} just in case for any $x\neq y$ with $x_i\geq y_i$ for all $i=1,\ldots,l$, then $x\succ y$. }

Let $\mathcal{P}\subset \mathbb{R}_{++}^l$ represent the set of possible prices. An individual faces a sequence of prices that are drawn from some fixed distribution. For a price $p\in \mathcal{P}$, and by normalizing income, the choice set is defined as
\begin{equation*}
    \mathbf{B}_p:=\{y\in \mathcal{P}:p\cdot y \leq 1\}
\end{equation*}
A demand function $x: {\cal P} \rightarrow {\mathbf X} $ associates to each budget ${\mathbf B}_p \subset {\mathbf X}$ an element of that budget $ x(p) \in {\mathbf B}_p$. A \textit{dataset} is a collection of prices and demands denoted by $\{(p,x)_{k}\}_{k=1}^n $. 



We say that a preference relation $ {\succeq} $ {\it rationalizes} the data $ \{(p,x)_{k}\}_{k=1}^n$ if for all prices, the demand $x(p)$ dominates every other element $y \in \mathbf{B}_p$:
\begin{equation*}
    x(p) \; {\succeq} \; y \quad \forall y \in {\mathbf B}_p
\end{equation*}
Let $\mathcal{C}\subset \mathcal{M}$ be a class of preferences. We say that a dataset $\{(p,x)_{k}\}_{k=1}^n$ is $\mathcal{C}$-rationalizable if there exists $\succeq \in \mathcal{C}$ such that $\succeq$ rationalizes $\{(p,x)_{k}\}_{k=1}^n$.

%Observe that any $\mathcal{C}$-rationalizable dataset is approximately $\mathcal{C}$-rationalizable. However, approximate $\mathcal{C}$-rationalizability allows for preferences close to but outside the boundary of $\mathcal{C}$. We cannot differentiate between the two notions in finite data.

%Intuitively, a given dataset may be consistent with homothetic preferences, but additional observations might detect that the underlying preference is not homothetic.

We say that a preference $\succeq\in\mathcal{M}$ generates a demand function $x_{\succeq}$ if for all prices, the demand $x_{\succeq}(p)$ dominates every other element $y \in \mathbf{B}_p$:
\begin{equation*}
    x_{\succeq}(p) \; {\succeq} \; y \quad \forall y \in {\mathbf B}_p
\end{equation*}

\noindent
We refer to the data point generated by $\succeq$ under choice set $\mathbf{B}_p$ as $(p,x_\succeq(p))$. A dataset whose demands are generated by $\succeq$ is a collection of data points $D=\{(p,x_\succeq)_{k}\}_{k=1}^n$. A dataset $D$ is $\mathcal{C}$-rationalizable if there exists $\succeq \in \mathcal{C}$ such that $\succeq$ rationalizes $D$.

%is rational if the dataset
%    \[D=\bigcup_{p\in \mathcal{P}}(\mathbf{B}_p,x_{\succeq}(p) )\]
%is rationalizable. %Finally, we say that a utility function $U:\mathcal{X}\to \mathbb{R}$ represents $\succeq$ if $(x,y)\in \succeq\implies U(x)\geq U(y)$.
    
    %\begin{mydef}
    %A demand function is rational if the dataset
    %\[D=\bigcup_{p\in \mathcal{P}}(\mathbf{A}_p,x_{\succeq}(p) )\]
    %is rationalizable.
    %\end{mydef}    
    %\noindent We say that a utility function $U:\mathcal{X}\to \mathbb{R}$ represents $\succeq$ if $(x,y)\in \succeq\implies U(x)\geq U(y
    %)$.


\subsection*{Probably Approximately Correct Tests}

Let $\mathcal{D}$ denote the set of all possible datasets. A test $\mathcal{T}: \mathcal{D}\to \{0,1\}$ is a function that inputs observations and outputs $0$ or $1$. We say that a dataset ${\{(p,x)_{k}\}_{k=1}^n}$ passes a test $\mathcal{T}$ if
        \[\mathcal{T}\left(\{(p,x)_{k}\}_{k=1}^n\right)=1,\]
and fails a test $\mathcal{T}$ if
        \[\mathcal{T}\left(\{(p,x)_{k}\}_{k=1}^n\right)=0.\footnote{By accepting, we mean what is conventionally termed as failing to reject.}\]

\noindent We now define desirable properties of a test.
    %\begin{mydef}[Soundness]
    %A test $\mathcal{T}$ is sound with respect to the class $\mathcal{C}$ if 
    %\[\mathcal{T}\left(\{(p,x)_{k}\}_{k=1}^n\right) = 0 \quad \text{implies that}\quad \{(p,x)_{k}\}_{k=1}^n\quad \text{is not} \quad \mathcal{C}\text{-}rationalizable.\]
    %\end{mydef}
    %\noindent
    %Soundness means that if the data fail the test, then they must not be $\mathcal{C}$-$rationalizable$. In other words, there are no false negatives. This relates to the size of a test whereby the probability of rejecting data from a decision maker in our class of interest $\mathcal{C}$ is zero.
   \begin{mydef}[$\delta$-Soundness]
   Let $\delta \in (0,1)$. A test $\mathcal{T}$ is sound with respect to the class $\mathcal{C}$ if:
   \[ \mathcal{T}\left(\{(p,x)_{k}\}_{k=1}^n\right) = 0 \text{ implies } \mathbb{P}\left[ \{(p,x)_{k}\}_{k=1}^n \; \text{is} \; \mathcal{C}\text{-rationalizable}\right] \leq \delta. \]
\end{mydef}

\noindent
In words, $\delta$-soundness means that if the data fail the test, then the probability of a false rejection is smaller than $\delta$. Hence, a test is sound if its size is bounded by some exogenously given $\delta$.

    %\begin{mydef}[Completeness]
    %A test $\mathcal{T}$ is complete with respect to the class $\mathcal{C}$ if
    %\[\mathcal{T}\left( \{(p,x)_{k}\}_{k=1}^n \right) = 1 \quad\text{implies that}\quad\{(p,x)_{k}\}_{k=1}^n\quad \text{is}\quad \mathcal{C}\text{-}rationalizable.\]
    %\end{mydef}
    %\noindent

    %\noindent
    %Completeness means that only ``correct" datasets pass our test. In other words, there are no false positives. This relates to the power of a test whereby the probability of rejecting data from a decision maker outside of our class of interest $\mathcal{C}$ is one.
    
    Let $\mathcal{B}_p$ denote a family of prices and $\sigma$ denote a probability measure over this family. Suppose $\succeq \in \mathcal{M}$ and $\{(p,x)_k\}_{k={1}}^{n}$ is the dataset otained from i.i.d. draws of prices from measure $\sigma$. We denote the product measure over a dataset of size $n$ by $\sigma^n$. %We now introduce a weaker notion of completeness.
\begin{mydef}[Asymptotic Completeness]
Let $\mathcal{C}\subset\mathcal{M}$ be a class of preferences.
We call a test $\mathcal{T}$ asymptotically complete with respect to the class $\mathcal{C}$ and measure $\sigma$ if for any preference $\succeq \notin \mathcal{C}$:
\[\lim_{n \to \infty} \sigma^n\left[ \{(\mathbf{B}_p)_k\}_{k=1}^n \text{ such that } \mathcal{T}(\{(p,x_\succeq)_k\}_{k=1}^n)=0 \right] \to 1. \]
\end{mydef}



\noindent
In words, asymptotic completeness means that the test correctly rejects data that are not $\mathcal{C}$-rationalizable with probability approaching one as the size of the dataset increases. Hence, a test is asymptotically complete if its power goes to one.
\begin{mydef}[PAC Test]
    A test $\mathcal{T}$ is Probably Approximately Correct (PAC) for the class $\mathcal{C}$ given a distribution $\sigma$ over prices and $\delta \in (0,1)$ if there is a sample size $n(\delta)$ such that for any dataset $ \{(p,x_\succeq)_k\}_{k=1}^n$ with $n \geq n(\delta)$, the test $\mathcal{T}$ is $\delta$-sound and asymptotically complete.
    %\[\mathcal{T}\left( \{(p,x_\succeq)_k\}_{k=1}^{n} \right) = 0 \text{ implies } \mathbb{P}\left[ \{(p,x)_{k}\}_{k=1}^n \; \text{is} \; \mathcal{C}\text{-rationalizable} \right] \leq \delta,\]
    %  and
    %\[\succeq \notin \mathcal{C} \text{ implies } \lim_{n\to \infty} \mathbb{P} \left[ \mathcal{T}(\{(p,x_\succeq)_k\}_{k=1}^n) = 0 \right] \to 1 .\]
\end{mydef}

%\noindent
%This definition states that PAC tests are sound and complete. %Thus, the size of the test is $\delta$ and its power goes to $1$ as the size of the dataset increases.


%The first property of PAC tests is that false rejections do not occur. The second property states that PAC tests are asymptotically complete. In other words, PAC tests can limit false positives with arbitrary certainty as the size of the dataset increases.

    
\subsection{Preference Learnability}

We now state our main result that we use to construct our procedure. Let $\sigma$ be a measure over the set of prices $\mathcal{P}$. Define the generalization error between two demand functions $x_{\succeq}$, $x_{\succeq'}:\mathcal{P} \to  \mathcal{X}$ that arises from preferences $\succeq$, $\succeq'$ as $erf_\sigma(\succeq,\succeq')=\int_\mathcal{P} |x_\succeq(p)-x_{\succeq'}(p)|^2d\sigma$.
\begin{thm}[\citep{beigman2006learning}]
    Let $\mathcal{C}_L$ be the set of all income Lipschitz demands with constant $L$. For any $x_\succeq \in \mathcal{C}_L$, $\epsilon$, $\delta>0$ and measure $\sigma$, there exists an algorithm that for a number of observations $n_L(\epsilon,\delta)$ polynomial in $\frac{1}{\epsilon}$ and $\frac{1}{\delta}$, outputs a demand function $x_{\succeq'}$ such that $erf_\sigma(\succeq,\succeq')\leq \epsilon$ with probability $1-\delta$.
\end{thm}
This theorem allows us to learn the true demand function for any distribution $\sigma$. \cite{beigman2006learning} also provide an efficient constructive algorithm to find the demand $x'$. If we further fix a uniform distribution over prices, \cite*{kubler2020identification} show that the assumption of a known Lipschitz constant can be relaxed, but they do not give an explicit procedure to compute the required constants.



\section{Framework and Testing Procedure}\label{sec:Gentests}

This section highlights the difference between our setup and the classical revealed preference setup.%given a  class of interest be $\mathcal{C}\subset \mathcal{M}$. 

\subsection*{Revealed Preference Framework}

We think of a test as a three-step procedure. First, the analyst is confronted by a dataset of prices and demands. Then, Nature picks a preference that rationalizes the data. Finally, the analyst tests whether Nature could have picked a preference $\succeq \in \mathcal{C}$ that rationalizes the data. The timing of the classical approach is depicted in Figure \ref{f: timeline Classic RP}.
%the analyst wants the \textbf{data} to pass the test if there is some preference $\succeq \in \mathcal{C}$ that rationalizes the data. At t=2, the analyst tests whether there is some preference $\succeq \in \mathcal{C}$ that rationalizes the data.  Thus, the analyst tests whether Nature could have picked a preference from $\mathcal{C}$ that rationalizes the data.
\begin{figure}[h!]
\centering
\includegraphics[scale=1]{Figures_Timelines/Timeline1.pdf}
\caption{Depiction of the timing in the classic RP framework.}
\label{f: timeline Classic RP}
\end{figure}


\subsection*{Preference Learnability Framework}

In our setup, Nature first picks a preference. Then, the analyst samples prices from some fixed probability measure. This allows us to index our tests by the size of the dataset sampled. Finally, the analyst tests whether Nature picked $\succeq \in \mathcal{C}$ given the realized dataset. This allows us to make probabilistic statements about the belonging of the true preference to some class of preferences based on sampled data. Asymptotic completeness is informally defined as follows: \textit{conditional} on Nature drawing a preference $\succeq\notin \mathcal{C}$, the \textbf{measure of datasets} rejected by our test goes to one as $n$ goes to infinity. Thus, our approach tests Nature's preferences rather than the dataset itself. The timing of our approach is depicted in Figure \ref{f: timeline new approach}.
\begin{figure}[h!]
\centering
\includegraphics[scale=1]{Figures_Timelines/Timeline2.pdf}
\caption{Depiction of the timing in our framework.}
\label{f: timeline new approach}
\end{figure}


% \begin{rem}
% Soundness is identical in both setups.
% \end{rem}

This shows the difference between the RP and the learnability approaches. Namely, our approach views the preference that Nature picks as fixed and learns about it from the data, thus allowing us to study asymptotics.


\section*{Functional Restriction and General Procedure}
We call a function $\mathcal{R}:\mathcal{M}\times \mathcal{P}\to \mathbb{R}$ a \textit{functional restriction} for a class of preferences $\mathcal{C}\subset \mathcal{M}$ if
\[ \succeq \in \mathcal{C}\quad\iff \quad (\forall p\in \mathcal{P}\quad\mathcal{R}(\succeq)(p)=0). \]
The functional restriction must hold at every point, so in a sense it is local and not global. The requirement for local restrictions inherently limits the scope of our testing capabilities. Specifically, this constraint prevents us from distinguishing between models that only exhibit differences at kinks. An example is the inability to differentiate between models such as expected utility and rank-dependent expected utility.

Despite this limitation, our approach remains capable of testing a broad range of models. For instance, we can effectively analyze Chew-Dekel preferences as outlined in \cite{dekel1986axiomatic} and \cite{chew1989axiomatic}. These preferences result in first-order conditions that are linear in probabilities, allowing us to formulate applicable restrictions. We also describe functional restrictions for other classes of preferences such as homotheticity and weak separability in Section \ref{sec:applications}.

As we informally argued in the Introduction, we need to put some discipline on our restrictions to bound the size of deviations as a function of the dataset assuming that the DM is truly from the class $\mathcal{C}$. We now define this property, which we refer to as uniform continuity.

\begin{mydef}[Uniform Continuity]\label{uniform}
Let $\sigma$ be any distribution that admits a density. We call a restriction $\mathcal{R}$ of class $\mathcal{C}$ \textit{uniformly continuous} at 0 if for every $\succeq \in \mathcal{M}$, $\succeq^* \in \mathcal{C}$, and $\epsilon>0$, there exists $\gamma(\epsilon) > 0$ such that:
\[  erf_{\sigma}(\succeq^*,\succeq)<\gamma(\epsilon)\implies \left\{\int_\mathcal{P}[\mathcal{R}(\succeq)(p)-\mathcal{R}(\succeq^*)(p)]^2\right\}^\frac{1}{2} = \left\{\int_\mathcal{P}[\mathcal{R}(\succeq)(p)]^2\right\}^\frac{1}{2} < \epsilon.\]
This definition means that something \textit{close to} a preference that satisfies our restrictions \textit{almost} satisfies our restriction. In what follows, we show that if a functional restriction is uniformly continuous at zero, we can use it to construct a PAC test.

\end{mydef}
%\begin{mydef}[Characterization]\label{regular}
%Call a restriction $\mathcal{R}$, a characterization of $\mathcal{C}$ if:
%\[(\mathcal{R}(\succeq,p)=0 \quad \forall p \in \mathcal{P})\implies \succeq \in \mathcal{C}.\]
%Essentially, $\mathcal{R}$ needs to be a local if and only if condition.
%\end{mydef}
\begin{rem}
The function $\gamma(\epsilon)$ only depends on the underlying domain $\mathcal{P}$ and the restriction chosen $\mathcal{R}$. It is independent of the underlying preference and sampling procedure. %Since the preference relation does not need to be known, this uniform continuity restriction allows for a feasible implementation.
\end{rem}



\subsection{Algorithmic Procedure}

 \noindent Let $\mathcal{R}$ be a uniformly continuous restriction for a class $\mathcal{C}\subset\mathcal{M}$. We now further restrict the set $\mathcal{M}$ to one with an income Lipschitz constant less than a known $L$. We propose a procedure to construct a PAC test.
\begin{enumerate}
    \item Pick any sequence $\{\delta_k\}_{k=1}^\infty$ and $\{\epsilon_k\}_{k=1}^\infty$ such that $\delta_k$, $\epsilon_k \to 0$.
    \item Given $\delta_k$, $\epsilon_k>0$, pick $n$ such that for any dataset $\{(p,x_\succeq(p))\}_{k=1}^n$, any rationalizing preference $\succeq$, and any true preference $\succeq^*$,
    \[erf_\sigma(\succeq,\succeq^*) \leq \epsilon_k\]
    with probability greater than $ 1 - \delta_k$.
    \item Compute the test statistic:
    \[T_n=\gamma\left(\left\{\int_{\mathcal{P}}[\mathcal{R}(\succeq)(p)d\sigma]^2\right\}^\frac{1}{2}\right).\]
     \item If $T_n> \epsilon_k$, reject the hypothesis that the true underlying preference $\succeq^*$ is in $\mathcal{C}$. Else, let $k:=k+1$ and go back to the second step.
\end{enumerate}

The following result shows that a test based on the previous procedure indeed defines a PAC test.
\begin{thm}
 Let $\mathcal{T}$ be a test where $\mathcal{T}(D)=0$ if the above procedure rejects $D$, and 1 otherwise. Then, $\mathcal{T}$ is a PAC test for class $\mathcal{C}$.
\end{thm}
\begin{proof}
% We first need to show that this procedure terminates if $\succeq \notin \mathcal{C}$. To see that notice that the probability that $\erf_\sigma(\succeq,\succeq^*)<\epsilon $ is greater than $(1-\delta)$. So at step $n$, if we sample another dataset of size n independently the probability that $\erf_\sigma(\succeq,\succeq^*)<\epsilon$ will be less than $(1-\delta)^2$. As we sample enough data, this goes to zero hence we are able to reach step 5 and the test terminates.
\begin{enumerate}
    \item We want to show that the algorithm leads to a $\delta$-sound test. For the sake of a contradiction, suppose $\mathcal{T}(D)=0 \iff T_n>erf(\succeq,\succeq^*)$ but $\succeq^*\in \mathcal{C}$. By construction, $\erf(\succeq,\succeq^*) \leq \epsilon$ with probability $1-\delta$. Hence, with probability $1-\delta$:
 \[erf(\succeq,\succeq^*)<T_n=\gamma\left(\left\{\int_{\mathcal{P}}[\mathcal{R}(\succeq)(p)d\sigma]^2\right\}^\frac{1}{2}\right)\] 
 By uniform continuity, this implies that
 \[\left\{\int_{\mathcal{P}}[\mathcal{R}(\succeq)(p)d\sigma]^2\right\}^\frac{1}{2}<\left\{\int_{\mathcal{P}}[\mathcal{R}(\succeq)(p)d \sigma]^2\right\}^\frac{1}{2},\]
which is a contradiction.
Therefore, $\succeq^*\notin \mathcal{C}$ with probability $1-\delta$
\item We want to show that the algorithm leads to an asymptotically complete test. Suppose $\succeq^*\notin \mathcal{C}$. By construction, 
\[\lim_{k\to \infty} \mathbb{P}\left[erf(\succeq,\succeq^*)>\epsilon \right]\to 0 \quad \text{for all} \quad \epsilon, \delta>0\]
By continuity of $\gamma$, as the size of the dataset increases and picks rationalizations $\succeq^n$, 
\[\gamma \left(\left\{\int_{\mathcal{P}}[\mathcal{R}(\succeq_n)(p)d\sigma]^2\right\}^\frac{1}{2}\right) \to \gamma \left(\left\{\int_{\mathcal{P}}[\mathcal{R}(\succeq^*)(p)d\sigma]^2\right\}^\frac{1}{2}\right) =\gamma^*>  0.\]
Thus, there must eventually be a $n$ where with high probability,
\[\epsilon<\gamma \left(\left\{\int_{\mathcal{P}}[\mathcal{R}(\succeq_n)(p)d\sigma]^2\right\}^\frac{1}{2}\right),\]
which proves that $\succeq^*\notin \mathcal{C}$.
\end{enumerate}
\end{proof}
% \begin{rem}
%     The analyst never needs to compute $erf$, he only needs to compute the sample complexity $n(\epsilon,\delta)$ for the domain.
% \end{rem}
% \section{Convergence and Bounds to Errors}
% \subsection*{The Naive Approach}
% I now highlight the naive approach to the problem and why it does not work. \citet*{mascolell77-2} shows that given choice data, any preference rationalizing the data converges to the true preference generating the data. Suppose, acting naively, that the analyst samples data, picks a rationalizing preference, and tests it for some property. The problem is as follows
% \vspace{0.5cm}\\
% \textit{Suppose that the picked preference fails the test for separability. In this case, the analyst does not know if there is no separable preference that generates the data or if they picked the wrong preference.}\vspace{0.5cm}\\
% Adding to this, notice that infinitely many preferences rationalize the data, which renders it impossible for the analyst to test each of them. Isolve this problem by generating bounds on "how close" the picked preference is to the true underlying preference. Once I have bounds on this distance, I can use regularity conditions to generate tests.
% \subsection*{The Sophisticated Approach}
% To illustrate our approach, I first need some formal machinery.\vspace{0.3cm}\\
% Call a set of observations, $C_\epsilon=\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n$ a \textbf{certificate} of radius $\epsilon$, if:
% \[ \succeq^1,\succeq^2 \textit{ rationalize } \{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n \implies d(\succeq^1,\succeq^2)<\epsilon\]
% Where the distance between preferences is defined as the measure of the symmetric difference of the graphs.
% \[d(\succeq^1,\succeq^2)=\mu^2\{\succeq^1\cup\succeq^2-\succeq^1\cap\succeq^2\}\]
% Intuitively, I call a dataset a certificate of radius $\epsilon$ if it guarantees that all rationalizing preferences are within $\epsilon$ of \textit{each other}. The true preference rationalizes the data, hence any preference rationalizing the certificate is within $\epsilon$ of the true preference.
% \begin{rem}
%     Given the sampled data $D=\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n$, by \citet*{kubler2020identification} one can infer the measure of subset $\mathcal{L}\in\mathcal{P}$, where all preferences which rationalize D must agree. Call the relative measure of this set $\lambda_D$. Notice that any 2 rationalizing preferences can at max disagree on measure $1-\lambda_D$, so this is the maximum distance between any 2 rationalizing preferences in the distance of the symmetric difference. Refer to $1-\lambda_D$ as $rad(\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n)$. This converges to zero as the sample size increases.
% \end{rem}
% \begin{mydef}[Certifiable Convergence]
% Let $\mathcal{M}$ be as defined above, and $\nu_{\mathcal{A}}$ be a probability measure over a suitable family $\mathcal{A}$ of choice sets.
%  I say that the pair $(\mathcal{A},\nu_{\mathcal{A}})$ leads to certifiable convergence if for every $\succeq \in \mathcal{M},\epsilon>0$.

%  \[As\quad n \to \infty \quad  \nu^n\left(\{\{(\mathbf{A},f_\succeq)_i\}_{i=1}^n |\{(\mathbf{A},f_\succeq)_i\}_{i=1}^n \text{ is a certificate of radius } \epsilon\}\right)\to 1\]
%  Where $\nu^n$ is the product measure, and datasets are of the form $\{(\mathbf{A},f_\succeq)_i\}_{i=1}^n $
%  This means that as I increase the sample of choice sets, the probability of encountering choice sets such that the data they generate is a certificate of radius epsilon must go to 1 for any epsilon and underlying preference.
% \end{mydef}
% Under certifiable convergence, the \textit{known bound} for the distance between \textit{any preference} that rationalizes the data and the true preference to zero for all preferences.
% \begin{prop}[\citet*{kubler2020identification}]\label{Kublerfin}
% Let $\mathcal{F}$ be the family of pairs of points or linear budget sets. Furthermore, let $\mu_{\mathcal{F}}$ be the uniform distribution over the respective family.\footnote{For example, this could be the distribution over prices for demand data or the product of the choice space for binary choice data.} The pair $(\mathcal{F},\mu_{\mathcal{F}})$ leads to certifiable convergence.
% \end{prop}
% \begin{proof}
% This theorem follows very simply from Theorem 1 (\citep*{kubler2020identification}).
% \end{proof}
% \noindent I now have all of the ingredients that I need to construct our algorithm.
% \subsection{An Instructive Example-Weak Separability}\label{example}
% I now use weak separability as a subclass for which I consider a test. To do this, I appeal to a simple result from demand theory. this is interesting because \cite{echenique2014testing} shows that RP characterizations of weak separability are NP hard.
% \begin{mydef}[Weak Separability]
% Suppose that the set of l goods can be divided into two subgroups, $g_1,g_2$. Furthermore, suppose that x and y are bundles of $g_1$ and $g_2$ goods, respectively. I say that the preference $\succeq$ is weakly separable if there exists subutility functions  $v_1,v_2$ for $g_1,g_2$, respectively, and a macro utility function u such that $u(v_1(x),v_2(y))$ represents $\succeq$.
% \end{mydef}
% \begin{thm}\cite [p.~128]{DeatonMuell1980}\label{Septest}
% Suppose that the set of goods can be divided into two subgroups, $g_1,g_2$, and set subgroup expenditure $I_k=\sum_{l\in g_k}p_lx_l$. The preference is separable in these two subgroups if and only if
% \[\forall(p,I)\in \mathcal{P}\times \mathbb{R}\quad\frac{\partial I_1}{\partial I}\frac{\partial I_2}{\partial I}=\frac{\lambda_{12}}{\mu_{12}}\]
% Where $\lambda$ and $\mu$ are independent of price.
% \end{thm}
% Notice that although this is a simple condition to check, requires observing derivatives of the demand function. I now use Theorem \ref{Septest} to construct a testing procedure and illustrate our method.\vspace{0.3cm}\\
% Refer to the class of weakly separable preferences as $\mathcal{S}\in \mathcal{M}$, further let the groups of goods be referred to as $g_1,g_2$ and $I_1,I_2$ be expenditures as in theorem \ref{Septest}. I define the restriction for weak separability $ \mathcal{R}:\mathcal{M}\times \mathcal{P}\times\mathbb{R}_+\to\mathbb{R} $ as: \vspace{0.3cm}

% \[\mathcal{R}(\succeq,p,I) :=  \frac{\partial}{\partial I}\left(\frac{\partial I_2}{\partial I}\frac{\partial I_1}{\partial I}\right)\]
% This is picked as the product within the parenthesis is independent of income. Thus, our restriction must equal zero if the demand function arises from a separate preference.
% \begin{claim}[Uniform Continuity]\label{uni1}
% for every  $\epsilon>0$, there exists $\gamma(\epsilon)>0$ such that  $\forall \succeq \in \mathcal{M},\succeq^* \in \mathcal{S}$
% \[ d(\succeq^*,\succeq)<\gamma(\epsilon)\implies \left\{\int_{\mathcal{P}}\left[\mathcal{R}(\succeq^*,p,I)-\mathcal{R}(\succeq,p,I)\right]^2\right\}^\frac{1}{2}<\epsilon \]
% \[\implies\left\{\int[\mathcal{R}(\succeq,p,I)]^2\right\}^\frac{1}{2}<\epsilon\]
% \end{claim}
% In other words, this means that anything close to separable in the space of preferences nearly satisfies our restriction.
% \begin{proof}
% Under our restriction on the space of preferences, convergence is equivalent to the Hausdorff distance between preferences, as defined in \citet*{hildenbrand2015core}. As Hildenbrand shows, as the space of alternatives is compact, the space of preferences is compact. Therefore, proving continuity suffices. Continuity follows from the continuity of the demand function in the space of preferences, as shown in \citet*{mas1989theory}.
% \end{proof}
% \begin{rem}
% While this function may be hard to compute, it depends only on the underlying space over which the preference is defined and is \textbf{independent} of dataset size, which causes it to not affect complexity.
% \end{rem}
% \subsection*{Our Procedure}
% \begin{enumerate}
%     \item Pick any sequence $\{\epsilon_n\}_{n=1}^\infty$ such that $\epsilon_n\to 0$.
%     \item Sample choice sets(prices) $(\mathbf{A})^n$ from the family of sets.
%     \item Call the underlying preference $\succeq^*$. After n observations, the analyst observes $\{(\mathbf{A},f_{\succeq^*})_{k}\}_{k=1}^n$.
%     \item Define radius after n steps as
%     \[rad(\{(\mathbf{A},f_{\succeq^*})_{k}\}_{k=1}^n)=\inf\{\epsilon\in \{\epsilon_n\}|\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n \text{  is a certificate of radius }\epsilon\}  \]
%     \begin{rem}
%     This infimum exists because the space of preferences $ \mathcal{M}$ is bounded, which means that any observation is a certificate of radius 1.
%     \end{rem}
%     \item Pick any semi-algebraic preference $\succeq$ that rationalizes the observations\footnote{By \cite{kublerschmedders10}, Iknow that any dataset which can be rationalized by a strictly increasing, strictly concave, and continuous utility function can be rationalized by a semi-algebraic utility function. As the DM is known to be monotone, convex, and differentiable, this is possible.} $\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n$ and compute the test statistic 
%     \[T_n=\gamma\left(\left\{\int_{\mathcal{P}}[\mathcal{R}_{\succeq^*}(p,I)]^2dp\right\}^\frac{1}{2}\right)\]
%      \item If $T_n> (rad(\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n))$, the underlying preference $\succeq^*$ can be rejected.
%     \item If $T_n< (rad(\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n))$ draw more samples and repeat
% \end{enumerate}
% \begin{rem}
%     This procedure will only terminate for non-separable preferences.
% \end{rem}
% \begin{rem}
% The first thing to remark is that both certification and uniform continuity are needed to construct the test. Observe that to use uniform continuity to construct a statistic, I need a bound for the distance between the true underlying preference and the preference that the analyst picks. Certifiable convergence provides this bound.
% \end{rem}

% \begin{prop}
%    Our procedure is \textbf{sound}, which means that if the test rejects, then the underlying preference cannot be separable. In other words,\vspace{0.1cm}\\
%    under the null that the data can be rationalized by a suitable utility the alternative is always rejected.
% \end{prop}
% \begin{proof}
    
% I proceed by contradiction, suppose that the true preference $\succeq^*\in \mathcal{S}$, and
% $$(rad(\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n))<T_n$$
% This means that the distance between the chosen preference and the true preference $d(\succeq,\succeq^*)<T_n$, Furthermore,  $T_n=\gamma\left(\left\{\int_{\mathcal{P}}[\mathcal{R}_{\succeq^*}(p,I)]^2dp\right\}^\frac{1}{2}\right)$.\vspace{0.3cm}\\
% As yet, I have used certification bound the distance between the true preference and the one picked by the analyst. Now by applying uniform continuity, I get: \vspace{0.3cm}
% \[d(\succeq,\succeq^*)<\gamma\left(\left\{\int_{\mathcal{P}}[\mathcal{R}_{\succeq^*}(p,I)]^2dp\right\}^\frac{1}{2}\right)\]
% \[\implies \left\{\int_{\mathcal{P}}[\mathcal{R}_{\succeq^*}(p,I)]^2dp\right\}<\left\{\int_{\mathcal{P}}[\mathcal{R}_{\succeq^*}(p,I)]^2dp\right\}\]
% This is a contradiction, which means that $\succeq^*\notin \mathcal{S}$.\vspace{0.3cm}
% \end{proof}

% This proposition shows that uniform continuity and a strong notion of convergence allow us to construct a sound test. I do not yet know if our test has any completeness properties. For asymptotic completeness, our restriction needs to satisfy another condition (which I call regularity). This condition corresponds to the restriction being a characterization of separability.
% \begin{claim}[Regularity at 0]\label{reg1}
% for every $\succeq \in \mathcal{M},\succeq^* \in \mathcal{C}$ and $\epsilon>0$, there exists $\delta^*(\epsilon)>0$ such that
% \[ d^s(\succeq^*,\succeq)>\epsilon\implies\left\{\int_\mathcal{P}[\mathcal{R}(\succeq,p,I)]^2\right\}^\frac{1}{2}>\delta^*(\epsilon)\]
% Meaning that if something \textit{is far away} from our class, then the restriction sends it \textit{far away} from 0.
% \end{claim}
% \begin{rem}
% This implies that our restriction is, in fact, a characterization. If there were a non-separable preference that satisfied our restriction, regularity would be trivially contradicted. I show that the "if and only if" condition on restrictions and uniform continuity is sufficient for regularity in Theorem \ref{regeq}.
% \end{rem}
% \noindent Using the above claim, I can prove that our procedure terminates if $\succeq^*\notin\mathcal{S}$.
% \begin{prop}
% Suppose $\succeq^*\notin\mathcal{S}$ the above procedure must terminate and end in rejection of the generated dataset.
% \end{prop}
% \begin{proof}
% As $\succeq^*\notin\mathcal{S}$, there must be an n such that 
% \[\forall \succeq \text{ such that } d(\succeq^*,\succeq)<rad\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n, \succeq\notin \mathcal{S}\]
% refer to the minimum such n as $n_0$, and $rad\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^{n_0}$ as $rad_0$, sample data $n_1$, until, $rad\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^{n_1}<\frac{rad_0}{2}$.
% By the triangle inequality, for any $\succeq$ that rationalizes $\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^{n_1}$
% \[\forall \succeq_1\in \mathcal{S},\quad \left(d(\succeq_1,\succeq)> \frac{rad_0}{2}\right)\implies\left( \left\{\int_\mathcal{P}[\mathcal{R}(\succeq,p,I)]^2\right\}^\frac{1}{2}>\delta^*(\frac{rad_0}{2})\right) \]
% but this means that $\left\{\int_\mathcal{P}[\mathcal{R}(\succeq,p,I)]^2\right\}^\frac{1}{2}$ is bounded away from 0.\vspace{0.3cm}\\
% But by Theorem \ref{Kublerfin},
% \[\lim_{n\to \infty}rad(\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n)\to 0\].
% This means that eventually 
% \[\left\{\int_\mathcal{P}[\mathcal{R}(\succeq,p,I)]^2\right\}^\frac{1}{2}>rad(\{(\mathbf{A},f_\succeq)_{k}\}_{k=1}^n)\],
% which leads to rejection.
% \end{proof}
% \begin{rem}
% Again notice that rejection requires \textbf{both} regularity and certifiable convergence, which is highlighted in the use of theorem \ref{Kublerfin}.
% \end{rem}
% \begin{rem}
% Many of our results depend on the efficient computability of the restrictions and integrals that I use in our analysis. However, this follows from the rationalizing preference being picked to be semi-algebraic, which makes symbolic computation feasible.
% \end{rem}
% \begin{rem}
% Our analysis also requires that the $\epsilon-\delta$ relationship representing uniform continuity is in itself computable. However, this is unproblematic because the computability of the function is independent of the size of the analyst's dataset.

% \end{rem}
\section{Functional Restrictions}\label{sec:applications}

We first consider the class of demand functions generated by homothetic preferences and then the class of demand functions generated by weakly separable preferences considered in \cite{goldmanuzawa64}.\footnote{A similar analysis could be used to construct tests of strong and Pearce separability.} Next, we consider the class of demand functions that are complements and substitutes. Finally, we consider the class of demand functions generated by preferences in the betweenness class for choice under risk. 

In what follows, we use derivatives of demand functions to construct functional restrictions. Thus, we first show that derivatives and their compositions generate uniformly continuous restrictions.
\begin{lem}
    Suppose the set of preferences $\mathcal{M}$ generates demands that are twice continously differentiable. The map
    \begin{equation*}
        \mathcal{R}(x):=\frac{\partial}{\partial p}x(p,I)
    \end{equation*}
    is uniformly continuous.
\end{lem}
\begin{proof}
    The derivative map is linear, and hence continuous. By assumption, the derivative is differentiable. As the space of bundles is compact, the map is defined from the set of all differentiable functions over a compact set to itself. By the Arzelà-Ascoli theorem, this set of functions is pre-compact, therefore any continuous function to itself must also be uniformly continuous.
\end{proof}
\subsection{Homotheticity}
\begin{lem}
    Let $x_\succeq(p,I)$ be a demand function, $\succeq$ is homothetic if and only if $\frac{d^2 x}{dI^2}=0$.
\end{lem}
\begin{proof}
   By definition, if $x(p,I)$ is homothetic, 
   \[x(p,I)=f(p)\times I \implies \frac{dx}{dI}=f(p)\implies \frac{d^2x}{dI^2}=0\]
   Now suppose $\frac{d^2x}{dI^2}=0$ this implies 
   \[\frac{dx}{dI}=f(p) \implies x(p,I)=x(p,0)+f(p)I.\]
   We know that demand with $0$ income must be $0$, hence:
   \[x(p,I)=f(p)I\]
\end{proof}
\begin{corollary}
    $\mathcal{R}(\succeq)(p)= \frac{d^2 x}{dI^2}$ is a functional characterization of homotheticity.
\end{corollary}
\begin{lem}
    $\mathcal{R}(\succeq)(p)= \frac{d^2 x}{dI^2}$ is uniformly continuous over the space of smooth demand functions.
\end{lem}
\begin{proof}
    Again, continuity of $\mathcal{R}$ follows from the second derivative being a linear transformation of functions. As preferences are assumed to be smooth and demand is defined in a compact domain, the space of demand functions is compact \cite{hildenbrand1970-1}.
\end{proof}
\begin{rem}
    More generally, if we are willing to assume that demand functions have bounded derivatives for both prices and incomes, the compactness of the space of demand functions over a compact set follows quite simply from the Arzelà–Ascoli theorem.
\end{rem}



\subsection{Weak Separability}

\begin{mydef}[Weak Separability]
Suppose that the set of goods can be divided into two subgroups, $g_1$ and $g_2$. We say that a preference $\succeq$ is weakly separable if there exist subutility functions $v_1$, $v_2$ for $g_1$, $g_2$, respectively, and a macro utility function $u$ such that $u(v_1(x_i),v_2(x_j))$ represents $\succeq$, where $i \in g_1$ and $j \in g_2$.
\end{mydef}
\begin{mydef}[Slutsky Matrix]
    The Slutsky Matrix of a demand function $x(p,I)$ is defined as 
    \[S=\frac{dx}{dp}+ x \left[\frac{dx}{dI}\right]^\intercal.\]
We refer to the $ij^{th}$ term of this matrix as $S_{ij}$. The next result characterizes weak separability from restrictions on the Slutsky matrix.
\end{mydef}
\begin{thm}[\cite{goldman1964note}]
    Suppose the set of goods can be divided into two subgroups, $g_1$ and $g_2$. The preference underlying a demand function $x(p,I)$ is weakly separable if and only if:
    \[\forall i \in g_1, j \in g_2, \quad S_{ij}= K^{1,2}(x)\pdv{x_i}{I}\pdv{x_j}{I}.\]
\end{thm}
We now adapt this theorem to construct a test of weak separability in the case of $3$ goods, where $g_1 = \{1\}$ and $g_2 = \{2,3\}$. To this end, notice that with $3$ goods the only Slutsky terms that need to be checked are $S_{12}$ and $S_{13}$.
\begin{lem}
The demand function with $3$ goods and subgroups $g_1 = \{1\}$, $g_2 = \{2,3\}$ can be expressed by a weakly separable utility function if and only if for all prices and incomes:
\[ \frac{S_{12}}{S_{13}} - \frac{\pdv{x_2}{I}}{\pdv{x_3}{I}} = 0. \]
%\[\left[\log S_{12}-\log \frac{dx_1}{dI}-\log\frac{dx_2}{dI}\right]-\left[\log S_{23}-\log \frac{dx_2}{dI}-\log\frac{dx_3}{dI}\right]=0.\]
\end{lem}
This result follows directly from the above theorem and the only possible pairs of goods being $(x_1,x_2)$ and $(x_1,x_3)$. We can now define a functional characterization for weakly separable demand functions.
\begin{corollary} 
    A functional characterization of weak separability is given by \[\mathcal{R}(\succeq)(p) = \frac{S_{12}}{S_{13}} - \frac{\pdv{x_2}{I}}{\pdv{x_3}{I}}. \]
    %\[\mathcal{R}(\succeq)(p)=\left[\log S_{12}-\log \frac{dx_1}{dI}-\log\frac{dx_2}{dI}\right]-\left[\log S_{13}-\log \frac{dx_2}{dI}-\log\frac{dx_3}{dI}\right].\]
\end{corollary}

Finally, note that this functional characterization is uniformly continuous as it is a function of derivatives and compositions of uniformly continuous functions.



\subsection{Complementarity and Substitutability}

Although intuitive notions of complementarity and substitutability might seem straightforward, there have been multiple attempts to formalize these concepts, each having advantages and limitations (see \cite{samuelson1974complementarity} or \cite{newman1987substitutes} for a survey).\par 
Among the definitions looking at demand functions\footnote{The first attempts to define complements and substitutes, originally due to \cite{auspitz2015untersuchungen} and later by \cite{fisher1925mathematical}, \cite{edgeworth1897teoria} and \cite{pareto1909manuel}, were based on the signs of the second derivatives of the utility function, whenever they exist. Given the well-known limitation of this approach that second derivatives are not invariant to monotone transformations, we focus on definitions using demand functions.}, perhaps the most intuitive one is the notion of \textit{gross complementarity (substitutability)}, requiring goods $i$ and $j$ to be gross complements (substitutes) whenever $\frac{\partial x_i(p,I)}{\partial p_j}<(>)\;0$. Due to the existence of income effects, the gross notion of complementarity is not symmetric.\par 
For this reason, the alternative notion of \textit{net complementarity}, due to \cite{hicksallen1934}, defines it in terms of compensated demands. That is, for an underlying utility function $u$, good $i$ is a net complement (substitute) of good $j$ if $\frac{\partial h_i(p,u)}{\partial p_j}<(>)\;0$, where $h(p,u)$ is the Hicksian or compensated demand. By virtue of the fact that $S_{ij}:=\frac{h_i}{p_j}$, and that the Slutsky matrix is symmetric, unlike its gross counterpart, the notion of net complementarity is symmetric. However, as pointed out by \cite{samuelson1974complementarity}, this notion lacks intuitive appeal. While a valid criticism, the Hicks-Allen notion has become the most widely used in economics.\footnote{See \cite{weinstein2022direct} for a novel treatment of complementarity and substitutability aimed to address Samuelson's criticism.} \par 
For any $t\in \mathbb{R}$, let
\begin{equation*}
    F^{>}(t)=
    \begin{cases}
        0 \quad & \text{if } t>0 \\
        1 \quad & \text{otherwise} 
    \end{cases}
    \quad 
    \text{and}
    \quad 
    F^{<}(t)
    \begin{cases}
        0 \quad & \text{if } t<0 \\
        1 \quad & \text{otherwise}. 
    \end{cases}
\end{equation*}

\begin{proposition}
    Given a demand function $x(p,I)$, a  functional restriction of gross complementarity (substitutability) is given by
    \begin{equation*}
        \mathcal{R}(\succeq)(p)=F^{>(<)}\Bigg(\frac{\partial x_i(p,I)}{\partial p_j}\Bigg),
    \end{equation*}
    while a functional restriction for net complementarity (substitutability) is given by
    \begin{equation*}
        \mathcal{R}(\succeq)(p)= F^{>(<)}\Bigg(\frac{\partial x_i(p,I) }{\partial p_j}+ x_j(p,I)\cdot \frac{\partial x_i(p,I)}{\partial I}\Bigg).
    \end{equation*}
\end{proposition}
Note that, as in the case of weak separability, these functional restrictions are uniformly continuous except at zero as they are functions of derivatives of uniformly continuous functions.  Hence, they can be used to test for strict complementarity and strict substitutability.



\subsection{Choice under Risk}

%\subsubsection*{Betweenness Class}

In this section, we study demand for contingent claims in the setting of \cite{kubler2014asset} that gives a functional characterization for expected utility preferences.\footnote{See Theorem 3, pg 3475 \cite{kubler2014asset}.} We extend the analysis to utility functions belonging to the betweenness class as characterized by \cite{dekel1986axiomatic} and \cite{chew1989axiomatic}. A preference in the betweenness class admits an implicit representation and generalizes the expected utility model by requiring indifference curves to be straight lines, but not necessarily parallel. 
 
 There are $S$ states of nature, with elements $s\in \{1,2,\ldots, S\}$. The DM has preferences over state-contingent consumption $\mathbf{x}\in \mathbb{R}_{++}^S$ and objective beliefs $\mathbf{\pi}=(\pi_1,\ldots, \pi_S)\in [0,1]^S$, where $\sum_{s\in S}\pi_s=1$. We assume that the agent's preferences can be represented by a strictly increasing, three times continuously differentiable, and strictly quasi-concave utility function $V(\mathbf{x}; \mathbf{\pi})$. Note that $\mathbf{\pi}$ enters as a parameter rather than a choice variable. By \cite{dekel1986axiomatic} (p. 312), a preference over lotteries belongs to the betweenness class if and only if it admits a representation $V(\mathbf{x}; \mathbf{\pi})$ such that:
\begin{equation}
    \label{eq: betweenness utility}
    V(\mathbf{x}; \mathbf{\pi})=\sum_{s\in S}\pi_s\; u(x_s,V(\mathbf{x}; \mathbf{\pi})),
\end{equation}
where $u:\mathbb{R}_{++}\times [0,1]\rightarrow \mathbb{R}$ is a Bernoulli utility index that is increasing in the first argument and continuous in the second. We further assume that $u$ is three times continuously differentiable in both arguments and concave in consumption. We denote the derivative of $u$ with respect to the $i$-th argument by $u_i$ and require $u_{11}<0$.\par

Markets are assumed to be complete, with prices $p_s$ for each $s\in \{1,2,\ldots, S\}$. As discussed in \cite{kubler2014asset}, this assumption allows us to focus directly on the contingent-claim demand $\mathbf{x}(\mathbf{p}, I, \mathbf{\pi})$ that solves
\begin{equation}
    \label{eq: between max problem}
    \max_{\mathbf{x}\in \mathbb{R}_{++}^S} V(\mathbf{x},\mathbf{\pi}) \quad \text{subject to} \quad \langle \mathbf{p}, \mathbf{x}\rangle \leq I.
\end{equation}

\begin{proposition}
    Suppose $S>2$ and contingent demands $x_s(\mathbf{p}, I, \mathbf{\pi})>0$, $s = 1,\ldots, S$, can be rationalised by a well-defined utility function. Then, a necessary condition for this utility function to be in the betweenness class defined in equation \eqref{eq: betweenness utility} is the existence of a function $f:\mathbb{R}^3_{++}\rightarrow \mathbb{R}$ such that $x_s(\mathbf{p},I,\mathbf{\pi})= f(x_1,x_2,k_s)$, where $k_s=\frac{\pi_s}{\pi_1}\frac{p_1}{p_s}$, $f$ is strictly increasing in $k_s$, and $f(x,x,1)=x$.
\end{proposition}
\begin{proof}
    The first-order conditions of the maximization problem \eqref{eq: between max problem} for any state $s\in \{2,3,\ldots, S\}$ yield the following results:
    \begin{equation}
    \label{eq: FOC between s,1}
        \mathsf{MRS}_{1,s}=\frac{\partial V(\mathbf{x},\mathbf{\pi})\backslash \partial x_1}{\partial V(\mathbf{x},\mathbf{\pi})\backslash \partial x_s}=\frac{\pi_s \cdot p_1}{\pi_1 \cdot p_s}.
    \end{equation}
    Now, we have
    \begin{equation*}
         \frac{\partial V(\mathbf{x},\mathbf{\pi})}{\partial x_s}=\pi_s \left[ u_1(x_s,V(\mathbf{x,\pi})) + u_2(x_s,V(\mathbf{x,\pi}))\frac{\partial V(\mathbf{x},\mathbf{\pi})}{\partial x_s} \right] + \sum_{s^\prime \neq s} \pi_{s^\prime} \; u_2(x_{s^\prime},V(\mathbf{x,\pi}))
    \end{equation*}
    which is equivalent to 
    \begin{equation*}
        \frac{\partial V(\mathbf{x},\mathbf{\pi})}{\partial x_s} = \pi_s u_1(x_s,V(\mathbf{x,\pi}))) \cdot \left(1-\sum_{s=1}^S \pi_s \; u_2(x_s,V(\mathbf{x,\pi}))) \right)^{-1}
    \end{equation*}
    Hence, for any $s,s^\prime\in \{1,2,\ldots, S\}$
    \begin{equation*}
        \mathsf{MRS}_{s,s^\prime}=\frac{\pi_s u_1(x_s,V(\mathbf{x,\pi})) \cdot \left(1-\sum_{s=1}^S \pi_s \; u_2(x_s,V(\mathbf{x,\pi})) \right)^{-1}}{\pi_{s^\prime} u_1(x_{s^\prime},V(\mathbf{x,\pi}))) \cdot \left(1-\sum_{s=1}^S \pi_s \; u_2(x_s,V(\mathbf{x,\pi}))) \right)^{-1}}=\frac{u_1(x_s, V(\mathbf{x,\pi}))}{u_1(x_{s^\prime},V(\mathbf{x,\pi}))}.
    \end{equation*}
    For $s=2$, we can rewrite \eqref{eq: FOC between s,1} as
    \begin{equation}
    \label{eq: foc between 1,2}
        \frac{u_1(x_1, V(\mathbf{x,\pi}))}{u_1(x_2,V(\mathbf{x,\pi}))}= \frac{\pi_2 \cdot p_1}{\pi_1 \cdot p_2}
    \end{equation}
    Given the uniqueness of $V(\cdot,\cdot)$ in the implicit representation \eqref{eq: betweenness utility} (see \cite{dekel1986axiomatic} p. 314), equation \eqref{eq: foc between 1,2} allows us to solve for $V(\mathbf{x,\pi})$. Thus, for any other $s\in \{3,4,\ldots, S\}$, it holds that the expression
    \begin{equation*}
        \frac{u_1(x_1,V(\mathbf{x,\pi}))}{u_1(x_s, V(\mathbf{x,\pi}))}= \frac{\pi_s \cdot p_1}{\pi_1 \cdot p_s}
    \end{equation*}
    can be solved for $x_s$, and using the budget constraint, it yields a unique solution to the optimization problem \eqref{eq: between max problem} requiring the existence of a function $f:\mathbb{R}^3_{++}\rightarrow \mathbb{R}$ such that
    \begin{equation}
        \label{eq: betweenes f function}
        x_s= f(x_1,x_2,k_s) \quad \text{where} \quad k_s:= \frac{\pi_1}{\pi_s} \frac{p_s}{p_1}
    \end{equation}
    with the desired properties. Note that the dependence of $x_s$ on $x_2$ comes from \eqref{eq: foc between 1,2}. 
\end{proof}

\begin{corollary}
A functional restriction that is a necessary condition for a preference $\succsim$ to be in the betweenneess class is as follows. Let $\Vec{p}_{1,2}^{-s}$ be a direction of price changes where $p_s$ is constant and $x_1,x_2$ are unchanging. The directional derivative of $x_s$ in this direction must be $0$. Formally:
    \begin{equation*}
        \mathcal{R}_{bet}(\succeq)(p)=\frac{\partial x_s}{\partial \Vec{p}_{1,2}^{-s}}\Bigr|_{\substack{x_1,x_2}} = 0 \quad \forall s\neq s^\prime \in \{3,4,\ldots, S\},
    \end{equation*}
    where this derivative is taken in directions where $x_1,x_2$ are not changing.
\end{corollary}

\begin{corollary}
    Let $\mathcal{U} \subset \mathcal{M}$ be the class of preferences characterized by $\mathcal{R}_{bet}$, i.e.
    \[\succeq \in \mathcal{U} \iff \succeq \in \mathcal{R}_{bet}. \]
    The class of betweenness preferences is a subset of $\mathcal{U}$.
\end{corollary}
This gives us a one-sided test of betweenness preferences which is weaker than a test of expected utility provided by \cite{kubler2014asset}. A test that is generated from the above restrictions will never reject demands from the betweenness class; of course, the other direction of the implication is open, so we may not reject all preferences that are not from the betweenness class.




\section{Implementation} \label{sec:implementation}

This section assesses the empirical performance of our tests in the case of homothetic and weakly separable preferences.



\subsection{Simulations}


In what follows, we approximate the class of rational preferences $\mathcal{M}$ using AIDS as the resulting demand functions correspond to first-order approximations to any demand function derived from utility maximization
\citep{DeatonMuell1980}. Let $K$ denote the number of goods and $I$ denote income. The almost ideal demand functions when there are two goods are given by 
\begin{align*}
    \frac{x_{1,t}}{I} &= \alpha_1 + \gamma_{1,1}\log(p_{1,t}) + \gamma_{1,2}\log(p_{2,t}) + \beta_{1}\log(I/P_t) \\
    \frac{x_{2,t}}{I} &= \alpha_{2} + \gamma_{2,1}\log(p_{1,t}) + \gamma_{2,2}\log(p_{2,t}) + \beta_{2}\log(I/P_t),
\end{align*}

\noindent
where
\begin{equation*}
    P_t = \exp \left(  \sum_{k} \alpha_{k}\log(p_{k,t}) + \frac{1}{2} \sum_{j}\sum_{k} \gamma_{k,j} \log(p_{k,t}) \log(p_{j,t}) \right).
\end{equation*}

We impose the following restrictions on demand parameters to ensure demands satisfy adding up, Slutsky symmetry, and are homogeneous of degree zero in prices and expenditure:
\begin{align*}
    \sum_{i} \alpha_i = 1, \; \sum_{i} \gamma_{i,j} = 0, \; \sum_{i}\beta_i = 0, \; \sum_j \gamma_{i,j} = 0, \; \gamma_{i,j} = \gamma_{j,i}.
\end{align*}

We check the effectiveness of our approach to correctly reject a data generating process outside a class of interest. We first consider the class of homothetic preferences ($\beta = 0$). The data generating processes are given by almost ideal demand functions with varying strengths of income effects as captured by $\beta$.\footnote{Note that $\beta$ is the only parameter that affects the functional restriction for the class of homothetic preferences.} Results are presented in Table \ref{tab:homo}.

\begin{center}
\captionof{table}{Homotheticity} \label{tab:homo} 
\begin{tabular}{|c||*{5}{c|}}\hline
$\beta$
&\makebox[3em]{$10^{-1}$}&\makebox[3em]{$10^{-2}$}&\makebox[3em]{$10^{-3}$}
&\makebox[3em]{$10^{-4}$}&\makebox[3em]{$10^{-5}$}\\\hline
$\epsilon_k$ & 1.0 & 1.0 & 1.0 & 1.0 & 0.33 \\\hline
$\delta_k$ & 0.05 & 0.05 & 0.05 & 0.05 & 0.016 \\\hline
$n(\epsilon_k,\delta_k)$ & 60 & 60 & 60 & 60 & 100 \\\hline 
$T_n$ & 8.84 & 7.97 & 7.71 & 5.80 & 0.41 \\\hline
\end{tabular}
\end{center}

Table \ref{tab:homo} shows that our method quickly rejects $(TS_n > \epsilon_k)$ a dataset whose demands are not homothetic with a low probability $(\delta_k)$ of falsely rejecting the null hypothesis. The number of observations $(n)$ needed to correctly reject the null hypothesis only needs to be larger when the data generating process is extremely close $(\beta = 10^{-5})$ to the class of homothetic preferences.

Next, we consider the null hypothesis that observed demands are generated by weakly separable preferences. The data generating processes are given by an almost ideal demand function with $\beta = 0$ and varying  $\gamma_{i,j}$, where $i \in g_1$ and $j \in g_2$. Note that the data generating process would be consistent with weak separability if $\gamma_{1,2} = \gamma_{1,3} = 0$. Results are presented in Table \ref{tab:ws}.

\begin{center}
\captionof{table}{Weak Separability} \label{tab:ws} 
\begin{tabular}{|c||*{5}{c|}}\hline
$\gamma_{1,j}$
&\makebox[3em]{$10^{-1}$}&\makebox[3em]{$10^{-2}$}&\makebox[3em]{$10^{-3}$}
&\makebox[3em]{$10^{-4}$}&\makebox[3em]{$10^{-5}$}\\\hline
$\epsilon_k$ & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 \\\hline
$\delta_k$ & 0.05 & 0.05 & 0.05 & 0.05 & 0.05 \\\hline
$n(\epsilon_k,\delta_k)$ & 60 & 60 & 60 & 60 & 60 \\\hline 
$T_n$ & 19.31 & 19.31 & 19.31 & 19.30 & 17.54 \\\hline
\end{tabular}
\end{center}

Table \ref{tab:ws} shows that the test correctly rejects demand observations that are not generated by weakly separable preferences without any difficulty. Additional details about the simulations are provided in the Appendix.




\section{Extensions and Other Properties} \label{sec:extensions}

\subsection{Measurement Error}
The previous results have shown how to test restrictions on demands when we perfectly observe choices made by an agent. This section shows that additive measurement error does not affect the validity of our procedure under reasonable assumptions. We appeal largely to \cite{bartlett1994fat}, but adapt their assumptions to our specific setting. 

Let $\mathcal{D}$ be the class of distributions with mean $0$ and variance bounded above by some uniform bound $V_\mathcal{D}$. Further, assume that every distribution $D \in \mathcal{D}$ has a uniformly continuous cumulative density function.
\begin{mydef}
    A distribution of measurement error is \textit{admissible} if it belongs to $\mathcal{D}$.
\end{mydef}

\begin{thm}\citep[Theorem 24]{bartlett1994fat}
Suppose that we have a class of functions $\mathcal{F}:\mathcal{X} \to [0,1]$ that is learnable. Also, suppose the data are subject to admissible measurement error such that the analyst observes $\{f(x_i)+\eta_i\}_{i=1}^n$, where $\eta_i$ is an i.i.d. realization from some distribution $D \in \mathcal{D}$. The class $\mathcal{F}$ is learnable.
\end{thm}
\begin{corollary}
    If there is admissible measurement error on individual choices, then the family of income Lipschitz demands is learnable.
\end{corollary}

\subsection{Choice Set Independence}
We finally discuss one more attractive property of our approach. That is, the independence of our procedure from the nature of choice sets observed by the analyst. Note that this is in stark contrast from ``revealed preference" tests that do depend on the nature of budget sets and the sufficiency of first-order conditions.\footnote{See \citet*{Nishimuraokquah2017,polisson2020rp,forges2009afriat}} Unlike the classical literature on revealed preference, we do not use the Lagrangian approach, thus avoiding its limitations. All we require is that the setup we are considering allows for uniform PAC learnability of preferences (or demand functions).

\begin{lem}
 Suppose $\mathcal{O}$ is a family of choice sets and $O$ is an element of $\mathcal{O}$. Assume a decision maker with preference $\succeq$ generates data of the form $\{O,x(O)\}_{O=1}^n$. If individual demand functions are PAC learnable under the family of budget sets $\mathcal{O}$. Any restriction $\mathcal{R}$ which can be used as a test with prices can be used to construct a test with the new datasets $\mathcal{C}\subset\mathcal{M}$.
\end{lem}
\begin{proof}
The argument is simple: in our procedure, we never used the structure of the data we observed other than using it to generate a candidate demand. By the definition of PAC learnability from \cite{valiant84}, it must be that for any $\epsilon,\delta >0$ there is an $n$ such that the probability that generalization error is greater than $\epsilon$ is less than $\delta$. This is the only condition we need for our procedure to work.
\end{proof}


% \subsection{The Rationality Assumption}

% Until now, all of our results have assumed that preferences are rational, by which we mean that they are complete, monotone, and transitive. \textit{However, is this assumption needed for our results?}

% For separability, we show that this is indeed the case. As long as the analyst is unwilling to assume that the underlying preference is monotonic, there is always an additively separable preference that rationalizes \textit{any} dataset. Thus, the only sound test of separability accepts all datasets.

% \begin{thm}
%  For simplicity, assume that $\mathcal{X}
% \subset \mathbb{R}^3$. Furthermore, let $\mathcal{A}=\mathcal{X}\times\mathcal{X}$ be the family of all pairwise comparisons. Furthermore, let $\{(p,x)_{k}\}_{k=1}^n$ be any \textit{finite} dataset generated from this family. There exists an additively separable utility function U that rationalizes the data.
% \end{thm}
% \begin{proof}
% To rationalize any finite dataset $\{(p,x)_{k}\}_{k=1}^n$ generated from $\mathcal{A}$, we need to find a utility function $U(x,y,z)=U(x)+U(y)+U(z)$, where for some finite pairs of the form 
% $(x_1,y_1,z_1)^i,(x_2,y_2,z_2)^i$,
% \[\forall i U((x_1,y_1,z_1)^i)>U ((x_2,y_2,z_2)^i)\]
% To construct such a function, assume integer values of U at the required finite points and assume that 
% \[U(x,y,z)=\sum_{n=1}^k a_ix_i^n+ \sum_{n=1}^k b_iy_i^n+\sum_{n=1}^k c_iz_i^n\]
% where $k$ is the size of the set of observations. Such a polynomial exists by the Lagrange interpolation theorem.
% \end{proof}
% This argument shows that monotonicity is a necessary assumption required for our results. There may well be no finite analogue of derivative restrictions if monotonicity is relaxed.



\section{Conclusion} \label{sec:conclusion}

This paper introduces an innovative approach to test decision-makers' adherence to specific classes of choice behavior using finite choice data. Traditionally, the revealed preference (RP) approach has been used to conduct such tests. However, the RP approach can be computationally intractable for certain classes of preferences. To address this issue, we propose an alternative method based on preference learnability to adapt tests of demand functions to finite choice data, thus allowing us to exploit the increased simplicity of functional tests.

%This paper introduces an innovative approach to testing decision-makers' adherence to specific classes of choice behavior using finite choice data. Traditionally, the revealed preference (RP) approach, which checks the feasibility of a system of inequalities, has been used to conduct such tests. However, the RP approach can be computationally intractable for certain preference classes. To address this challenge, we propose an alternative method that adapts tests of demand functions to finite choice data, exploiting the simplicity gap between RP and functional tests.

%We leverage recent advancements in preference learnability to adapt functional tests to finite data. 

Our approach shifts the focus from testing the dataset itself to testing the decision maker (DM). Unlike RP tests that always reject a dataset if it cannot be rationalized by any preference from the class of interest, our tests are one-sided: they never reject a rationalizable dataset but may fail to reject a non-rationalizable one. However, the probability of failing to reject a non-rationalizable dataset decreases as more data are sampled. Our simulation exercises show that our tests perform well in finite samples and correctly reject demands that do not belong to specific classes of preferences.

%We show that functional tests can be used to test finite data and construct a test for weak separability, a preference class for which RP characterization is NP-Hard. Our tests are computationally efficient, relying on functional restrictions and leveraging the PAC learning framework to ensure accuracy as the sample size increases.

Our procedure is grounded in the Probably Approximately Correct (PAC) learning framework and enables us to construct tests that unite functional and finite data testing approaches. This new method holds promise for a wide range of applications, from weak separability to choice under risk, demonstrating its versatility for the analysis of decision making.


%Our procedure builds on the Probably Approximately Correct (PAC) learning framework and enables us to construct tests that unite functional and finite data testing approaches. We show that functional tests can be used to test finite data under weak conditions. This is exemplified by constructing a test for weak separability, a preference class for which RP characterization is NP-Hard. Our tests are computationally efficient, relying on functional restrictions and leveraging the PAC learning framework to ensure accuracy as the sample size increases. This new approach holds promise for a wide range of applications, from weak separability to choice under risk, demonstrating its versatility for the analysis of decision making.
%In summary, our proposed method offers a tractable and efficient alternative to RP tests, particularly for classes of preferences where traditional approaches are computationally challenging. This new approach holds promise for a wide range of applications, from weak separability to choice under risk, demonstrating its versatility and robustness in empirical analysis of decision making.


\section*{Appendix}

This appendix provides additional details about the simulatons.

\subsection*{Pseudo-Code}

The following pseudo algorithm details the procedure for testing whether $x_{\succeq}(p) \in \mathcal{C}$ in our simulations.
\begin{enumerate}
    \item Define two sequences $(\epsilon_k)_{k=1}^{\infty} \rightarrow 0$, $(\delta_k)_{k=1}^{\infty} \rightarrow 0$ and let $T_n = 0$.
    \item Compute the size of the dataset $n(\epsilon_k,\delta_k)$ required for the observed demand $x_{\succeq}$ and the true demand $x_{\succeq}^{*}$ to be within $\epsilon_k$ from one another with probability $1-\delta_k$.
    \item Draw prices $p$ of dimension $K \times n(\epsilon_k,\delta_k)$ uniformly over an arbitrary interval.
    \item Compute the functional restriction at the observed demands $\mathcal{R}(x_{\succeq}(p))$.
    \item Compute $\gamma(\cdot)$.
    \item Compute $T_n = \gamma \left(\left\{\int_{\mathcal{P}}|\mathcal{R}(\succeq)(p)|^2\,dp\right\}^\frac{1}{2}\right)$. If $T_n > \epsilon_k$, stop. Else, let $k = k+1$ and go back to Step 2.
\end{enumerate}

Note that the algorithm can be easily adapted for real datasets. Indeed, Step $3$ would be skipped since the distribution of prices is given by the empirical distribution. Also, since the number of observations $n$ is fixed, the algorithm would stop as soon as $T_n > \epsilon_k$ or $n(\epsilon_k,\delta_k) > n$. In the latter case, we would not reject $x_{\succeq}(p) \in \mathcal{C}$.



\subsection*{Approximating $\mathcal{C}$}

Recall that the set of rational demands is approximated by AIDS. In what follows, we detail how we approximate the set of demands that belong to the class of interest $\mathcal{C}$. 

For homothetic preferences, the parameters $\alpha_{i}$ are drawn uniformly from $[0,1]$ and the parameters $\gamma_{i,j}$ are drawn uniformly over the support that ensures demands are positive. The parameters $\beta_{i}$ determine whether demands are consistent with the functional restriction for homotheticity, where $\beta_{i} = 0$ if and only if $\mathcal{R}(\succeq) = 0$. The latter motivates approximating the class of homothetic preferences $\mathcal{C}$ by AIDS demands with the additional restriction $\beta = 0$. 

For weakly separable preferences, \citet*{Moschini1994} provide restrictions on AIDS demands to satisfy weak separability. In the case of two groups, weak separability requires
\begin{equation*}
    \frac{\gamma_{i,k} + x_ix_k + \beta_i\beta_k + \log(I/P_t)}{\gamma_{j,m} + x_jx_m + \beta_j\beta_m +\log(I/P_t)} = \frac{(x_i + \beta_i)(x_k + \beta_k)}{(x_j + \beta_j)(x_m + \beta_m)},
\end{equation*}

\noindent
where $(i,j) \in g_1$ and $(k,m) \in g_2$. This condition holds globally if $\beta_i = \beta_j = \beta_k = \beta_m = 0$ and $\gamma_{i,l} = \gamma_{j,m} = 0$. In our simulations, we consider data generating processes that deviate from those restrictions. 


%Unfortunately, this restriction is equivalent to homothetic weak separability with unit income elasticity within groups. Using this restriction as an approximation of the class of weakly separable preferences $\mathcal{C}$ may thus artificially inflate the function $\gamma(\cdot)$ and lead to an overrejection of the null hypothesis. In our simulations, we draw prices uniformly such that their mean is unity. It is generally believed that $\alpha_0$ is of little importance such that we further impose $\alpha_0 = 0$. Thus, a local test of weak separability at the mean $(p_t,I) = (1,I)$ is given by
%\begin{align*}
%    \frac{\gamma_{i,k} + (\alpha_i + \beta_i \log(I))(\alpha_k + \beta_k\log(I)) + \beta_i\beta_k + \log(I)}{\gamma_{j,m} + (\alpha_j + \beta_j \log(I)))(\alpha_m + \beta_m\log(I)) + \beta_j\beta_m + \log(I)}  \\ = \frac{(\alpha_{i} + \beta_i\log(I) + \beta_i)(\alpha_{k} + \beta_k \log(I) + \beta_k)}{(\alpha_{j} + \beta_j\log(I) + \beta_j)(\alpha_{m} + \beta_m\log(I)+ \beta_m)},
%    \frac{\gamma_{i,k} + (\alpha_i + \beta_i \alpha_0)(\alpha_k - \beta_k\alpha_0) - \beta_i\beta_k \alpha_0}{\gamma_{j,m} + (\alpha_j + \beta_j \alpha_0)(\alpha_m - \beta_m\alpha_0) - \beta_j\beta_m \alpha_0} = \frac{(\alpha_{i} - \beta_i\alpha_0 + \beta_i)(\alpha_{k} - \beta_k\alpha_0 + \beta_k)}{(\alpha_{j} - \beta_j\alpha_0 + \beta_j)(\alpha_{m} - \beta_m\alpha_0 + \beta_m)},
%\end{align*}
%
%\noindent
%for all $(i,j) \in g_1$ and $(k,m) \in g_2$. %The restriction thus boils down to
%\begin{equation*}
%    \frac{\gamma_{i,k} + \alpha_{i}\alpha_{k}}{\gamma_{j,m} + \alpha_j \alpha_m} =  \frac{(\alpha_i + \beta_i)(\alpha_k + \beta_k)}{(\alpha_j + \beta_j)(\alpha_m + \beta_m)}
%\end{equation*}
%
%\noindent
%for all $(i,j) \in g_1$ and $(k,m) \in g_2$.



%Note to self: Instead of assuming a CES demand function, I may just as well generates demands from AIDS with beta = 0... Not sure why I did not do that initially...

%We approximate the set of homothetic demands $\mathcal{C}$ by the class of CES demand functions $\mathcal{C}'$. Observe that $\mathcal{C}' \subset \mathcal{C}$ such that the function $\gamma(\cdot)$ may be overestimated. In general one may obtain demand functions from $\mathcal{C}$ by solving a nonlinear system of inequalities (e.g., using restrictions from Diewert 2012). In the case of demands induced by the class of CES utility functions, the demands are given by
%\begin{align*}
%    x_{1,t}^{*} &= \left(\frac{a}{p_{1,t}}\right)^{\sigma}\frac{1}{a^{\sigma}p_{1,t}^{1 - \sigma} + (1-a)^{\sigma}p_{2,t}^{1 - \sigma}} \\
%    x_{2,t}^{*} &= \left(\frac{1-a}{p_{2,t}}\right)^{\sigma}\frac{1}{a^{\sigma}p_{1,t}^{1 - \sigma} + (1-a)^{\sigma}p_{2,t}^{1 - \sigma}},
%\end{align*}
%
%\noindent
%where $a \in (0,1)$ is the share parameter and $\sigma \in (0,\infty)$ is the elasticity of substitution.



The functional restriction for weak separability is not well-defined when preferences are homothetic in the class of almost ideal demands. Indeed, in this special case we have $S_{ij} = 0$ for all $i \in g_1$ and $j \in g_2$. Thus, we define the functional restriction for homothetic weak separability by the average absolute deviation:
\begin{equation*}
    \mathcal{R}(\succeq)(p) = \frac{1}{\abs{g_1 + g_2}} \sum_{i \in g_1} \sum_{j \in g_2} abs(S_{i,j}),
\end{equation*}

\noindent
where $\abs{\cdot}$ denotes the cardinality of the separable group.




\subsection*{Dataset Size}

Let $L$ denote the income-Lipschitz constant for the class of demands $\mathcal{M}$. Let $fat_{\mathcal{M}}$ denote the fat-shattering dimension of $\mathcal{M}$. \cite{beigman2006learning} show that $fat_{\mathcal{M}}(\epsilon) \leq \left(\frac{L}{\epsilon}\right)^{K}$ and that the true demand function can be learned (up to $\epsilon$-$\delta$ accuracy) with a number of observations $n(\epsilon,\delta) = O(\frac{1}{\epsilon^2}(\log^2(\frac{1}{\epsilon})fat_{\mathcal{M}}(\epsilon) + \log(\frac{1}{\delta}))$, where $\epsilon,\delta > 0$. With the class of rational preferences approximated by AIDS, $\pdv{x(p)}{I} = \beta/I$ such that $L = abs(\beta/I)$. This gives the fat-shattering dimension and allows us to compute $n(\epsilon,\delta)$ up to some scale $C > 0$. In our simulations, we set the scaling of $n(\epsilon,\delta)$ to $20$. 


\subsection*{Gamma function}

For $S$ pairs $(\succeq,\succeq^*) \in \mathcal{C} \times \mathcal{M}$, compute $erf(\succeq,\succeq^{*}) = \left( \sum_{k,t} \frac{1}{KT} (x_{k,t}(\succeq,p) - x_{k,t}(\succeq^{*},p))^2 \right)^{0.5}$ and the functional restriction $R(\succ)(p) := \int_{\mathcal{P}} |\mathcal{R}(x_{\succeq}(p))|^2 \,dp = \left(\sum_{k,t} \frac{1}{KT} \mathcal{R}(x_{k,t}(\succeq,p))^2 \right)^{0.5}$. Let $\mathcal{A}$ denote the set of all pairs $(\succeq,\succeq^{*})$ such that $\mathcal{R}(\succeq)(p) \leq \epsilon_k$. Define $\gamma(\epsilon_k) = \underset{{(\succeq,\succeq^{*}) \in \mathcal{A}}}{\max} erf(\succeq,\succeq^{*})$. In the case of AIDS, we have $\mathcal{R}(x_{k,t}(\succeq,p)) = -\beta_k$.






\bibliography{Raghav}
\end{document}


\begin{thebibliography}{50}
\newcommand{\enquote}[1]{``#1''}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\providecommand{\urlprefix}{URL }
\providecommand{\bibAnnoteFile}[1]{%
  \IfFileExists{#1}{\begin{quotation}\noindent\textsc{Key:} #1\\
  \textsc{Annotation:}\ \input{#1}\end{quotation}}{}}
\providecommand{\bibAnnote}[2]{%
  \begin{quotation}\noindent\textsc{Key:} #1\\
  \textsc{Annotation:}\ #2\end{quotation}}

\bibitem[{Afriat(1967)}]{afriat1967construction}
Afriat, Sydney~N (1967), \enquote{The construction of utility functions from expenditure data.} \emph{International economic review}, 8(1), 67--77.
\bibAnnoteFile{afriat1967construction}

\bibitem[{Aguiar and Kashaev(2021)}]{AK2021}
Aguiar, Victor~H and Nail Kashaev (2021), \enquote{Stochastic revealed preferences with measurement error.} \emph{The Review of Economic Studies}, 88(4), 2042--2093.
\bibAnnoteFile{AK2021}

\bibitem[{Aguiar and Serrano(2017)}]{aguiar2017slutsky}
Aguiar, Victor~H and Roberto Serrano (2017), \enquote{Slutsky matrix norms: The size, classification, and comparative statics of bounded rationality.} \emph{Journal of Economic Theory}, 172, 163--201.
\bibAnnoteFile{aguiar2017slutsky}

\bibitem[{Aguiar and Serrano(2018)}]{aguiar2018classifying}
Aguiar, Victor~H and Roberto Serrano (2018), \enquote{Classifying bounded rationality in limited data sets: a slutsky matrix approach.} \emph{SERIEs}, 9(4), 389--421.
\bibAnnoteFile{aguiar2018classifying}

\bibitem[{Antonelli(1971)}]{antonelli71}
Antonelli, G. (1971), \enquote{On the mathematical theory of political economy.} In \emph{Preference, Utility and Demand} (J.~Chipman, L.~Hurwicz, M.~Richter, and H.~Sonnenschein, eds.), Harcourt Brace Jovanavich Ltd.
\bibAnnoteFile{antonelli71}

\bibitem[{Auspitz and Lieben(1889)}]{auspitz2015untersuchungen}
Auspitz, Rudolf and Richard Lieben (1889), \emph{Untersuchungen {\"u}ber die Theorie des Preises}. Duncker und Humblot.
\bibAnnoteFile{auspitz2015untersuchungen}

\bibitem[{Bartlett et~al.(1994)Bartlett, Long, and Williamson}]{bartlett1994fat}
Bartlett, Peter~L, Philip~M Long, and Robert~C Williamson (1994), \enquote{Fat-shattering and the learnability of real-valued functions.} In \emph{Proceedings of the seventh annual conference on Computational learning theory}, 299--310.
\bibAnnoteFile{bartlett1994fat}

\bibitem[{Beigman and Vohra(2006)}]{beigman2006learning}
Beigman, Eyal and Rakesh Vohra (2006), \enquote{Learning from revealed preference.} In \emph{Proceedings of the 7th ACM Conference on Electronic Commerce}, 36--42.
\bibAnnoteFile{beigman2006learning}

\bibitem[{Chambers et~al.(2016)Chambers, Echenique, and Saito}]{chambersetal16}
Chambers, C., F.~Echenique, and K.~Saito (2016), \enquote{Testing theories of financial decision making (formerly titled testable implications of ranslation invariance and homotheticity: Variational, maxmin, cara and crra preferences).} \emph{Proceedings of the National Academy of Sciences}, 113.
\bibAnnoteFile{chambersetal16}

\bibitem[{Chambers and Echenique(2016)}]{chambers_echenique_2016}
Chambers, Christopher~P. and Federico Echenique (2016), \emph{Preface}, xiii--xx. Econometric Society Monographs, Cambridge University Press.
\bibAnnoteFile{chambers_echenique_2016}

\bibitem[{Chambers et~al.(2021)Chambers, Echenique, and Lambert}]{chambers2021recovering}
Chambers, Christopher~P, Federico Echenique, and Nicolas~S Lambert (2021), \enquote{Recovering preferences from finite data.} \emph{Econometrica}, 89(4), 1633--1664.
\bibAnnoteFile{chambers2021recovering}

\bibitem[{Chambers et~al.(2017)Chambers, Echenique, and Shmaya}]{chambers2017general}
Chambers, Christopher~P, Federico Echenique, and Eran Shmaya (2017), \enquote{General revealed preference theory.} \emph{Theoretical Economics}, 12(2), 493--511.
\bibAnnoteFile{chambers2017general}

\bibitem[{Cherchye et~al.(2015)Cherchye, Demuynck, {De Rock}, and Hjertstrand}]{Cherchyeinteger2015}
Cherchye, Laurens, Thomas Demuynck, Bram {De Rock}, and Per Hjertstrand (2015), \enquote{{Revealed preference tests for weak separability: An integer programming approach}.} \emph{Journal of Econometrics}, 186(1), 129--141, \urlprefix\url{https://ideas.repec.org/a/eee/econom/v186y2015i1p129-141.html}.
\bibAnnoteFile{Cherchyeinteger2015}

\bibitem[{Chew(1989)}]{chew1989axiomatic}
Chew, Soo~Hong (1989), \enquote{Axiomatic utility theories with the betweenness property.} \emph{Annals of operations Research}, 19(1), 273--298.
\bibAnnoteFile{chew1989axiomatic}

\bibitem[{Crawford and {De Rock}(2014)}]{CrawfordEmpirical2014}
Crawford, Ian and Bram {De Rock} (2014), \enquote{{Empirical Revealed Preference}.} \emph{Annual Review of Economics}, 6(1), 503--524, \urlprefix\url{https://ideas.repec.org/a/anr/reveco/v6y2014p503-524.html}.
\bibAnnoteFile{CrawfordEmpirical2014}

\bibitem[{Deaton and Muellbauer(1980)}]{DeatonMuell1980}
Deaton, Angus and John Muellbauer (1980), \emph{{Economics and Consumer Behavior}}. Number 9780521296762 in Cambridge Books, Cambridge University Press, \urlprefix\url{https://ideas.repec.org/b/cup/cbooks/9780521296762.html}.
\bibAnnoteFile{DeatonMuell1980}

\bibitem[{Dekel(1986)}]{dekel1986axiomatic}
Dekel, Eddie (1986), \enquote{An axiomatic characterization of preferences under uncertainty: Weakening the independence axiom.} \emph{Journal of Economic theory}, 40(2), 304--318.
\bibAnnoteFile{dekel1986axiomatic}

\bibitem[{Demuynck and Hjertstrand(2019)}]{demuynck2019samuelson}
Demuynck, Thomas and Per Hjertstrand (2019), \enquote{Samuelson’s approach to revealed preference theory: Some recent advances.} \emph{Paul Samuelson}, 193--227.
\bibAnnoteFile{demuynck2019samuelson}

\bibitem[{Echenique and Saito(2015)}]{echeniquesaito15}
Echenique, F. and K.~Saito (2015), \enquote{Savage in the market.} \emph{Econometrica}, 83, 1467--1495.
\bibAnnoteFile{echeniquesaito15}

\bibitem[{Echenique(2014)}]{echenique2014testing}
Echenique, Federico (2014), \enquote{Testing for separability is hard.} \emph{arXiv preprint arXiv:1401.4499}.
\bibAnnoteFile{echenique2014testing}

\bibitem[{Echenique(2019)}]{EcheniqueRPreview2019}
Echenique, Federico (2019), \enquote{{New developments in revealed preference theory: decisions under risk, uncertainty, and intertemporal choice}.} Papers 1908.07561, arXiv.org, \urlprefix\url{https://ideas.repec.org/p/arx/papers/1908.07561.html}.
\bibAnnoteFile{EcheniqueRPreview2019}

\bibitem[{Edgeworth(1897)}]{edgeworth1897teoria}
Edgeworth, Francis~Y (1897), \enquote{La teoria pura del monopolio.} \emph{Giornale degli economisti}, 13--31.
\bibAnnoteFile{edgeworth1897teoria}

\bibitem[{Epstein(2000)}]{Epstein2000probsoph}
Epstein, Larry~G. (2000), \enquote{{Are Probabilities Used in Markets ?}} \emph{Journal of Economic Theory}, 91(1), 86--90, \urlprefix\url{https://ideas.repec.org/a/eee/jetheo/v91y2000i1p86-90.html}.
\bibAnnoteFile{Epstein2000probsoph}

\bibitem[{Fisher(1892)}]{fisher1925mathematical}
Fisher, I (1892), \enquote{Mathematical investigations in the theory of value and prices. transactons of the connecticut academy, vol. ix.}
\bibAnnoteFile{fisher1925mathematical}

\bibitem[{Fleissig and Whitney(2003)}]{fleissig2003}
Fleissig, Adrian~R and Gerald~A Whitney (2003), \enquote{A new pc-based test for varian's weak separability conditions.} \emph{Journal of Business \& Economic Statistics}, 21(1), 133--144.
\bibAnnoteFile{fleissig2003}

\bibitem[{Forges and Minelli(2009)}]{forges2009afriat}
Forges, Francoise and Enrico Minelli (2009), \enquote{Afriat's theorem for general budget sets.} \emph{Journal of Economic Theory}, 144(1), 135--145.
\bibAnnoteFile{forges2009afriat}

\bibitem[{Goldman and Uzawa(1964{\natexlab{a}})}]{goldmanuzawa64}
Goldman, S. and H.~Uzawa (1964{\natexlab{a}}), \enquote{A note on separability in demand analysis.} \emph{Econometrica}, 32, 387--398.
\bibAnnoteFile{goldmanuzawa64}

\bibitem[{Goldman and Uzawa(1964{\natexlab{b}})}]{goldman1964note}
Goldman, Steven~M and Hirofumi Uzawa (1964{\natexlab{b}}), \enquote{A note on separability in demand analysis.} \emph{Econometrica: Journal of the Econometric Society}, 387--398.
\bibAnnoteFile{goldman1964note}

\bibitem[{Hicks and Allen(1934)}]{hicksallen1934}
Hicks, John~R and Roy~GD Allen (1934), \enquote{A reconsideration of the theory of value. part i.} \emph{Economica}, 1(1), 52--76.
\bibAnnoteFile{hicksallen1934}

\bibitem[{Hildenbrand(1970)}]{hildenbrand1970-1}
Hildenbrand, W. (1970), \enquote{On economies with many agents.} \emph{Journal of Economic Theory}, 2, 161--188.
\bibAnnoteFile{hildenbrand1970-1}

\bibitem[{Hjertstrand et~al.(2020)Hjertstrand, Swofford, and Whitney}]{Hjertstrandmixint2020}
Hjertstrand, Per, James~L. Swofford, and Gerald~A. Whitney (2020), \enquote{{General Revealed Preference Tests of Weak Separability and Utility Maximization with Incomplete Adjustment}.} Working Paper Series 1327, Research Institute of Industrial Economics, \urlprefix\url{https://ideas.repec.org/p/hhs/iuiwop/1327.html}.
\bibAnnoteFile{Hjertstrandmixint2020}

\bibitem[{Hurwicz and Uzawa(1971)}]{hurwicz1971problem}
Hurwicz, L and H~Uzawa (1971), \enquote{On the problem of integrability of demand functions. in. chipman, js, et al.(eds.), preferences, utility and demand.}
\bibAnnoteFile{hurwicz1971problem}

\bibitem[{Kubler et~al.(2020)Kubler, Malhotra, and Polemarchakis}]{kubler2020identification}
Kubler, Felix, Raghav Malhotra, and Herakles Polemarchakis (2020), \enquote{Identification of preferences, demand and equilibrium with finite data.} Technical report, University of Warwick, Department of Economics.
\bibAnnoteFile{kubler2020identification}

\bibitem[{Kubler et~al.(2014)Kubler, Selden, and Wei}]{kubler2014asset}
Kubler, Felix, Larry Selden, and Xiao Wei (2014), \enquote{Asset demand based tests of expected utility maximization.} \emph{American Economic Review}, 104(11), 3459--3480.
\bibAnnoteFile{kubler2014asset}

\bibitem[{Mas-Colell(1977)}]{mascolell77-2}
Mas-Colell, A. (1977), \enquote{On the recoverability of consumers' preferences from demand behavior.} \emph{Econometrica}, 45, 1409--1430.
\bibAnnoteFile{mascolell77-2}

\bibitem[{Moschini et~al.(1994)Moschini, Moro, and Green}]{Moschini1994}
Moschini, Giancarlo, Daniele Moro, and Richard~D Green (1994), \enquote{Maintaining and testing separability in demand systems.} \emph{American Journal of Agricultural Economics}, 76(1), 61--73.
\bibAnnoteFile{Moschini1994}

\bibitem[{Newman(1987)}]{newman1987substitutes}
Newman, Peter (1987), \enquote{Substitutes and complements.} \emph{The New Palgrave: A Dictionary of Economics}, 545--548.
\bibAnnoteFile{newman1987substitutes}

\bibitem[{Nishimura et~al.(2017)Nishimura, Ok, and Quah}]{Nishimuraokquah2017}
Nishimura, Hiroki, Efe~A. Ok, and John K.-H. Quah (2017), \enquote{{A Comprehensive Approach to Revealed Preference Theory}.} \emph{American Economic Review}, 107(4), 1239--1263, \urlprefix\url{https://ideas.repec.org/a/aea/aecrev/v107y2017i4p1239-63.html}.
\bibAnnoteFile{Nishimuraokquah2017}

\bibitem[{Pareto(1909)}]{pareto1909manuel}
Pareto, Vilfredo (1909), \emph{Manuel d'{\'e}conomie politique}, volume~38. Giard \& Bri{\`e}re.
\bibAnnoteFile{pareto1909manuel}

\bibitem[{Polisson et~al.(2020)Polisson, Quah, and Renou}]{polisson2020rp}
Polisson, Matthew, John K.-H. Quah, and Ludovic Renou (2020), \enquote{{Revealed Preferences over Risk and Uncertainty}.} \emph{American Economic Review}, 110(6), 1782--1820, \urlprefix\url{https://ideas.repec.org/a/aea/aecrev/v110y2020i6p1782-1820.html}.
\bibAnnoteFile{polisson2020rp}

\bibitem[{Samuelson(1938)}]{samuelson1938}
Samuelson, P.~A. (1938), \enquote{A note on the pure theory of consumers' behavior.} \emph{Economica}, 5, 61--71.
\bibAnnoteFile{samuelson1938}

\bibitem[{Samuelson(1939)}]{samuelson1939}
Samuelson, P.~A. (1939), \enquote{The gains from international trade.} \emph{Canadian Journal of Economics}, 5, 195--205.
\bibAnnoteFile{samuelson1939}

\bibitem[{Samuelson(1947)}]{samuelson1947}
Samuelson, P.~A. (1947), \emph{Foundations of Economic Analysis}. Harvard University Press.
\bibAnnoteFile{samuelson1947}

\bibitem[{Samuelson(1948)}]{samuelson1948}
Samuelson, P.~A. (1948), \enquote{Consumption theory in terms of revealed preference.} \emph{Economica}, 15, 243--253.
\bibAnnoteFile{samuelson1948}

\bibitem[{Samuelson(1974)}]{samuelson1974complementarity}
Samuelson, Paul~A (1974), \enquote{Complementarity: An essay on the 40th anniversary of the hicks-allen revolution in demand theory.} \emph{Journal of Economic Literature}, 12(4), 1255--1289.
\bibAnnoteFile{samuelson1974complementarity}

\bibitem[{Slutsky(1915)}]{slutsky1915}
Slutsky, E. (1915), \enquote{Sulla teoria del bilancio del consumatore.} \emph{Giornale degli Economisti}, 51, 1--26.
\bibAnnoteFile{slutsky1915}

\bibitem[{Valiant(1984)}]{valiant84}
Valiant, G. (1984), \enquote{A theory of the learnable.} \emph{Communications of the Association for Computing Machinery}, 27, 1134--1142.
\bibAnnoteFile{valiant84}

\bibitem[{Varian(1982)}]{varian82}
Varian, H.~R. (1982), \enquote{The nonparametric approach to demand analysis.} \emph{Econometrica}, 50, 945--973.
\bibAnnoteFile{varian82}

\bibitem[{Varian(1983)}]{Varian1983}
Varian, Hal~R (1983), \enquote{Non-parametric tests of consumer behaviour.} \emph{The review of economic studies}, 50(1), 99--110.
\bibAnnoteFile{Varian1983}

\bibitem[{Weinstein(2022)}]{weinstein2022direct}
Weinstein, Jonathan (2022), \enquote{Direct complementarity.}
\bibAnnoteFile{weinstein2022direct}

\end{thebibliography}