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.

Zero-bounded triangular and zero-censored normal distributions

Ask questions about model specifications. Ideally include a mathematical explanation of your proposed model.
Post Reply
alvarogutyerrez
Posts: 12
Joined: 19 Jan 2021, 07:53
Contact:

Zero-bounded triangular and zero-censored normal distributions

Post by alvarogutyerrez »

Hello Stephane and David,

I have been trying to estimate a model with a (negative) log-normally distributed cost parameter however, I keep having extremely long tails even at a very large number of draws (10.000). Hence, I have been trying to apply other distributions that might produce more behaviorally reasonable results while keeping its domain below zero. I came across the zero-bounded triangular and zero-censored normal distributions and which are mentioned in the mlogit package and I was wondering how to implement it using Apollo. For example, I know that in order to generate a symmetrical triangular distribution I can use the sum of two uniforms (shown below), but how should I transform the original uniform draws in order to get a zero-bounded triangular distribution? Additionally, which transformation should I apply to (standard) normal draws in order to get a zero-censored normal distribution?

Finally, would you recommend using said distributions for cost coefficients?

Thank you a lot for your time!
Álvaro.

Code: Select all

apollo_draws = list(
  interDrawsType = 'sobol',
  interNDraws = 1000,
  interUnifDraws = c("unif_draws_cost_a","unif_draws_cost_b")
  interNormDraws = c("norm_draws_cost"),
  
)

#create random coefficients
apollo_randCoeff <- function(apollo_beta,apollo_inputs){
  randcoeff = list()
  # Symmetrical triangular distribution
  randcoeff[['cost']] = bound_cost + range_cost * ( unif_draws_cost_a + unif_draws_cost_b ) / 2
  
  return(randcoeff)
}
Álvaro A. Gutiérrez-Vargas
https://alvarogutyerrez.github.io/
stephanehess
Site Admin
Posts: 974
Joined: 24 Apr 2020, 16:29

Re: Zero-bounded triangular and zero-censored normal distributions

Post by stephanehess »

Alvaro

the zero-bounded triangular is easy by just fixing one of the bounds of the uniforms to 0. But be mindful about the existence of inverse moments for that distribution - see Daly, Hess & Train, 2012

The truncated Normal has the same issues with inverse moments

A distribution that has worked well for me is the log-uniform, so an exponential (or negative exponential) of a uniform. It has much shorter tails than the lognormal.

Stephane
--------------------------------
Stephane Hess
www.stephanehess.me.uk
alvarogutyerrez
Posts: 12
Joined: 19 Jan 2021, 07:53
Contact:

Re: Zero-bounded triangular and zero-censored normal distributions

Post by alvarogutyerrez »

Dear Stephane,

Thank you for your answer. I have not thought about the log-exponential. Do you have any article where you have used said distribution?
Best regards,
Álvaro A. Gutiérrez-Vargas
https://alvarogutyerrez.github.io/
stephanehess
Site Admin
Posts: 974
Joined: 24 Apr 2020, 16:29

Re: Zero-bounded triangular and zero-censored normal distributions

Post by stephanehess »

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