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.

Simulating WTP for normal dist. param when price is negative log normal/

Ask questions about post-estimation functions (e.g. prediction, conditionals, etc) or other processing of results.
Post Reply
manes
Posts: 19
Joined: 15 Jun 2023, 13:13
Location: Israel
Contact:

Simulating WTP for normal dist. param when price is negative log normal/

Post by manes »

Hi,

I estimated a MMNL which converged successfully. I am trying to simulate WTP for the ASC (ASC_low) which is normally distributed. My cost parameter is negatively log-normal distributed.
this is the code:

Code: Select all

N <- 10000
b_low = rnorm(N, mean=model$estimate["asc_low_mu"], sd=model$estimate["asc_low_sig"])
b_cost = exp(rlnorm(N, mean=model$estimate["b_log_cost_mu "], sd=model$estimate["b_log_cost_sig"] ))
wtp_low = b_low/b_cost
mean(wtp_low); sd(wtp_low)
I received:
[1] NaN
[1] NA
I'm not sure what could be the reason for this.
These are the estimated values:
b_log_cost_mu = 1.186
b_log_cost_sig = -1.579

asc_low_mu = 1.5071
asc_low_sig = 2.7057
Thanks,
Anat
Anat Tchetchik
stephanehess
Site Admin
Posts: 1049
Joined: 24 Apr 2020, 16:29

Re: Simulating WTP for normal dist. param when price is negative log normal/

Post by stephanehess »

Annat

can you show us the model estimates too? It might be that you need to take the absolute values of the sigma parameters as the estimates might have been negative

Also, you're missing the minus sign in front of the exponential

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