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.

Mean and variance of the log-normal WTP considering the complex heterogeneity structure of the coefficient, ex. ch. 6.1

Ask questions about post-estimation functions (e.g. prediction, conditionals, etc) or other processing of results.
Post Reply
Andy
Posts: 9
Joined: 26 Aug 2020, 12:59

Mean and variance of the log-normal WTP considering the complex heterogeneity structure of the coefficient, ex. ch. 6.1

Post by Andy »

Dear Stephane Hess,
Dear David Palma,

I want to ask a question to your example incorporating random heterogeneity on p. 68 of the manual.

I was wondering how to calculate the mean and the standard deviation of the log-normal WTP for travel time and headway.

I guess for headway one can use the usual formulas (mean = exp(my+sigma^2/2), variance=exp(2*my+sigma^2)*(exp(sigma^2)-1)) but sigma in this case is sqrt((sigma_log(beta_VHV))^2+(sigma_log(beta_VHV,beta_VTT))^2) as both random variables e_hw,n and e_tt,n are standard normal distributed.

But I am struggling with the mean and variance of the log-normal VTT because of two reasons.
  • A standard normal distribution and a chi-square distribution (squared standard normal) are added, and therefore, so I guess I cannot use the same procedure as for the headway WTP.
  • The random term e_tt_nt for intra-individual heterogeneity varies across the observations of a person. I am wondering if it is relevant for calculating the mean and standard deviation of the log-normal WTP at all.
Is there an option to obtain the mean and variance of the VTT (the log-normal coefficient) using the Apollo package considering this complex heterogeneity structure?

I have seen the code snippet in the answer of David Palma viewtopic.php?f=13&t=104&p=266&hilit=lognormal#p266 . But I guess this function uses the usual formulas I mentioned above because my and sigma are the only inputs.

I appreciate any help.

Kind regards
Andy Obermeyer
stephanehess
Site Admin
Posts: 998
Joined: 24 Apr 2020, 16:29

Re: Mean and variance of the log-normal WTP considering the complex heterogeneity structure of the coefficient, ex. ch.

Post by stephanehess »

Hi Andy

the easiest thing to do here is to use the function apollo_unconditionals which returns the actual draws from the distribution for the parameter and then you can calculate means and standard deviations empirically from that. With a finite number of draws, these will differ slightly from the theoretical means and standard deviations (i.e. calculated analytically on the basis of the parameters of the distribution) but will be the ones actually used during the estimation

Best wishes

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
Andy
Posts: 9
Joined: 26 Aug 2020, 12:59

Re: Mean and variance of the log-normal WTP considering the complex heterogeneity structure of the coefficient, ex. ch.

Post by Andy »

Dear Stephane,

great that Apollo provides these results. Thank you very much.

Best regards
Andy
Post Reply