warp: Tests consistency with the Weak Axiom of Revealed Preference...

Description Usage Arguments Value Definitions References See Also Examples

View source: R/warp.R

Description

This function allows the user to check whether a given data set is consistent with the Weak Axiom of Revealed Preference at efficiency level e (eWARP) and computes the number of eWARP violations. We say that a data set satisfies WARP at efficiency level e if q_t R^D_e q_s and q_t \neq q_s implies ep_s'q_s < p_s'q_t (see the definition of R^D_e below). The exact WARP, with e = 1, is a necessary and sufficient condition for a data set to be rationalizable by a continuous, strictly increasing, piecewise strictly concave, and skew-symmetric preference function (see Aguiar et al. (2020)). Moreover, Rose (1958) showed that for the case of two goods (N = 2), WARP is equivalent to the Strong Axiom of Revealed Preference (SARP). In other words, when there are only two consumption categories, transitivity has no empirical bite.

Usage

1
warp(p, q, efficiency = 1)

Arguments

p

A T \times 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.

q

A T \times 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.

efficiency

The efficiency level e, is a real number between 0 and 1, which allows for a small margin of error when checking for consistency with the axiom. The default value is 1, which corresponds to the test of consistency with the exact WARP.

Value

The function returns two elements. The first element (passwarp) is a binary indicator telling us whether the data set is consistent with WARP at a given efficiency level e. It takes a value 1 if the data set is eWARP consistent and a value 0 if the data set is eWARP inconsistent. The second element (nviol) reports the number of eWARP violations. If the data set is eWARP consistent, nviol is 0. Note that the maximum number of violations in an eWARP inconsistent data is T(T-1)/2.

Definitions

For a given efficiency level 0 ≤ e ≤ 1, we say that:

References

See Also

sarp for the Strong Axiom of Revealed Preference and garp for the Generalized Axiom of Revealed Preference.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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)

# Test consistency with WARP and compute the number of WARP violations
warp(p,q)

# Test consistency with WARP and compute the number of WARP violations at e = 0.95
warp(p,q, efficiency = 0.95)

revpref documentation built on July 7, 2021, 9:07 a.m.