This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:toolcoding:using_a_relative_propensity [2010/11/25 13:11] shona.weldon |
howtos:toolcoding:using_a_relative_propensity [2010/11/25 13:20] shona.weldon |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using relative propensities to create data based on some simple assumptions ====== | ====== Using relative propensities to create data based on some simple assumptions ====== | ||
- | When you have an equation with more unknowns that constraints and you want to add some assumptions to solve it you may add a relative propensity calculation. Best served by an example. | + | When you have an equation with more unknowns that constraints and you want to add some assumptions to solve it you may add a relative propensity calculation. Best served by an example. It can also be thought of as an estimate where only the relative values matter and the level will be determined by scaling it to the know data. |
===== Example ===== | ===== Example ===== | ||
Line 21: | Line 21: | ||
local populationEst[uss,th] = sum (households[uss,usdt,th] * relPopPersPerHH[usdt]; dim=usdt) | local populationEst[uss,th] = sum (households[uss,usdt,th] * relPopPersPerHH[usdt]; dim=usdt) | ||
!Equation B: | !Equation B: | ||
- | peoplePerHousehold[uss,usdt,th] = population[uss,th] / populationEst[uss,th] * relPopPersPerHH[usdt] | + | peoplePerHousehold[uss,usdt,th] = (population[uss,th] / populationEst[uss,th]) * relPopPersPerHH[usdt] |
- | + | ||
- | ===== Check your above equation through symbol substitution algebra ===== | + | |
- | You know your identity : | + | |
- | population[uss,th] = sum (households[uss,usdt,th] * peoplePerHousehold[uss,usdt,th]; dim=usdt) | + | |
- | substituting from your final math Equation B for personPerHousehold: | + | |
- | population[uss,th] = households[uss,usdt,th] * population[uss,th] / populationEst[uss,usdt,th] * relPopPersPerHH[usdt] | + | |
- | reordering: | + | |
- | population[uss,th] = households[uss,usdt,th] * relPopPersPerHH[usdt] * population[uss,th] / peoplePerHouseholdEst[uss,usdt,th] | + | |
- | Then notice the substitution can be done for Equation A from the final math above: | + | |
- | population[uss,th] = peoplePerHouseholdEst[uss,usdt,th] * population[uss,th] / peoplePerHouseholdEst[uss,usdt,th] | + | |
- | And the estimates cancel so you have an identity and you are comfortable your math worked | + | |
- | population[uss,th] = population[uss,th] | + | |