Documentation of code for
The Value of Field Experiments


MAIN FILES:

estimating_A.m

Generates A matrices and simulates pricing experiments to estimate A.
Calculates how many experiments are needed to obtain a certain
epsilon-delta accuracy criterion, for various numbers of experiments.
Produces a plot of (# of products) vs (# of experiments needed to
achieve uniform epsilon-accuracy).


estimating_sparsity.m

Generates A matrices and simulates pricing experiments to estimate the
sparsity parameters k and d. Produces a plot of (# of experiments) vs 
(estimate of sparsity parameters).



SUPPORTING FILES:

generate_parameters.m

Generates A matrices from distributions seeded by parameters obtained
from a past field experiment.

INPUT
n: number of products
flag: also generates a sparse version of the A matrix, depending on the
      value of the flag
      0 - does not sparsify
      1 - bounds all elements of A to be no more than b in magnitude
      2 - bounds all elements of A to be no more than b in magnitude
          and sets all but k elements of each row to 0
      3 - bounds the L1 norm of each row of A to be no more than d
bound: sparsity parameters
      0 - unused
      1 - [b]
      2 - [b k]
      3 - [d]

OUTPUT
p: profit-related [unused]
qb: quantity-related [unused]
A: sparse version of matrix
Afull: dense version of matrix
sizes: category size-related [unused]


generate_random_indices.m

Chooses up to k number of indices to set to 1. Always sets index i to 1.
Returns a binary array of length n with k elements equal to 1 and the
rest equal to 0.


sparsify.m

For each row of Afull, keep at most k elements, making the rest equal
to 0.
