Home Title

June 4 - June 8

Aysun and I finally finished reading Botticelli's code on the supplier-side and customer-side models this week. I refactored the code a little as I went along (why do programmers like to use single-letter variable names and write 300-line methods?), learning some of the very helpful functions in Eclipse.

After that, we started adapting the current models to our prediction agent. As described in a paper I read, for the customer side, Botticelli plots, for each SKU, a graph of offer price vs. probability of winning that offer, by calculating a least-squares regression line for a set of data points. The data points are:

  • the highest order price yesterday for that SKU, plotted at probability 0,
  • the lowest order price yesterday for that SKU, plotted at probability 1, and
  • for each of the past d days, Botticelli's daily average offer price for that SKU, plotted at the ratio of offers won to offers issued.

This is pretty simple, and after Aysun implemented it in the prediction agent, the computer-price predictions were only slightly better than those of the provided sample prediction agent (which simply predicts the price as the average of yesterday's highest and lowest order price for a SKU). In fact, counterintuitively, the best predictions came from seeing what price corresponds to not 100% probability of winning, but rather, as it turned out, 37%! Note, though, that this model attempts to predict the price only for each SKU, whereas we would like an even finer level of granularity and predict the lowest offer price for each RFQ.

After hours of staring at the computer screen and a couple of emails to Victor, I also gained an understanding of how the current supplier-side model works. Botticelli sends "ping" RFQs of quantity 1 to suppliers to estimate the component prices for given due dates, and also uses the supplier offers received today. It stores these values in a 3D array indexed by component, supplier, and due date, and resets them every day so as to use only the most recent information. Finally, when predicting the offer price for a component RFQ, the model:

  1. obtains an estimate of the price by indexing into the array at the RFQ's component, supplier, and the nearest due date for which data is available,
  2. estimates the supplier's available capacity for that component by using the supplier pricing formula (Eq. (10) in the TAC SCM specifications) and the estimated price given by step 1,
  3. adjusts the estimated capacity by adding to it the difference between the quantity offered and the quantity ordered of that component for the same due date, and finally
  4. re-estimates the component price by using Eq. (10) and the adjusted available capacity estimate in step 3.

I implemented this model in the prediction agent, and it performed significantly better than the sample prediction agent, at least for current component prices. I couldn't really think of a better model for future prices and implemented the same one, which doesn't perform as well. This problem applies to the customer side as well, since our existing model is only concerned with current computer prices.

After implementing the basic model, I tried to improve upon it. I didn't really understand step 3 at first, and then realized that it mimics the supplier's calculation of available quantity, but can do so even more accurately, and implemented this. The predictions became slightly better. Instead of using the nearest due date, I tried calculating a linear interpolation of the price by using a least-squares regression line for all the date-price points. This actually performed worse, to my chagrin.

The next step now is to understand that paper Amy gave me (unfortunately, no online versions exist). Amy wasn't here this week, so Aysun and I couldn't consult her, but we asked Micha (a Ph.D. student who leads the machine learning reading group here) for help. He tried to explain some of the equations in the paper, but I only vaguely understood. Looks like I'll have to read a lot of papers and tackle the mathematical magic of linear dynamical systems, the Kalman filter, and the expectation-maximization algorithm.

I must say, though, that I very much enjoy conversing with my teammates between long periods of frantic typing and frying my visual receptors before the glow of the LCD. Joe (an undergraduate from Harvard) commented that he was tracing the nondeterminism in Botticelli down to its source, and I stated my belief that nothing is truly nondeterministic. Inevitably, this led to a discussion of free will and (less deterministically) the expected worse-case running time of randomized quicksort. Another day, we discussed the artificialization of nature, whether civilization is truly evolution's finest product, and skim milk-producing cows.


Previous Top Next