Dear Prof. Michel Bierlaire,
I am trying to build a discrete choice model (multinominal logit model) using aggregate sales data per day (each row contains the observed sales, the corresponding day, the SKU, and its characteristics). That is, I have a set of products and their daily demand (I have no information about consumers) and I want to understand consumer choice for this set of products.
In case the data is neither aggregated nor panel data, I think the model would look like this:
#######
ASC = {}
ASC[0] = 0
for i in range(1, number_of_alternatives):
ASC[i] = Beta('ASC' + str(i), 0, None, None, 0)
B_class = Beta('B_class',0,None, None,0)
B_subclass = Beta('B_subclass',0,None, None,0)
B_Brand = Beta('B_Brand',0,None, None,0)
B_Price = Beta('B_Price',0,None, None,0)
# Utilities
V = {}
for i in range(number_of_alternatives):
V[i] = ASC[i] + B_class * CLASS + B_subclass * SUBCLASS + B_Brand * BRAND + B_Price * PRICE
logprob = models.loglogit(V, None, database.variables['Choice'])
biogeme = bio.BIOGEME(database, logprob)
biogeme.modelName = 'MNL'
results = biogeme.estimate()
pandasResults = results.getEstimatedParameters()
#######
However, with panel and aggregate data, how should I adapt the model or the data?
Thank you very much!
Best regards,
Mariana