On 8 Oct 2018, at 02:54, Wenjian Jia <wj...@virginia.edu> wrote:Dear Prof. Bierlaire,I am a PhD student at the University of Virginia. Currently I am learning discrete choice models for my research on household vehicle choice behavior. I am new to logit models and Biogeme, I was wondering if you can help me for several questions.First, I sent email to bio...@googlegroups.com, hoping to post my questions on biogeme google groups. But it says this email address does not exist. Could you please suggest a way to be added to this group?
Second, I downloaded the Windows executable installer and ran several logit models using the Swissmetro dataset. They worked well. However, when I revised the "01logit.py" file for my own dataset, I got the following errors:Warning: [19:44:36]bioMain.cc:108 pythonbiogeme mnl.py vehiclechoice.dat[19:44:36]bioParameters.cc:399 Parameter documentation generated: pythonparam.html[19:44:36]bioModelParser.cc:109 mnl.py existsWarning: [19:44:36]bioModelParser.cc:142 Error: Failed to load mnlWarning: [19:44:36]bioMain.cc:169 Error: Failed to load mnl
Basically, I only changed the parameters to be estimated and utility functions in your "01logit.py" example (I have four alternatives). I also converted my .csv file to tab separated .dat file. I was stuck here for two days and could not figure out where is going wrong. It would be great if you could give me some suggestion. (Attached is my .py file)Lastly, I believe you have mentioned that Windows executable installer is not very convenient to debug since it does not point out the error line in Python script. So I also tried installing from sources. I followed each step from the website, and got errors at the "compile to code" step: make -j 8 install. So I could not find the files such as biogeme, pybiogeme, biosim etc. in /usr/local/bin.
<mnl.py>make install-exec-hookmake[3]: Entering directory '/home/Wenjian Jia/tools/prepareData'make[3]: Nothing to be done for 'install-exec-hook'.make[3]: Leaving directory '/home/Wenjian Jia/tools/prepareData'make[2]: Leaving directory '/home/Wenjian Jia/tools/prepareData'make[1]: Leaving directory '/home/Wenjian Jia/tools/prepareData'Making install in biogememake[1]: Entering directory '/home/Wenjian Jia/biogeme'make[1]: *** No rule to make target '/home/Wenjian', needed by 'biogeme.exe'. Stop.make[1]: Leaving directory '/home/Wenjian Jia/biogeme'make: *** [Makefile:450: install-recursive] Error 1Best,Wenjian--Wenjian Jia, PhD studentDepartment of Civil and Environmental EngineeringUniversity of Virginia
*** No rule to make target '/home/Wenjian’,
On 9 Oct 2018, at 01:53, Wenjian Jia <wj...@virginia.edu> wrote:Hi Prof. Bierlaire,Thanks so much for your quick response!!When I installed from sources, the ./configure got the outputs:<image.png>I believe it is the same as the outputs on the website. But I got stuck at the last step: make -j 8 install. I am confused as I have tried many times but it always report the same error. Thank you for your help!Best,Wenjian
On 6 Apr 2019, at 01:14, Wenjian Jia <wj...@virginia.edu> wrote:
Hi Prof. Bierlaire,I have a question about "15panelDiscrete.py" in the Swissmetro example. Here, I would like to include socio-demographics into the class membership model. However, I got the error " The kernel appears to have died. It will restart automatically". Is it not possible to estimate a latent class model (include socio-demographics) for panel dataset?import pandas as pdimport biogeme.database as dbimport biogeme.biogeme as bioimport biogeme.models as modelspandas = pd.read_table("swissmetro.dat")database = db.Database("swissmetro",pandas)database.panel("ID")# The Pandas data structure is available as database.data. Use all the# Pandas functions to invesigate the database#print(database.data.describe())from headers import *# Removing some observations can be done directly using pandas.#remove = (((database.data.PURPOSE != 1) & (database.data.PURPOSE != 3)) | (database.data.CHOICE == 0))#database.data.drop(database.data[remove].index,inplace=True)# Here we use the "biogeme" way for backward compatibilityexclude = (( PURPOSE != 1 ) * ( PURPOSE != 3 ) + ( CHOICE == 0 )) > 0database.remove(exclude)ASC_CAR = Beta('ASC_CAR',0.136,None,None,0)ASC_TRAIN = Beta('ASC_TRAIN',-1,None,None,0)ASC_SM = Beta('ASC_SM',0,None,None,1)B_TIME = Beta('B_TIME',-6.3,None,0,0)B_COST = Beta('B_COST',-3.29,None,0,0)SM_COST = SM_CO * ( GA == 0 )TRAIN_COST = TRAIN_CO * ( GA == 0 )TRAIN_TT_SCALED = DefineVariable('TRAIN_TT_SCALED',\TRAIN_TT / 100.0,database)TRAIN_COST_SCALED = DefineVariable('TRAIN_COST_SCALED',\TRAIN_COST / 100,database)SM_TT_SCALED = DefineVariable('SM_TT_SCALED', SM_TT / 100.0,database)SM_COST_SCALED = DefineVariable('SM_COST_SCALED', SM_COST / 100,database)CAR_TT_SCALED = DefineVariable('CAR_TT_SCALED', CAR_TT / 100,database)CAR_CO_SCALED = DefineVariable('CAR_CO_SCALED', CAR_CO / 100,database)# For latent class 1, whete the time coefficient is zeroV11 = ASC_TRAIN + B_COST * TRAIN_COST_SCALEDV12 = ASC_SM + B_COST * SM_COST_SCALEDV13 = ASC_CAR + B_COST * CAR_CO_SCALEDV1 = {1: V11,2: V12,3: V13}# For latent class 2, whete the time coefficient is estimatedV21 = ASC_TRAIN + B_TIME * TRAIN_TT_SCALED + B_COST * TRAIN_COST_SCALEDV22 = ASC_SM + B_TIME * SM_TT_SCALED + B_COST * SM_COST_SCALEDV23 = ASC_CAR + B_TIME * CAR_TT_SCALED + B_COST * CAR_CO_SCALEDV2 = {1: V21,2: V22,3: V23}# Associate the availability conditions with the alternativesCAR_AV_SP = DefineVariable('CAR_AV_SP',CAR_AV * ( SP != 0 ),database)TRAIN_AV_SP = DefineVariable('TRAIN_AV_SP',TRAIN_AV * ( SP != 0 ),database)av = {1: TRAIN_AV_SP,2: SM_AV,3: CAR_AV_SP}# Class membership modelW_OTHER = Beta('W_OTHER',0.1,None,None,0)BETA_MALE = Beta('BETA_MALE',0.1,None,None,0)probClass2 = exp(W_OTHER + BETA_MALE * MALE) / (1 + exp(W_OTHER + BETA_MALE * MALE))probClass1 = 1 - probClass2# The choice model is a discrete mixture of logit, with availability conditionsprob1 = PanelLikelihoodTrajectory(models.logit(V1,av,CHOICE))prob2 = PanelLikelihoodTrajectory(models.logit(V2,av,CHOICE))probIndiv = probClass1 * prob1 + probClass2 * prob2logprob = log(probIndiv)biogeme = bio.BIOGEME(database,logprob)biogeme.modelName = "15panelDiscrete"results = biogeme.estimate()print("Results=",results)Best,WenjianOn Wed, Oct 10, 2018 at 9:53 PM Wenjian Jia <wj...@virginia.edu> wrote:Thank you prof. Bierlaire! This is exactly the problem. Now I installed it successfully!Best,Wenjian
--
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/93dda482-2a33-4163-84c8-e5bfa001ab2e%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bio...@googlegroups.com.
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/6aa2e63f-bc75-4b4e-bec2-0658a5fa7863%40googlegroups.com.
<swissmetro.dat><test_swissmetro.py>