Comments (1)
An improved capture of the issue from Binny Paul:
PopulationSim is designed to work with Logical or Boolean expressions (equality, inequality, and range) to specify marginal controls. Some examples of Boolean expressions are:
- household.income <= 25000
- person.age < 18
The user requesting the enhancement would like to specify a non-Boolean expression for a use-case described below. Currently, specification of a non-Boolean expression triggers the following assertion error:
assert (max_incidence_value[control_is_hh_based] <= 1).all()
The assertion check was placed by the developers as a sanity check on user’s expressions. The user is requesting to remove this check to allow specification of non-Boolean expressions.
Use-Case:
To control for average household income in the absence of a marginal income distribution.
If only target average income is available, the marginal control can be specified as total income for the zone computed as:
SumIncome = Total_households * target_average_income
The controls specification will look as follows:
controls.csv
target,geography,seed_table,importance,control_field,expression
SumIncome,MAZ,households,1000,SumIncome,households.income
control_totals_MAZ.csv
MAZ,SumIncome
1,5000000
The expression for this use case is – “household.income”, which is not a Boolean expression.
Potential implementation issue:
This change can possibly introduce large numbers in the incidence table. Currently, with Boolean expressions, the incidence table consists of only small integers. Mixing of large and small integers can throw off the list balancing and integerization (linaer programming) optimization. Further testing will be needed to evaluate the impact of this change.
Work-around with existing features:
In the absence of this feature, the users can test this workaround. The steps are as follows:
- Use the target average income to scale the household income in the seed population and save in temporary fields.
Scaling factor = (target_average_income * total_households)/sum(hh_incomes)
-
Use the temporary scaled income to generate income distribution using some thresholds (e.g., $25K, $50K, $100K, $150K+). For a closer match with the target average, use more thresholds.
-
Use the distribution generated from the scaled income fields as a regular household income control on the original income field.
from populationsim.
Related Issues (20)
- repop-pop-pop feature - pipeline file is not updated HOT 2
- Convert distribution system to conda-forge HOT 2
- add to documentation based on Zephyr review
- Different outputs when using MultiProcessing HOT 9
- Installation process issues HOT 3
- example_calm_repop not running HOT 8
- Repop mode not populating the second level geography (example_calm_repop)
- Running Error: ValueError("Lengths must match to compare")
- Running Error: Lengths must match to compare on "integerize_final_seed_weights'" HOT 9
- Adjust a third party synthetic population HOT 8
- WGTP and PWGTP Calculations HOT 6
- NumPy deprecation HOT 1
- ValueError: Buffer dtype mismatch, expected 'const int64_t' but got 'int' in setup_data_structures.py HOT 1
- ValueError exception running sub_balancing.geography=TRACT model: Length of values (2) does not match length of index (37) HOT 8
- Repop Error HOT 1
- Multiprocessing Start_time Error
- Randomness of PopulationSim outputs related to API calls HOT 2
- Installation outdated and not functional HOT 2
- example_calm NOT Running due to issues with activitysim
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from populationsim.