Page 1 of 1

Error in HB model with JSB variables

Posted: 26 Mar 2021, 18:29
by tomas.rossetti
Hi Stephane and David,

I'm trying to estimate a model where HB == TRUE and one of the parameters distributes JSB between 0 and 1. Unfortunately, an error message keeps popping up.

Here's a part of a reproducible example using apollo_modeChoiceData:

Code: Select all

[database, etc.]

apollo_beta=c(asc_car      = 0,
              asc_bus      = 0,
              asc_air      = 0,
              asc_rail     = 0.1,
              b_tt         = 0,
              b_cost       = 0,
              b_access     = 0)

distributions=c(asc_car      = 'F',
                asc_bus      = 'N',
                asc_air      = 'N',
                asc_rail     = 'JSB',
                b_tt         = 'N',
                b_cost       = 'N',
                b_access     = 'N')

maxcoef = c(NA, NA, NA, 1.0, NA, NA, NA)
mincoef = c(NA, NA, NA, 0.0, NA, NA, NA)

apollo_HB = list(
  hbDist          = distributions,
  gNCREP          = 50000,
  gNEREP          = 50000,
  gINFOSKIP       = 300,
  gMAXCOEF        = maxcoef,
  gMINCOEF        = mincoef)

[apollo_fixed, apollo_inputs, apollo_probabilities, etc.]
When I try to run this, the error I get is:

Code: Select all

 Error in apollo_validate(mnl_settings, modelType, functionality, apollo_inputs) : 
  Some utilities for model component "model" contain values that are not finite numbers! 
This error does not pop up when asc_rail = 'N'. I already tried changing the starting value of the JSB parameter, as well as the gMAXCOEF and gMINCOEF values to 0, -1, and others with no luck.

Thanks for your help!

Re: Error in HB model with JSB variables

Posted: 30 Mar 2021, 07:46
by stephanehess
Hi Tomas

this was a bug, thanks for spotting it. I have fixed it in version 0.2.5 which you can download from the website - it won't be on CRAN for a few weeks still.

Also note though that your dimensions for maxcoef and mincoef were incorrect as this should not include the fixed parameters

Stephane

Re: Error in HB model with JSB variables

Posted: 30 Mar 2021, 13:07
by tomas.rossetti
Thank you Stephane!