# Forecast with predictable market events

I'm trying to build a predictive model to forecast the residual value of used electronic equipment. As a first step, I created a few quick plots in order to visually identify any interesting features. Here's an example: A couple of things stood out:

1. the prices are 'steppy', i.e. they have a tendency to hug round numbers and drop in chunks.
2. the price drops suddenly when a new product is released.

The product release dates have a somewhat predictable cadence.

At first glance, it seems like this can be broken down into three parts:

1. price erosion before the new product launch
2. the impact of the new product launch
3. price erosion after the new product launch

The pieces could then be stitched together.

Does this seem like a sensible way forecast, taking predictable market events into account? Are there any particular statistical methods/approaches you'd recommend for this sort of problem?

• Are you building these models for the purposes of inference or prediction? – Jessica Collins Aug 8 '14 at 0:38
• Maybe I'm not seeing something obvious, but shouldn't this be "paired" data in order for your plan to work? I mean, how do you know that the price of product X dropped when a newer version of X came out? From the graph it looks like aggregate data for a whole bunch of different products, not paired data of the form (price before release date,price after release date). – rocinante Aug 8 '14 at 1:06
• @Jacob: I'm trying to predict the future value of a product in the secondary market. Ideally, there would be a function call to a model where we specify certain critera today (e.g. manufacturer, MSRP, some future date), and it would return a predicted value and confidence intervals. – Alex Woolford Aug 8 '14 at 1:30
• @AlexWoolford I edited my response to include Stochastic Gradient Boosting. It's a similar model, but tends to perform better on regression tasks. The common implementations of SGB also include confidence interval tooling. – Jessica Collins Aug 8 '14 at 21:59

Since you're interested in prediction, here are my thoughts.

Random Forests are excellent at regression tasks with abrupt discontinuities.

See the figure on page 55 (60 of the PDF) of Decision Forests for Classification, Regression, Density Estimation, Manifold Learning and Semi-Supervised Learning.

Stochastic Gradient Boosting is a similar model worth considering. It's more sensitive to the hyperparameters, but it tends to be a top performer in regression tasks. GBM in R and Scikit-Learn in Python provide implementations of Stochastic Gradient Boosting that can be trained on quantile loss functions, giving you confidence intervals.

Following the advice given in this lecture, if you're forecasting beyond the immediate horizon then it is advisable to use multi-output models. Random Forests can do this well.

The idea behind nonparametric time-series prediction is that you create a function that approximates $$f(x_{i-1}, x_{i-2}, .., x_{i-n}) = x_i$$

The choice of $X$ is dependent on the data at hand. If your data is strictly positive, then consider a log-transform. If your data changes in scale as a function of time, then consider differencing. If there's an obvious cyclical trend to your data, then consider building a simple regression model over the period of the trend.

In any case, the final model for a predictive pipeline is feeding the residuals of these functions onto subsequent functions.

If you have side-information on market events, then it is advisable to include this into your model as an explanatory variable. A simple trick is include the event as a dummy variable. $$k_i = \left\{ \begin{array}{lr} \exp(\alpha(v - i)) & : i \ge v\\ 0 & : i < v \end{array} \right.$$

Where $\alpha$ is a scaling factor and $v$ is the time index of the event that occurred. This looks like the following function. As with all forms of predictive modelling, cross-validation is your friend. In the time-series case, your training, validation and testing set should be sequential.