Friday, January 5, 2018

Multiple Process/Task Optimization

Over the course of time, I've seen the following problem over and over again:

"""
We would like to complete some outstanding task, project, or service -- whatever that may be -- for a very large group of individuals as efficiently as possible. Each individual has a unique intrinsic ``speed'' with which they move through the system, and a unique sensitivity to the various strategies we employ. For instance, some individuals will complete very quickly under strategy A, but slowly under strategy B. Another group of individuals will move under strategy B but not C, etc. Each strategy has an associated cost -- for example, strategy A requires assigning two resources (expensive) while strategy B requires no assignment of resources (cheap). Every task, project, or service completion has some associated value with it, which can be widely ranging per individual and subject to an external interest/decay rate.
"""

Take, for example, hunting down many, many bad guys who have stolen some amount of money, or golden eggs, or valuable art pieces. If you are a bank, or an investigation force, you would like to hunt down the ``biggest'' bad guys first, moving down the chain, using the tools at your disposal when appropriate. You'd also like to succeed as quickly as possible so that you can financially take advantage of the recuperated funds.

Say you're in a situation where a firm has been applying strategies A,B,C, and D for years, against thousands of reported theft case -- some with success, others with failure. You have access to all the historical data, and notice that some bad guys have intrinsic properties ($\mathbf{x}_n$) that make them impossible to catch, while some bad guys that should be easy were applied the wrong strategy -- B instead of A -- and so never ended up getting caught.

Pretend the firm has a longstanding process -- a sensible one -- where criminals move to either strategy A or B in the first 30 days, then C or D in the next 30 days, depending upon some risk-of-escaping criteria that is hard-coded, such as, ``is the criminal living abroad? Ok, move to the more expensive and thorough strategy B. Do we have contact information on the criminal, or some past history? Ok, move to process C...``, etc.

Your job is to improve this process. How the heck do you get started?

One way to formulate this is through net present value per individual. Let's say we have $\mathbf{x}_n$ as the vector of intrinsic properties for criminal $n$, $D_n$ as the stolen amount outstanding, and $t$ for time since theft. We can write down the survival probability of a burglar under the application of the chosen strategy $c_n = (A, B, C, D)$ as:

\begin{eqnarray}
S(t \vert \mathbf{x}_n, c_n)
\end{eqnarray}

Which is the probability that criminal $n$ will still be at-large/uncaught after time $t$, given that the authorities applied strategy $c_n$ in catching him. Using this metric you could write down the net present value of the whole criminal population:

\begin{eqnarray}
NPV &=& \sum_t \frac{\left(D_n S(t \vert \mathbf{x}_n, c_n) \right)}{(1+i)^t}
\end{eqnarray}

Now the decision variables in this optimization problem is the vector $\mathbf{c}_n$. What strategy do we choose for each individual? $c_n$ could be one of our strategic options A, B, C, D, etc.

Trouble is, we mentioned above that during the historical process, criminals often migrated from $A \to B$ during the ``hunt'', and so we cannot model the problem this way, or even construct survival curves from the data properly. Darn it -- this could have been a simple integer / linear program!

So lets' think again. A more granular way to understand the problem is: what's the yield of strategy $c_n$, at time $t$, for the criminal variables/attributes $x_n$. We also didn't include cost in the above calculation, as each strategy will have some implied cost.

Since the yield is going to be positive definite let's represent it as a $\lambda$ or -- possibly inhomogeneous -- poisson rate:

\begin{eqnarray}
\lambda(t \vert \mathbf{x}_n, c_n)
\end{eqnarray}

and the cost as some non-stochastic rate:

\begin{eqnarray}
b(c_n)
\end{eqnarray}

We could write down a similar expression to before,

\begin{eqnarray}
NPV &=& \sum_t \frac{\left(D_n \lambda(t \vert \mathbf{x}_n, c_n)
-b(c_n) \right) S(t \vert x_n)}{(1+i)^t}
\end{eqnarray}

Notice two things I've done in the above:

  • Multiplied the yield $\lambda$ by the total outstanding amount, so that $\lambda$ is unitless and therefore represents the expected percentage of $D_n$ to be recaptured at time $t$
  • Multiplied the entire top expression by the survival probability for time period $t$, regardless of strategy.

This will give a gross approximation of how long one expect the ``case'' to last. Perhaps we'll catch some of the burglar's cash in the first few days, and the rest later, perhaps some burglar's take a very, very long time to catch.

This formula now encapsulates some good pieces. And our decision variables are still $c_n$. How to best estimate $\lambda(t)$ and $S(t)$? And how best to use those estimates to effect change?