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.

Confident Interval of the ratio of two random parameters using Mixlogit

Ask questions about post-estimation functions (e.g. prediction, conditionals, etc) or other processing of results.
Post Reply
alvarogutyerrez
Posts: 12
Joined: 19 Jan 2021, 07:53
Contact:

Confident Interval of the ratio of two random parameters using Mixlogit

Post by alvarogutyerrez »

Hello Stephane and David,

Currently, I am running a mixlogit using Apollo, and I want to compute the confidence interval of the ratio of the random parameters. In particular, I want to calculate the standard error of a normally distributed parameter divided by a log-normally distributed one (in Utility Space). If I am not mistaken, please correct me if I am wrong; the way to go should be the one proposed by Bliemer & Rose (2013) because, as they state in the article:
Although standard errors, and therefore confidence intervals, of the moments of several random distributions can be determined analytically
(see Daly, Hess & de Jong, 2012), there exist no analytical expressions for determining the confidence intervals for WTPs that are defined as ratios of random coefficients. Even in the case of a random coefficient in the numerator and a fixed coefficient in the denominator, determining the confidence interval of WTP requires simulation.
Unfortunately, the case I want wasn't provided by the authors in their original article; regardless, following their notation, it should be like the following:

Image

(A better quality document is available here: https://www.overleaf.com/read/bggymcbqtstx )

That being said, a Monte Carlo simulation is needed to compute the standard error of the ratio of the two variables using draws from z_{c} and z_{k} and then averaging them. I was wondering if this is possible on Apollo at the moment.

Finally, I also checked the `apollo::apollo_deltaMethod()`, but I in the source code I only found the exact Delta method for non-random parameters provided by Daly, Hess & de Jong, 2012:

Code: Select all

  if (operation == "ratio") {
    v = est[parName1]/est[parName2]
    se = sqrt(v^2 * (robvarcov[parName1, parName1]/(est[parName1]^2) + 
                       robvarcov[parName2, parName2]/(est[parName2]^2) - 
                       2 * robvarcov[parName1, parName2]/(est[parName1] * 
                                                            est[parName2])))
    operation_name = paste("Ratio of ", parName1name, 
                           " and ", parName2name, ": ", sep = "")
  }
Thank you for your help!
  • Bliemer, M. C., & Rose, J. M. (2013). Confidence intervals of willingness-to-pay for random coefficient logit models. Transportation Research Part B: Methodological, 58, 199-214.

    Daly, A., Hess, S., de Jong, G., 2012. Calculating errors for measures derived from choice modelling estimates. Transportation Research Part B 46, 333-341.
Álvaro A. Gutiérrez-Vargas
https://alvarogutyerrez.github.io/
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: Confident Interval of the ratio of two random parameters using Mixlogit

Post by stephanehess »

Hi Alvaro

are you talking about confidence intervals for the WTP distribution or confidence intervals for the moments of the WTP distribution. If it's for the moments, then if the moments have an analytical form, then you can also calculate the standard error for them. So for example, if you have two lognormal, the moments are defined.

You can use apollo_unconditionals to get the draws for random coefficients and then compute confidence intervals for those. But those will be confidence intervals that take into account the population distribution rather than confidence intervals that also take into account the standard errors. What you would need to do for that would be to take repeated draws from the asymptotic distribution of the parameters, use those to simulate the wtp distribution, etc

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
Post Reply