pymc-devs / pymc-devs/pymc-examples

Slight Mis-Interpretation of Discrete Choice Theory

Open
#617 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
398
Forks
325
Avg merge
9d 15m
Merged PRs (30d)
1

Description

Discrete Choice and Random Utility Models:
Notebook url:

Issue description

Firstly thanks for putting this up, its a great effort @NathanielF something that took me ages to figure out and your example will be a great resource for others going forward. I wanted to highlight that In discrete choice models you dont typically set the whole utility to zero for one alternative you just set one of the contants to zero.
Refer to page 21 of Train Book Ch2 for why - its about the identification issue.

I do acknowledge though that it isnt uncommon to do it like you have done as per this example: BAPs multinomial_ppcs that does set everything to zero for one class.

My issue would be that the model is then ignoring the Xs in that alternative. Also, as you articulate well, discrete choice is being nuanced in how the utility is expressed per alternative and saying one must be zero is killing that.

Expected output / Proposed solution

I think the first example (no contants) should just have utility like other alternatives.

then second one where you bring in contants you can either just
u4 = 0 + beta_ic * wide_heating_df["ic.gr"] + beta_oc * wide_heating_df["oc.gr"]
or concatenate a zero onto the alpha if you want to do it as a tensor op like Alex did in the Multinomial PPCs example.

Thanks again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked GLM discrete-choice models notebook and compare its utility definitions with the identification rationale and proposed expressions in this issue. Update the first and second examples as described, then run the notebook to verify that the models and rendered outputs remain consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.