Re: Biogeme support

103 views
Skip to first unread message

Bierlaire Michel

unread,
Aug 12, 2022, 11:13:00 AMAug 12
to Asindu, Marsy (ILRI), Bierlaire Michel, Biogeme
Please send your questions to the users’ group:  bio...@googlegroups.com

There is no error. Just general information < General > and a warning < Warning >

On 12 Aug 2022, at 16:57, Asindu, Marsy (ILRI) <M.As...@cgiar.org> wrote:

Dear Prof Michel,
I am Marsy Asindu, from Kiel University. I am trying to run a hybrid choice model [B.7] on the biogeme website. However I get the following errors after setting up all my codes.
 
[16:18:23] < General >   Remove 1 unused variables from the database as only 70 are used.
[16:18:24] < General >   *** Initial values of the parameters are obtained from the file __Aug10_2022.iter
[16:18:24] < Warning >   Cannot read file __Aug10_2022.iter. Statement is ignored.
 
My data set has 70 variables which I have carefully inspected and utilized in the model, but it keeps indicating that I have 71 variables with one unused. I checked through and realized that the programme generates its own variable labelled biogroups which only appears in the data frame but is nonexistent in my main excel dataset. I have tried to eliminate it using the command
 
DeleteList=['_biogroups']
df = df.drop(DeleteList, axis=1)
print(df)
 
But the variable is still persistent. Kindly advise on how such a constraint can be handled when working for biogeme.
Many thanks in advance for your kind support and looking forward to your response.
Best regards, 

ASINDU MARSY

unread,
Aug 19, 2022, 3:34:05 AMAug 19
to Biogeme
Dear Prof. Bierlaire
Many thanks for the feedback, i had to leave the model run but at some point the kernels died so i could not get estimates. I suspect the trouble could possibly be with the specification of my class membership specification. I am running a latent class model with two classes and using three socio-economic variables (age, income and distance). In one of the examples you provide in biogeme file labelled 16panelDiscreteSocioEco.py you offer an example of introducing social economic variables in a latent class model with 2 classes, the example provided involves only one socio-economic variable (Income) as shown in the class membership model below;

W = CLASS_CTE + CLASS_INC * INCOME

PROB_class0 = models.logit({0: W, 1: 0}, None, 0)

PROB_class1 = models.logit({0: W, 1: 0}, None, 1)

In my situation with three socio-ecomic variables (income, distance and age), I am kindly inquiring which of the following specifications (A or B) below would be the most appropriate for the class membership model. And incase both are incorrect, how best can one specify the membership class when dealing with two or more socio-economic variables.

Approach A        

C = CLASS_CTE + CLASS_INC * income

PROB_class0 = models.logit({0: C, 1: 0}, None, 0)

PROB_class1 = models.logit({0: C, 1: 0}, None, 1)

 

D = CLASS_CTE + CLASS_INC * distance

PROB_class0 = models.logit({0: D, 1: 0}, None, 0)

PROB_class1 = models.logit({0: D, 1: 0}, None, 1)

 

E = CLASS_CTE + CLASS_INC * age

PROB_class0 = models.logit({0: E, 1: 0}, None, 0)

PROB_class1 = models.logit({0: E, 1: 0}, None, 1)

 

 Approach B        

W = CLASS_CTE + CLASS_INC * income * distance * age

PROB_class0 = models.logit({0: W, 1: 0}, None, 0)

PROB_class1 = models.logit({0: W, 1: 0}, None, 1)

 Many thanks in advance for your kind consideration.

Regards,

Bierlaire Michel

unread,
Aug 19, 2022, 3:41:26 AMAug 19
to asim...@gmail.com, Bierlaire Michel, Biogeme

W = CLASS_CTE + CLASS_INC * income + CLASS_DIST * distance + CLASS_AGE * age 

PROB_class0 = models.logit({0: W, 1: 0}, None, 0)

PROB_class1 = models.logit({0: W, 1: 0}, None, 1)

-- 
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/0627582f-6a99-4e53-96d9-3a6ebf09efb3n%40googlegroups.com.

ASINDU MARSY

unread,
Aug 19, 2022, 4:21:15 AMAug 19
to Biogeme
Thank you Prof. I adjusted this yesterday evening and model was able to converge. Below is how i recoded it but will still re code using the approach you have provided.

W = CLASS_CTE + CLASS_GEN * gender
W = CLASS_CTE + CLASS_AGE * age_resp
W = CLASS_CTE + CLASS_CATTLE * cattle_vac
W = CLASS_CTE + CLASS_HERD * move_herd
W = CLASS_CTE + CLASS_HHSIZE * hh_size
W = CLASS_CTE + CLASS_TARMAC * tarmac_access
W = CLASS_CTE + CLASS_VETSHOP * vet_shop_access
W = CLASS_CTE + CLASS_PDN * pdn_sys
PROB_class0 = models.logit({0: W, 1: 0}, None, 0)
PROB_class1 = models.logit({0: W, 1: 0}, None, 1) 

ASINDU MARSY

unread,
Aug 25, 2022, 8:45:42 AMAug 25
to Biogeme
Dear Prof Michel,
I  very much appreciate the constant support you have offered me while I try to fit my hybrid choice model. I have finally succeeded in having a complete model specification run using the model codes with parameter estimates attached. My huge concern now is whether this specification was correctly done because the beta signs for all the indicators(VRPs AND VPCs) I used in the model are positive. I followed the examples '05latentChoiceFull.py' and 06serialCorrelation.py for my specification unfortunately it only utilizes one set of indicators reflecting car loving attitudes. My current specification has two sets of indicators VRP1 - VRP6 representing risk perceptions and VPC1- VPC6 representing conditional perceptions. Could there have been a need to create a second latent variable given that I have two sets of indicators?? was having only one sigma in the model justified given that I am dealing with two sets of indicators and lastly what could be the best way to interpret the results especially those for the  indicators?
Many thanks in advance for your continued support. 

On Friday, August 12, 2022 at 5:13:00 PM UTC+2 michel.b...@epfl.ch wrote:
Parameter estimates.txt
Model code.txt
Reply all
Reply to author
Forward
0 new messages