Page 1 of 1

MDCEV with price attribute

Posted: 24 May 2024, 14:50
by Julián
Dear Professors,

I am trying to estimate MDCEV model with my SP data for mode choice. In my dataset, each choice has a price attribute. The price attribute varies along individual, among individuals and alternatives

By checking the sample data and code provided in Apollo website for the MDCEV, the example of "time use data" does not include prices. And, in the definition of setting for the MDCEV without outside good, the COST for individual alternatives is equal to 1.

Following the explanation provided by the Apollo manual regarding the COST, I think I have a "vector of
length equal to the number of observations in the data". However, I do not know the code or the changes I must make in the "time use data" code to include the price attribute.

Thank you very much in advance.

Re: MDCEV with price attribute

Posted: 29 May 2024, 14:43
by stephanehess
Hi

I assume that for each alternative, you have a colum in the dataset with the price attribute for that alternative.

Let's assume your alternatives are called alt1, alt2, ..., and the costs are in columns called cost_alt1, cost_alt2, ...
Then you could specify it like this:

Code: Select all

cost = list(alt1      = cost_alt1, 
                         alt2      = cost_alt2, 
                         ...
Hope this helps

Stephane

Re: MDCEV with price attribute

Posted: 29 May 2024, 18:59
by Julián
Hi Stephane,

Thank you for your response.

I did what you recommended and I got this message:

Error en apollo_validate(mdcev_settings, modelType, functionality, apollo_inputs):
INPUT ISSUE - Expenditure for some observations for model component "model" is either less or more than budget!

We have a mode choice with two alternatives. The continuous decision is the percentage of each alternative used by the decision-makers in each scenario, so the budget is 100.

I do not know where the mistake is. How can I solve this issue?

Thank you very much in advance.

Re: MDCEV with price attribute

Posted: 04 Jun 2024, 09:32
by stephanehess
Hi

You say below that the price attribute varies across individuals and alternatives, but your budget is looking at a % allocation. So those two things are not really consistent with each other. You might want to look at a FMNL model instead of MDCEV. You can then include price in the utility function

Stephane

Re: MDCEV with price attribute

Posted: 09 Jun 2024, 22:37
by Julián
Hi Stephane,
Thank you for your reply. After that, I realised that the definition of the budget was not correct. So, I changed it (price x quantity) and, then it worked.

However, it does not reach convergence with the "bgw" estimation method. For comparison purpose, I run the MDCEV for the example "leisure time" and I got same result: no convergence reached. The model diagnosis is "relative function convergence" in both cases.

How can I solve this?
Thanks!

Re: MDCEV with price attribute

Posted: 07 Sep 2024, 17:12
by stephanehess
Hi

sorry, I had missed this post. Relative function convergence is normal convergence with BGW

Stephane