Skip to Content
Practical Data Analysis Cookbook
book

Practical Data Analysis Cookbook

by Tomasz Drabas
April 2016
Beginner to intermediate content levelBeginner to intermediate
384 pages
8h 36m
English
Packt Publishing
Content preview from Practical Data Analysis Cookbook

Handling IIA violations with the Nested Logit model

If, however, your models violate the IIA, you need to resort to more advanced models. In this recipe, we will see one of them—a slightly more complicated Nested Logit model. The model groups similar alternatives into nests (hence the name). Given the limited space here, we will not discuss the intricacies of the model, but I highly recommend Kenneth Train's book that I referred to earlier in this chapter.

Getting ready

To execute this recipe, you need a working Python Biogeme package installed on your machine. No other prerequisites are required.

How to do it…

The skeleton of the model code remains the same; here, we will only show the changes (the Nested/dcm_nested.py file):

# add the coefficients ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Data Analysis Cookbook

Python Data Analysis Cookbook

Ivan Idris
Practical Simulations for Machine Learning

Practical Simulations for Machine Learning

Paris Buttfield-Addison, Mars Buttfield-Addison, Tim Nugent, Jon Manning

Publisher Resources

ISBN: 9781783551668Supplemental Content