Description Usage Arguments Details Value Author(s) References Examples
Functions for non-parametric tests of compliance with rationality axioms.
Functions checkWarp
, checkSarp
and checkGarp
perform exact tests of the Weak Axiom of Revealed Preferences (WARP), the Strong Axiom of Revealed Preferences (SARP) and the Generalized Axiom of Revealed Preferences (GARP) respectively, to check whether the given data are consistent with utility maximization.
1 2 3 4 5 6 7 |
x |
data frame or matrix containing the observed quantities, where each row corresponds to an observation and the columns are types of goods, or an object of class |
p |
data frame or matrix (of same dimensions as x) containing the corresponding prices, |
afriat.par |
the Afriat parameter, real number in [0,1], which allows a certain level of error in the optimization of choices; default is 1, ie. no optimization error allowed, |
method |
character string: |
object |
an object of class |
... |
additional arguments passed to the |
Rationality axioms can be summarized as follows:
WARP: if X directly prefered to Y and X is not equal to Y, then Y cannot be directly prefered to X (WARP is a necessary condition for the existence of a single-valued utility-maximizing demand function consistent with the data).
SARP: if X (in)directly prefered to Y and X is not equal to Y, then Y cannot be (in)directly prefered to X (SARP is a necessary and sufficient condition for the existence of a single-valued utility-maximizing demand function consistent with the data).
GARP: if X (in)directly prefered to Y, then Y cannot be strictly directly prefered to X (GARP is a necessary and sufficient condition for the existence of a (possibly multiple-valued) utility-maximizing demand function consistent with the data).
If WARP or GARP are violated, then SARP is also violated.
Testing of WARP is straightforward by pairwise comparison of revealed preferences. GARP is tested using the Floyd-Warshall algorithm to find the transitive closure of the direct preference relationship. SARP can be tested either using the Floyd-Warshall algorithm, or using a depth-first search that systematically explores the preference relationship in search of a violating cycle.
Functions checkWarp
, checkSarp
and checkGarp
return an object of class axiomTest
which may contain the following elements:
|
logical value, |
|
last path taken during depth-first search, |
|
(for |
|
vector of indices of axiom-violating observations (only the first violators that were found are reported, this is not a complete list), |
|
vector of logical values indicating whether the preferences between reported violators (or path) are strict or not, |
|
logical value, |
|
the violated or non-violated rationality axiom, |
|
method used for the non-parametric test, |
|
Afriat parameter used in the algorithm. |
Julien Boelaert jubo.stats@gmail.com
Varian, H. R. (1982) The Nonparametric Approach to Demand Analysis, Econometrica, 50(4):945-973.
Varian, H. R. (1984) Microeconomic Analysis. New York/London: Norton, 2nd edition, pp 141-143.
1 2 3 4 5 6 7 |
GARP rationality test: violation found.
Method: Depth-first search with tabu list.
Afriat parameter: 1 (no optimization error allowed)
Violating observations: 1 > 2 > 3 > 1
: (direct preferences)
Other axioms:
* WARP : unknown (equality of quantities not tested).
* SARP : violated (symmetry of indirect preferences, unequal quantities).
SARP rationality test: no violation.
Method: Depth-first search with tabu list.
Afriat parameter:
Other axioms:
* WARP : not violated.
* GARP : unknown (strict preferences not computed).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.