The nonparametric GARP test is "sharp" in nature. This means that the test will only tell us whether the observed data set is consistent with GARP. However, when the data set fails, it is often useful to know how close the observed behavior is to satisfying the rationality restrictions (see Varian (1990) for an extensive motivation). Over the years, several measures (called goodness-of-fit indices) have been introduced to evaluate the degree to which the observed data set is consistent with the rationality axiom. Echenique et al. (2011) proposed the money pump index (MPI) as a measure of the severity of a GARP violation. The MPI is defined as the amount of money that an arbitrageur can pump from the consumer. The higher is the MPI value, the more severe is the violation of rationality. While the MPI measure is conceptually appealing, it may be computationally challenging to determine this index for data sets with a large number of observations. In particular, Smeulders et al. (2013) showed that computing the mean and median MPI is an NP-hard problem. As easy-to-apply alternatives, they proposed the minimum and maximum MPI which can be computed efficiently (in polynomial time). This function implements the algorithm provided by these authors to measure the minimum and maximum MPI values for the given data set.
A T X N matrix of observed prices where each row corresponds to an observation and each column corresponds to a consumption category. T is the number of observations and N is the number of consumption categories.
A T X N matrix of observed quantities where each row corresponds to an observation and each column corresponds to a consumption category.T is the number of observations and N is the number of consumption categories.
The function returns two elements. The first element (
minimum_MPI) is the minimum MPI and the second
maximum_MPI) is the maximum MPI.
Echenique, Federico, Sangmok Lee, and Matthew Shum. "The money pump as a measure of revealed preference violations." Journal of Political Economy 119, no. 6 (2011): 1201-1223.
Smeulders, Bart, Laurens Cherchye, Frits CR Spieksma, and Bram De Rock. "The money pump as a measure of revealed preference violations: A comment." Journal of Political Economy 121, no. 6 (2013): 1248-1258.
Varian, Hal R. "Goodness-of-fit in optimizing models." Journal of Econometrics 46, no. 1-2 (1990): 125-140.
ccei for the critical cost efficiency index.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# define a price matrix p = matrix(c(4,4,4,1,9,3,2,8,3,1, 8,4,3,1,9,3,2,8,8,4, 1,4,1,8,9,3,1,8,3,2), nrow = 10, ncol = 3, byrow = TRUE) # define a quantity matrix q = matrix(c( 1.81,0.19,10.51,17.28,2.26,4.13,12.33,2.05,2.99,6.06, 5.19,0.62,11.34,10.33,0.63,4.33,8.08,2.61,4.36,1.34, 9.76,1.37,36.35, 1.02,3.21,4.97,6.20,0.32,8.53,10.92), nrow = 10, ncol = 3, byrow = TRUE) # compute the minimum and maximum MPI mpi(p,q)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.