Description Usage Arguments Details Value Author(s) References See Also Examples
Function for generating random data (prices and quantities) consistent with a given direct preferences matrix.
1 2 3 
pref.mat 
the desired matrix of direct preferences (must be a square matrix, see details), 
ngoods 
the number of goods in the dataset (number of columns in the quantities and prices matrices), 
afriat.par 
the Afriat parameter, a 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, 
qmin 
minimum quantities for each good, 
qmax 
maximum quantities for each good, 
pmin 
minimum prices for each good, 
pmax 
maximum prices for each good, 
maxit 
maximum number of iterations of the optimization algorithm (default to 100), 
verbose 
logical value: if 
The input pref.mat
must be a square matrix, with number of rows equal to the number of desired observations. All entries must be either 0, 1, or 2. The interpretation of the matrix is the same as in function directPrefs
:
pref.mat[i, j] = 0
if bundle i
is not revealed prefered to bundle j
pref.mat[i, j] = 1
if bundle i
is revealed prefered to bundle j
pref.mat[i, j] = 2
if bundle i
is strictly revealed prefered to bundle j
.
All diagonal entries of pref.mat
must be 1 (each bundle is revealed prefered to itself), except when afriat.par
is strictly less than 1.
The simulated data (quantities and prices) are obtained by particle swarm optimization (of package pso
). Fitness must reach 0 for the data to be consistent with the preference matrix. If optimization fails, a warning is issued.

numeric matrix of generated quantities, or 

numeric matrix of generated prices, or 
Julien Boelaert jubo.stats@gmail.com
Varian, H. R. (1982) The Nonparametric Approach to Demand Analysis, Econometrica, 50(4):945973.
Varian, H. R. (1984) Microeconomic Analysis. New York/London: Norton, 2nd edition, pp 141143.
See directPrefs for computation of preferences.
1 2 3 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.