Page 1 of 1

Box-Cox Logit Model

PostPosted: Sat Dec 09, 2023 5:04 am
by Gabriel Souza
Hi experts,

A quick introdution:
I work with transport studies and there's this software we use, PTV Visum, which provides a variety of choice models to distribute travel demand along paths stochastically (route choice). First we setup the utility of the routes (for example, B0 * time + B1 * distance + B2 * toll) and then we setup which choice model should be used to calculate routes probabilities.

We've been using DCE (unlabeled alternatives, route A vs route B) associated with logistic regression to obtain the coefficients that are inserted in Visum for calculating routes utilities. We then use "Logit" as the choice model in Visum. Therefore, the way we estimate the model is consistency with the way we apply it on the software for route choice.

But there's a choice model in the software called "Box-cox" which basically applies a Box-Cox Transformation over the Utility of the route before calculating the probabilities. Please note that we must insert just one theta (Box-Cox parameter) when setting up the process, since the transformation is applied over the utility itself, not over the independent variables one by one (time, distance etc.). The advantage of this choice model is that it can overcome the classical Logit limitation of only considering absolute differences of utilities in choice modelling (5 minutes of difference yields the same result regardless it's a 10-minute or a 3-hour trip).

The problem is:
I don't know how to use the DCE data I have to calibrate a model (coefficients and theta) which would be the same one used by Visum in its choice model (to ensure consistency in this process of obtaining and inserting parameters in the software). I don't know how to define the equation/the utilities of alternatives and perform the regression.

I'm sorry if that's not the place for this question, but I'd really appreciate some help on this topic. Has anyone ever dealt with something similar? Has any idea of where/how (software, package, function etc.) I could setup up this model and perform the right regression?

Thank you!

Re: Box-Cox Logit Model

PostPosted: Sat Dec 09, 2023 9:45 am
by Michiel Bliemer
So if I understand correctly, you would like to estimate a logit model where utility is transformed.

So instead of V you would like to use V*=f(V|theta) in the logit model, where f(.|theta) is the Box-Cox transformation.

You can use Apollo or Biogeme to use maximum likelihood to estimate the parameters of any transformed utility function since you can specify the utility function yourself in the script. Please refer to the manuals of Apollo and Biogeme. It is also not difficult to estimate the parameter estimates in Excel by simply computing the loglikelihood for each choice observation and then using Solver to maximise the total loglikelihood.

Note that the issue of "only considering absolute differences" can also be overcome by using a weibit model (Visum may call this Kirchoff), where utility is transformed using a logarithm. See: https://www.sciencedirect.com/science/article/pii/S0191261508001215

Michiel

Re: Box-Cox Logit Model

PostPosted: Fri Dec 15, 2023 8:50 am
by Gabriel Souza
Hi, Michiel.

First of all, thank you very much for your help. Apollo seems to do exactly what I need. I already installed the package, took a look at the manual and I've been trying to correct specify and calibrate the model.

Right now I'm facing convergence problems. I believe this is due to the fact that the Box-Cox Transformation don't accept/work with negative numbers and perhaps during the convergence process some utilities are returning negative values. Giving more details, since the utilities for route choice are tipically negative (time, cost and distance all should return negative coefficients) I've already built the model as V = - f(V|theta), so that coefficients would take positive values. But there are also categorical variables in the experiment, like road type (twolane vs. multilane), and "multilane" tipically increases the utility (which means, in my "inverted model", that its coefficient is negative). So I believe that, for some few specific choice tasks in my database, some negative utilities may still appear in the middle of the convergence process.

I could see that Apollo also has a very active forum, so I'll be trying to find some help out there, but if you have any suggestion, I'd really like to hear it.

And, about the Weibit Model, yes, Visum calls it Kirchoff! While in Logit what matters are the absolute differences, in Kirchoff what matters are the relative differences. It's a tricky trade-off because absolute differences can perform poorly at long trips while relative differences can perform poorly at short trips.

In Box-Cox Model, when theta = 0, it becomes Kirchoff. When theta = 1, it becomes Logit. So we're searching for some value between 0 and 1. "Box-Cox" caught our attention because, in this way, the model never returns the same probabilities for the same relative difference or the same absolute difference. The trip scale always matter.

Re: Box-Cox Logit Model

PostPosted: Fri Dec 15, 2023 3:25 pm
by Michiel Bliemer
You will be in good hands on the Apollo forum and Stephane may be able to help you there with the convergence issues.

If coefficients need to be positive or negative, could can of course always impose transformations on certain parameters, for example using beta = exp(alpha) if you want the parameter to be positive or beta = -exp(alpha) if you want the parameter to be negative, where you estimate alpha.

Thank you for the discussion on Box-Cox being a mix of logit and weibit, that is interesting.

Michiel