Page 1 of 1

Log-uniform distribution (always positive)

Posted: 09 Jun 2023, 13:08
by DamienJ
In a WTP-space mixed logit model, I want to test a log-uniform distribution for the price attribute '(rationale: always positive and avoid long tail of log-normal);

I have two questions (related code below)

1. Is the specification "exp(b_lambda * draws_lambda)" correct if I want a log-uniform distribution with positive numbers?
2. So far, I have assumed correlation only among non-price attributes. Is is legitimate to test the correlation between lamba and other random parameters when not all variables are normally distributed? If yes, how can I write the lambda draws to estimate a potential correlation between let say wtp_legu and lambda?


Damien

Code: Select all

apollo_draws = list(
  interDrawsType="mlhs",           
  interNDraws= 100,                   
  interUnifDraws=c("draws_lambda"),                
  interNormDraws=c("draws_work" , 
                    "draws_fodd" ,
                    "draws_legu" , 
                    "draws_engr"),    
  
  intraDrawsType="mlhs",
  intraNDraws=0,
  intraUnifDraws=c(),
  intraNormDraws=c()
)

### Create random parameters
apollo_randCoeff = function(apollo_beta, apollo_inputs){
  randcoeff = list()
  randcoeff[["wtp_work"]] = w_work + s_work * draws_work 
  randcoeff[["wtp_fodd"]] = w_fodd +  s_work_fodd * draws_work + s_fodd_fodd * draws_fodd
  randcoeff[["wtp_legu"]] = w_legu +  s_work_legu * draws_work + s_fodd_legu * draws_fodd + s_legu_legu * draws_legu
  randcoeff[["wtp_engr"]] = w_engr +   s_work_engr * draws_work + s_fodd_engr * draws_fodd + s_legu_engr * draws_legu +   s_engr_engr * raws_engr
  randcoeff[["lambda"]] = exp(b_lambda * draws_lambda) #log-uniform distribution
    
   return(randcoeff)
}

Re: Log-uniform distribution (always positive)

Posted: 15 Jun 2023, 13:46
by stephanehess
Hi

you're missing the offset for the uniform, so something more like

Code: Select all

randcoeff[["lambda"]] = exp(a_lambda + b_lambda * draws_lambda)
instead of

Code: Select all

randcoeff[["lambda"]] = exp(b_lambda * draws_lambda)
regarding the correlation, you could add off diagonal terms into the above calculations too, but the problem is that once you do that with the normal draws, your distribution will of course no longer be log-uniform

Stephane

Re: Log-uniform distribution (always positive)

Posted: 16 Jun 2023, 06:23
by DamienJ
Thank you for the clarification about the correlation. For the offset, I assumed that it was equal to zero, but I guess it is better to verify this!

Damien

Re: Log-uniform distribution (always positive)

Posted: 16 Jun 2023, 06:56
by stephanehess
If you make it zero, think about what this implies for where the exponential of the distribution will start from

Re: Log-uniform distribution (always positive)

Posted: 16 Jun 2023, 19:51
by DamienJ
Indeed, I haven't put enough thought on this, as this will make the distribution start at at 1
Thank you.