psrc / urbansim2

3 stars 0 forks source link

households_for_estimation is_inmigrant coded opposite of what it should be #113

Closed stefancoe closed 6 years ago

stefancoe commented 6 years ago

Right now in_migrants are set to 0 in is_inmigrant. Should be set to 1. Peter is confirming that this is a non-issue for ubansim1.

hanase commented 6 years ago

It should be 0 for most households and it should be 1 only for those HHs that do not have a previous location because they moved into the area from outside of the region.

stefancoe commented 6 years ago

Hana- are in_migrants those who have moved within the region or those coming from outside the region? I was told that they are the former.

hanase commented 6 years ago

No it's the opposite - in-migrants are those coming from outside the region.

stefancoe commented 6 years ago

Ok, that makes sense now. Thanks!

hanase commented 6 years ago

You can see it in the hlcm config file (setting the segmentation_col and its values in the models node).

The is_inmigrant attribute can be set on the fly depending on the existence of the previous location.

stefancoe commented 6 years ago

So where it says models: false, that means that it should only use rows where is_inmigrant = False (0)? models: false:

hanase commented 6 years ago

Correct.

stefancoe commented 6 years ago

Thanks!

hanase commented 6 years ago

I realized, is_inmigrant is a variable that gets computed on the fly in the HLCM simulation: https://github.com/psrc/urbansim2/blob/master/psrc_urbansim/vars/variables_households.py#L42

stefancoe commented 6 years ago

I commented that out in variables_households_for_estimation.py because there should be a valid building_id for all households in the estimation data set. I believe that variable would set is_inmigrant to False for all records in the estimation data set.

hanase commented 6 years ago

Yes - that variable was written for the case of a simulation, since newly arriving households in a given year do not have a building_id assigned. For estimation, the variable can be either pre-computed directly on the data, or written so that it is False for all households with a valid previous_building_id.

stefancoe commented 6 years ago

Ok- that makes sense.