Important: Read this before posting to this forum

  1. This forum is for questions related to the use of Apollo. We will answer some general choice modelling questions too, where appropriate, and time permitting. We cannot answer questions about how to estimate choice models with other software packages.
  2. There is a very detailed manual for Apollo available at http://www.ApolloChoiceModelling.com/manual.html. This contains detailed descriptions of the various Apollo functions, and numerous examples are available at http://www.ApolloChoiceModelling.com/examples.html. In addition, help files are available for all functions, using e.g. ?apollo_mnl
  3. Before asking a question on the forum, users are kindly requested to follow these steps:
    1. Check that the same issue has not already been addressed in the forum - there is a search tool.
    2. Ensure that the correct syntax has been used. For any function, detailed instructions are available directly in Apollo, e.g. by using ?apollo_mnl for apollo_mnl
    3. Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
    4. Make sure that R is using the latest official release of Apollo.
  4. If the above steps do not resolve the issue, then users should follow these steps when posting a question:
    1. provide full details on the issue, including the entire code and output, including any error messages
    2. posts will not immediately appear on the forum, but will be checked by a moderator first. This may take a day or two at busy times. There is no need to submit the post multiple times.

Positive price coefficient in RPL model estimation

Ask questions about the results reported after estimation. If the output includes errors, please include your model code if possible.
DavidKL
Posts: 21
Joined: 27 Mar 2021, 16:30

Positive price coefficient in RPL model estimation

Post by DavidKL »

Hi!

I would like to ask why I can estimate a positive parameter for the price coefficient for a random parameter logit specification?
For the basic MNL model I estimate a negative coefficient, all results are correct, but for RPL whatever I do, the coefficient is always positive.
I specify the random coefficient according to the sample example on the page: randcoeff[["b_tc"]] = -exp( mu_log_b_tc + sigma_log_b_tc * draws_tc )

I've tried both halton and mlhs casts, but no change.

Thanks in advance for your help!

David
stephanehess
Site Admin
Posts: 1049
Joined: 24 Apr 2020, 16:29

Re: Positive price coefficient in RPL model estimation

Post by stephanehess »

David

you are using

Code: Select all

randcoeff[["b_tc"]] = -exp( mu_log_b_tc + sigma_log_b_tc * draws_tc )
which means that the cost coefficient follows a negative lognormal distribution. A negative lognormal is a negative exponential of a Normal, so the parameters you are estimating are the mean and standard deviations of log(-b_tc). So your cost coefficient is not positive, it's just that the mean of the Normal that's inside the exponential is positive.

This is discussed in many places in the literature. You can then calculate the moments for the lognormal distribution using the appropriate formulae, or you can use the apollo_unconditionals function

Hope this helps

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
DavidKL
Posts: 21
Joined: 27 Mar 2021, 16:30

Re: Positive price coefficient in RPL model estimation

Post by DavidKL »

Hi Stephane!

Thank you very much for your answer, it is now clear and I was able to determine the true average using the unconditional function.

I would like to ask that I can also do the WTP calculations with the unconditional function, e.g. wtp=unconditionals[[["b_attribute"]]/unconditionals[[["b_price"]]

And if so, how can I calculate standard errors alongside the WTPs to perform significance testing? The delta method doesn't work here, if I'm correct?

Thanks again for your help!

David
stephanehess
Site Admin
Posts: 1049
Joined: 24 Apr 2020, 16:29

Re: Positive price coefficient in RPL model estimation

Post by stephanehess »

David

to get standard errors, you would likely need to do sampling from the asymptotic parameter distribution. We've not implemented any code for that.

But with lognormals, you can also calculate the moments for the ratio analytically (a ratio of two lognormals is a lognormal) and then you can use the delta method on those expressions to get standard errors for the mean and sd

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
DavidKL
Posts: 21
Joined: 27 Mar 2021, 16:30

Re: Positive price coefficient in RPL model estimation

Post by DavidKL »

Hi Stephane!

Thank you very much!

Unfortunately, I had to apply a normal distribution to all other attributes except for the price.
In that case, perhaps it is easier to estimate the model in WTP space?

David
stephanehess
Site Admin
Posts: 1049
Joined: 24 Apr 2020, 16:29

Re: Positive price coefficient in RPL model estimation

Post by stephanehess »

you can do, if you really think a Normal makes sense (it normally does not)
--------------------------------
Stephane Hess
www.stephanehess.me.uk
DavidKL
Posts: 21
Joined: 27 Mar 2021, 16:30

Re: Positive price coefficient in RPL model estimation

Post by DavidKL »

Thank you for your reply Stephane!
What do you mean that the normal distribution has no sense? Isn't this only true for attributes such as cost, travel time, etc.?
stephanehess
Site Admin
Posts: 1049
Joined: 24 Apr 2020, 16:29

Re: Positive price coefficient in RPL model estimation

Post by stephanehess »

What are your attributes?
--------------------------------
Stephane Hess
www.stephanehess.me.uk
DavidKL
Posts: 21
Joined: 27 Mar 2021, 16:30

Re: Positive price coefficient in RPL model estimation

Post by DavidKL »

I work with 4 attributes:
1. price (I defined a negative lognormal distribution)
2. brand (I defined a normal distribution)
3. country of origin (I defined a normal distribution)
4. presence of sustainability label (I defined a normal distribution)
stephanehess
Site Admin
Posts: 1049
Joined: 24 Apr 2020, 16:29

Re: Positive price coefficient in RPL model estimation

Post by stephanehess »

Okay, in that case, Normals might be okay. In terms of computing error measures, you can have a look at this paper (DOI: 10.1016/j.trb.2013.09.010) and think about how to set this up in Apollo, but it is not precoded
--------------------------------
Stephane Hess
www.stephanehess.me.uk
Post Reply