Interpretation of the logarithmic "utility of performing"

The so-called "Charypar-Nagel scoring function" is used in many MATSim studies.  It is called that way because there is an ancient paper where this scoring function was introduced.

It uses a logarithmic utility of time for activities: U = beta * t_x * ln(x/t_0) .  I sometimes call t_x the "typical duration".

The first derivative of U is beta at the typical duration:

  • dU/dx = beta * t_x / x
  • dU/dx(x=t_x) = beta

Interpretation: marginal utility of duration at "typical duration" is indep of activity type. (*)

The second derivative of U at the typical duration is

  • d^2U/dx^2 = - beta * t_x / x^2
  • d^2U/dx^2(x=t_x) = - beta / t_x

An important consequence of this is that there is no separate free parameter to calibrate the curvature (= 2nd derivative) at the typical duration: beta needs to be the same across all activities, and t_x is given by (*).

A second consequence is that t_0 is largely irrelevant.  It shifts the function up and down, i.e. it determines how much you lose if you drop an activity completely.

 

In the original paper (and in most of MATSim), t_0 is set to t_x * exp(-10h/t_x) .  This has the (intended) consequence that all activities have the same utility contribution at their typical duration:

U = beta * t_x * ln( x / t_x / exp(-10h/t_x) ) = beta * t_x * [ ln( x/t_x ) + 10h/t_x ]

which is, at x=t_x:    = beta * t_x * [ 0 + 10h/t_x ] = beta * 10h .  With our usual beta = 6Eu/h, this results in 60Eu per activity.

The slope at U=0, i.e. at x=t_0, is

(beta * t_x / t_x) * exp( 10h/t_x) = beta * exp( 10h/t_x )

which decreases with increasing t_x.  This means that activities with larger typical duration are easier to drop completely.

In the end, this makes sense: Since the additional score of any activity is the same, the score per time is smallest for activities with long typical durations.  Therefore, it makes sense to drop them first. 

But practically, this is probably not desired behavior, since it would first drop the home activity from a daily plan.

Overall, therefore: In my opinion, the current utility function does not work for activity dropping.

 

An alternative, never tested since activity dropping was never tested with this utl fct, would to to recognize that U'(t_0) = beta * t_x / t_0 , i.e. increasing slope with decreasing t_0.  That is, high priority activities should have t_0 such that t_x/t_0 is large (large slope = hard to drop).  Activities of the same priority should have t_0 such that t_x/t_0 is the same between those activities.  Overall, something like

weight \propto t_x/t_0

or

t_0 \propto t_x/weight

where large weight implies a large importance of the activity.

This was, as said, never tried, since activity dropping was never systematically tried.  It also does not fix the problem, discussed later, that different activities might have different resistance against making them shorter; since this is U'', this is  -beta/t_x with the above utl fct: activities are shortened proportional to their typical duration.

 

To make matters worse, there is currently the convention that negative values of U are set to zero.  This is done since we need useable values for negative durations (since they may happen at the "stitching together" of the last to the first activity of a day), and if we give those a "very negative" score, then the utl at t=0 cannot be even smaller than this.

This has, however, the unfortunate consequence that the "drift direction" of the adaptive algorithm, once an activity duration has gone below t_0, goes to zero duration.

 

Outlook: What would we want for our next generation utl function?  Some wishes from my perspective:

  • Curvature at typical duration can be calibrated
  • Slope at U=0 can be calibrated
  • Utl function extends in meaningful way to negative durations (this would fix the arbitrary handling that we currently employ)

 

In my view, a polynomial of second degree would be worth trying. As usual, there are several ways to set this up.  One way is to expand around the typical duration:

U(t_x + eps) = U(t_x) + eps * U'(t_x) + eps^2 * U''(t_x)/2

or

U(x) = U(t_x) + (x-t_x) * U'(t_x) + (x-t_x)^2 * U''(t_x)/2

with t_x = typical duration, U'(t_x) = beta = marg utl at typ dur, U''(t_x) = curvature at typ dur ("priority"), and U(t_x) = "base value of act" (which could be something like beta*t_x ).

 

Another way (having the parabola going through (0,0)) would be

U(x) = - a x ( x - c ) = - a x^2 + a c x
U'(x) = - 2 a x + a c
prio = U'(x=0) = a c , i.e. c = prio/a .
beta = U'(x=t_x) = - 2 a t_x + prio, i.e. a = (prio - beta)/2t_x

 

There is other work (e.g. by Joh) that should be looked at.