{ From user Lonnie, Model Tax_bracket_interpol at 4-Apr-2018 3:44:33 PM, encoding="UTF-8" } SoftwareVersion 5.1.0 { System Variables with non-default values: } SampleSize := 1000 TypeChecking := 1 Checking := 1 SaveOptions := 2 SaveValues := 0 NodeInfo FormNode: 1,0,0,1,0,0,0,,0,0,,0,0 AskAttribute TableCellDefault,Variable,Yes Model Tax_bracket_interpol Title: Tax bracket interpolation Description: A model Author: Lonnie Chrisman, Ph.D.~ Lumina Decision System Date: Wed, Apr 4, 2018 8:26 AM SaveAuthor: Lonnie SaveDate: Wed, Apr 4, 2018 3:44 PM DiagState: 2,1,0,1165,619,17 WindState: 2,169,451,720,350 FontStyle: Arial,15 FileInfo: 0,Model Tax_bracket_interpol,2,2,0,0,W:\Training\Blog\Tax bracket interpolation.ana Index Tax_bracket Title: Tax bracket Definition: [10%,15%,25%,28%,33%,35%,39.6%] NodeLocation: 144,144,1 NodeSize: 48,24 NumberFormat: 2,%,4,2,0,0,4,0,$,0,"ABBREV",0,,,0,0,15 Att_PrevIndexValue: [0.1,0.15,0.25,0.28,0.33,0.35,0.396] Decision Filing_status Title: Filing status Description: Filing status of tax filer. Single, Married filing jointly, Married filing separately, or head of household. Definition: Choice(Self,2) NodeLocation: 136,56,1 NodeSize: 48,24 Aliases: FormNode Fo1522881477 Domain: ['Single','Married, joint','Married, separate','Head'] {!40300|DomainExpr: Discrete('Single','Married, joint','Married, separate','Head',type:['text'])} {!40200|Att_ChoiceIndexes: Keyword Self} Variable Bracket_top_income Title: Bracket top income Units: $ Description: For each tax bracket, this is the income level where the next tax bracket starts. Definition: DetermTable(Tax_bracket,Filing_status)(~ 9325,18.65K,9325,13.35K,~ 37.95K,75.9K,37.95K,50.8K,~ 91.9K,153.1K,76.6K,131.2K,~ 191.65K,233.35K,116.675K,212.5K,~ 416.7K,416.7K,208.35K,416.7K,~ 418.4K,470.7K,235.35K,444.5K,~ INF,INF,INF,INF) NodeLocation: 280,56,1 NodeSize: 48,24 DefnState: 2,59,779,519,234,0,DFNM ValueState: 2,740,489,416,303,,MIDM Aliases: Alias Al1522879500 ReformDef: [Sys_LocalIndex('DomainIndex'),Tax_bracket] ReformVal: [Filing_status,Tax_bracket] NumberFormat: 2,I,4,4,1,1,4,0,$,0,"ABBREV",0,,,0,0,15 TableCellDefault: 0 {!40700|Att_CellFormat: CellSpan(Tax_bracket,CellNumberFormat('Integer',thousandsSeparators:1,dateFormat:'ABBREV',fullPrecision:0,numbersAsDates:0,datesAsNumbers:0),7,header:0)} Decision Taxable_income Title: Taxable income Units: $ Definition: 300k NodeLocation: 144,216,1 NodeSize: 48,24 Aliases: FormNode Fo1522881478 NumberFormat: 2,I,4,2,1,1,4,0,$,0,"ABBREV",0,,,0,0,15 Variable Max_tax_in_bracket Title: Max tax in bracket Units: $ Description: This is the amount of tax paid at the given tax rate when your taxable income is greater that the upper limit of this tax bracket. Definition: Uncumulate( Bracket_top_income, Tax_bracket ) * Tax_bracket NodeLocation: 280,136,1 NodeSize: 48,24 ValueState: 2,184,713,921,251,1,MIDM Aliases: Alias Al1522879723 NumberFormat: 2,F,4,2,1,1,4,0,$,0,"ABBREV",0,,,0,0,15 Function Round_income_1040( taxable_income ) Title: Round income for 1040 tax lookup Description: Rounds income for tax table lookup. Although the tax computation for Form 1040 is essentially the tax bracket rate times the income that falls in that tax bracket, the tax tables add one complexity. If your taxable income is less that $3000, you need to "discretize" your income into $25 buckets and use the midpoint of that bucket, or for incomes between 3000 and 100K, you need to discretize the income into the appropriate $50 bucket and use the midpoint of that bucket before multiplying. For incomes above $100K, it simplifies to a straight multiplication with to rounding. This function rounds to the appropriate bucket centroid.~ ~ For example, if your taxable income is $51,342, it falls in the bucket from $51,300 to $51,350. So you need to first round to $51,325 and then multiply by the corresponding tax rate(s). Definition: if Taxable_income<5 then 0~ else if Taxable_income<15 then 10~ else if Taxable_income<25 then 20~ else if taxable_income <3000 then floor(taxable_income /25)*25 + 12.5~ else if taxable_income <100k then floor(taxable_income /50)*50 + 25~ else taxable_income NodeLocation: 136,328,1 NodeSize: 80,24 Variable Rounded_taxable_inco Title: Rounded taxable income Units: $ Description: The taxable income after rounding to the centroid of the IRS tax table bin. Without this rounding, the simple computation differs from the IRS's tax due by a few dollars. For example, when your taxable income is $18,000 married filing jointly, your tax should be 10%. But the actual amount due is $1,803, rather than $1,800. This is because the $18,000 needs to be "rounded" to $18,025, the centroid of the appropriate bin in the Tax Tables, before multiplying by 10%. Definition: Round_income_1040( Taxable_income ) NodeLocation: 424,144,1 NodeSize: 48,32 ValueState: 2,764,48,424,654,,MIDM Aliases: Alias Al1522879484 Variable Bracket_bottom_incom Title: Bracket bottom income Units: $ Definition: Bracket_top_income[@Tax_bracket = @Tax_bracket-1,defval:0] NodeLocation: 424,56,1 NodeSize: 64,24 ValueState: 2,794,324,502,254,,MIDM ReformVal: [Filing_status,Tax_bracket] NumberFormat: 2,F,2,2,1,1,2,0,$,0,"ABBREV",0,,,0,0,15 Variable Subtraction_amount Title: Subtraction amount Units: $ Description: The amount saved by the lower tax rates for the first part of your income, compared to just multiplying your tax bracket by your total income. With this pre-compiled table, it makes it easy to find your tax due once you know your marginal tax rate. Definition: (Bracket_bottom_income * Tax_bracket - Tax_up_to_bracket)[Tax_bracket=Marginal_rate, defVal:0] NodeLocation: 600,224,1 NodeSize: 56,24 ValueState: 2,748,75,621,243,,MIDM ReformVal: [Filing_status,Tax_bracket] NumberFormat: 2,F,2,2,1,1,2,1,$,0,"ABBREV",0,,,0,0,15 {!50000|Att_ColumnWidths: [,Filing_status,\([87])]} Objective tax_due Title: tax due Units: $ Description: The tax due for the year. Definition: Round( Rounded_taxable_inco * Marginal_rate - Subtraction_amount ) NodeLocation: 736,144,1 NodeSize: 48,24 ValueState: 2,112,549,480,214,,MIDM Aliases: FormNode Fo1522881488 ReformVal: [Filing_status,Tax_bracket] NumberFormat: 2,I,2,2,1,1,2,0,$,0,"ABBREV",0,,,0,0,15 {!40700|Att_CellFormat: Undefined} Variable Marginal_rate Title: Marginal rate Description: This is the tax bracket for the given taxable income. The marginal rate is the percentage tax you can expect to pay on the next dollar earned. Definition: StepInterp( Bracket_top_income, Tax_bracket, Rounded_taxable_inco, Tax_bracket ) NodeLocation: 600,56,1 NodeSize: 48,24 ValueState: 2,816,490,416,303,,MIDM NumberFormat: 2,%,4,4,0,0,4,0,$,0,"ABBREV",0,,,0,0,15 Domain: Tax_bracket {!40300|DomainExpr: Tax_bracket} Variable Tax_up_to_bracket Title: Tax up to bracket Units: $ Description: This is the total tax assigned to all tax brackets up to, but not including, a given tax bracket. Definition: Cumulate( Max_tax_in_bracket, Tax_bracket)[@Tax_bracket=@Tax_bracket-1, defVal:0] NodeLocation: 280,224,1 NodeSize: 48,24 ValueState: 2,804,674,539,295,,MIDM ReformVal: [Filing_status,Tax_bracket] Module Alternate_ways_to_co Title: Alternate ways to compute tax due Description: The method of using a Subtraction Amount is not the only method possible for computing tax due. This module shows another methods, using Dispatch. I've included these for instructional purposes. Depreciation schedules often have a similar structure, and sometimes these techniques are a better match. Author: Lonnie Chrisman, Ph.D.~ Lumina Decision Systems Date: Wed, Apr 4, 2018 3:42 PM NodeLocation: 136,480,1 NodeSize: 80,24 NodeInfo: 1,0,1,1,1,1,0,,0,,0,,, DiagState: 2,320,186,944,560,17 WindState: 2,222,587,720,350 Objective Tax_due_using_Dispat Title: Tax due using Dispatch Units: $ Definition: Sum(Dispatch(Rounded_taxable_inco, Max_amt_taxed_in_bra, Tax_bracket) * Tax_bracket, Tax_bracket ) NodeLocation: 480,184,1 NodeSize: 48,32 ValueState: 2,694,815,569,141,,MIDM ReformVal: [Filing_status,Null] NumberFormat: 2,I,2,2,1,1,2,0,$,0,"ABBREV",0,,,0,0,15 Att__TotalsIndex: [Tax_bracket] {!50000|Att_ColumnWidths: [,Tax_bracket,\([84,97,95,113,101,66,66,118])]} Variable Max_amt_taxed_in_bra Title: Max amt taxed in bracket Units: $ Definition: Uncumulate( Bracket_top_income, Tax_bracket ) NodeLocation: 296,184,1 NodeSize: 48,32 NumberFormat: 2,F,4,2,1,1,4,0,$,0,"ABBREV",0,,,0,0,15 Alias Al1522879484 Title: Rounded taxable income Definition: 1 NodeLocation: 288,64,1 NodeSize: 48,32 Original: Rounded_taxable_inco Alias Al1522879500 Title: Bracket top income Definition: 1 NodeLocation: 128,184,1 NodeSize: 48,24 Original: Bracket_top_income Alias Al1522879723 Title: Max tax in bracket Definition: 1 NodeLocation: 128,288,1 NodeSize: 48,24 Original: Max_tax_in_bracket Close Alternate_ways_to_co FormNode Fo1522881477 Title: Filing status Definition: 0 NodeLocation: 428,280,1 NodeSize: 140,16 NodeInfo: 1,,,,,,0,168,,,,,,0 Original: Filing_status FormNode Fo1522881478 Title: Taxable income Definition: 0 NodeLocation: 428,312,1 NodeSize: 140,16 NodeInfo: 1,,,,,,0,96,,,,,,0 Original: Taxable_income FormNode Fo1522881488 Title: tax due Definition: 1 NodeLocation: 428,344,1 NodeSize: 140,16 NodeInfo: 1,,,,,,0,96,,,,,,0 Original: tax_due Close Tax_bracket_interpol