Description Usage Arguments Details Value Author(s) References Examples
The directPrefs
function computes direct revealed preferences, the indirectPrefs
function computes indirect revealed preferences.
1 2  directPrefs(x, p, afriat.par= 1)
indirectPrefs(x, p, afriat.par= 1)

x 
data frame or matrix containing the observed quantities, where each row corresponds to an observation and the columns are types of goods. 
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. 
Direct preferences are directly computed from matrix multiplication of prices and quantities. Indirect preferences are computed using a variant of the FloydWarshall algorithm.
A matrix of direct or indirect revealed preferences:

if bundle 

if bundle 

if bundle 
Julien Boelaert jubo.stats@gmail.com
Varian, H. R. (1984) Microeconomic Analysis. New York/London: Norton, 2nd edition, pp 141143.
1 2 3 4  # Compute direct and indirect preferences of SARPviolating data:
data(noSarp)
directPrefs(noSarp$x, noSarp$p)
indirectPrefs(noSarp$x, noSarp$p)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.