Git Product home page Git Product logo

Comments (7)

bshiller avatar bshiller commented on August 10, 2024

adding discrete types would be helpful, thus allowing for a bimodal distribution. Thanks for all the work you have put into this.

from pyblp.

jeffgortmaker avatar jeffgortmaker commented on August 10, 2024

Thanks. This seems like a popular request. It's high up on my to-do list -- I'll update this thread when I get around to it.

from pyblp.

AvyG avatar AvyG commented on August 10, 2024

Do you have any updates on this? I'm interested in testing a simulation with a two-point distribution for the taste distribution, but I'm unsure how to modify the code accordingly. Any guidance or updates would be much appreciated.

from pyblp.

jeffgortmaker avatar jeffgortmaker commented on August 10, 2024

No updates yet. The challenge is that implementing this in a flexible way would require a lot of additions. For example:

  1. A new parameter vector, say tau, with visual output.
  2. Replace weights in agent_data with some function of tau and demographics. Here, demographic dummies could encode different observed or unobserved types.
  3. Handle the standard issue that unobserved types are often exchangeable, so you want to impose some ordering on tau or the weights that it generates. Otherwise you get multiple (observationally equivalent) global optima. Maybe this is ok.
  4. Gradients with respect to tau.
  5. Make sure optimal IVs work.
  6. Would importance sampling still make sense?
  7. Delta method to get some type of interpretable weights estimates?
  8. Add simulations to the unit tests with discrete types to be sure everything else works.

I'm not sure if the above is the best way of doing this, but it's one thought.

If you're interested in implementing something like this, the place to start is parameters.py, where abstract parameter classes are defined. A new tau parameter would act a lot like pi and rho, so following where these names show up in the code will point to what else would need to be modified.

from pyblp.

chrisconlon avatar chrisconlon commented on August 10, 2024

As Jeff describes, the general case (unknown types, unknown weights) finite mixture is pretty hard to implement.

For a specific case with two types, you could imagine a demographic variable called is "business_travelers" that is {0,1}.

If you happened to know the fraction of that type estimation would be straightforward with the existing PyBLP implementation.

If you had any micro moments that were useful in pinning down either the fraction of types or the coefficients corresponding to each type that would certainly make life easier.

from pyblp.

AvyG avatar AvyG commented on August 10, 2024

Thank you for your answers.

Indeed, I was looking to estimate the case when the consumer can be only of two types (A and B). At the beginning, I will not use demographic data, and I will simulate the market data, so I am free to define the consumer's distribution (I think).

I have a question relating to the introduced parameter, tau. I thought that tau would represent the fraction of the two-point distribution, like sigma represents the variability of consumers' tastes. But you mention that tau would act as pi and rho, so I am no longer sure about that.

Thank you again for your time.

from pyblp.

jeffgortmaker avatar jeffgortmaker commented on August 10, 2024

Right, I mentioned that tau will act a lot like pi and rho, in the sense that it's a nonlinear parameter (like pi, and sigma too), and doesn't just show up in utility (like rho).

It won't act the same as them -- that's just a pointer for where to look in the code to see what you'd have to modify to add something like tau.

from pyblp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.