This section contains information that pertains to the so-called "Charypar-Nagel scoring function".
The simplified version assumes that all activities operate near their typical duration. In this case (see here), one can approximate the marginal utility of activity duration (i.e. the marginal utility if the sum of all activities is extended by that amount of time) by beta_perf .
Now let us consider the typical changes (of the Vickrey scenario). Note that in the Vickrey scenario, the meaning of the marginal utility of arriving earlier means the marginal contribution assuming that the travel time remains the same. We will assume that activities are ended by the endtime attribute, not by the duration attribute.
Travel takes longer (by amount deltaTtime)
In this situation, the activity that follows the trip is cut short by deltaTtime. We thus have the following (linearized) modifications of the utility:
Overall: The (linearized) utility change caused by longer travel is
( - beta_perf + beta_travel ) * deltaTtime
Traveller increases arriving early (by amount deltaEtime)
In that situation, the traveller will "do nothing" between the arrival and the opening time of the activity. That is, the amount of time that the traveller is doing nothing is now increased by deltaEtime. Consistent with the meaning of the Vickrey parameter "marginal utility of arriving early", we assume that the travel time is the same compared to the later arrival. This means that the preceeding activity was cut shorter by deltaTtime. We thus have the following (linearized) modifications of the utility:
There are no other contributions, since the time between the arrival and the opening time prodices neither positive nor negative utility contributions. Overall: The (linearized) utility change caused by arriving early is
( - beta_perf ) * deltaEtime
Traveller increases arriving late (by amount deltaLtime)
In this situation, we have the following (linearized) modifications of the utility:
Overall: The (linearized) utility change caused by increasing the amount of arriving late is
beta_late * deltaLtime
Overall, calibration of the Charypar-Nagel scoring function is best done as follows:
Without schedule delay
If you intend to run MATSim without time adaptation (TimeAllocationMutator), these things are not that critical. In that situation, you just need to make sure that - beta_perf + beta_trav matches your marginal utility of travel time differences. An easy way in our view is:
Note that even without time adaptation, beta_late may still have an influence if you have set the latest arrival times for some activities.
"Full version" would imply that we could calibrate the MATSim parameters also for situations where the actual activity durations are far from their "typical" values. This could happen for two reaons:
Both of these interpretations make sense (in my view) and should be investigated for MATSim. Presumably, there is already general research; it would then be necessary to bring that research and the MATSim formulation together.
As explained here, the MATSim scoring function has, under some circumstances (actual durations near "typical" durations"), some similarity to the Vickrey scenario.
The "typical" parameters of the Vickrey scenario are beta_early=-6, beta_travel=-12, and beta_late=-18.
For MATSim, as explained here, this translates into beta_perf=6, beta_travel=-6, and beta_late=-18. These are the parameters that were, for a lack of estimated parameters, introduced into (the precursor of) MATSim approximately in 2006.
These parameters are multiplied with the beta_brain parameter, which can be seen as a separately configurable logit scale parameter. A useful setting for this parameter was determined via systematic tests concerning the stability of the iterations, see here.
As a next step, an infrastructure to compare MATSim simulations with real world traffic counts was set up. Only after that infrastructure was there, an attempt to calibrate the MATSim parameters from a survey was made. This is documented here, unfortunately in German. Two results were
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
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:
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
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.