Loading [MathJax]/extensions/tex2jax.js
MRFFL: MR Fortran Finance Library 2024-12-28
Computational Tools For Finance
All Namespaces Files Functions Variables
mrffl_us_taxes Module Reference

Compute Taxes for USA. More...

Functions/Subroutines

integer(kind=ik) function, public max_bracket (val, brackets)
 Find the bracket val belongs in given an array of bracket end points.
 
real(kind=rk) function, public tax (val, breaks, rates)
 Compute tax given value, bracket breaks, and bracket rates.
 
real(kind=rk) function, public effective_tax_rate (val, breaks, rates)
 Compute effective tax rate given value, bracket breaks, and bracket rates.
 
real(kind=rk) function, public projected_tax (val, breaks, rates, year, inflation)
 Compute projected effective tax rate with tax() by adjusting the breaks into the future for inflation.
 

Variables

integer(kind=ik), parameter, public seed_tax_year = 2024
 
real(kind=rk), parameter, public std_tax_deduction_single = 14600
 
real(kind=rk), parameter, public std_tax_deduction_joint = 29200
 
real(kind=rk), parameter, public std_tax_deduction_separately = 14600
 
real(kind=rk), parameter, public std_tax_deduction_head = 21900
 
real(kind=rk), dimension(7), parameter, public tax_bracket_rates = [ 10, 12, 22, 24, 32, 35, 37]
 
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_single = [11600, 47150, 100525, 191950, 243725, 609350, 609351]
 
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_joint = [23200, 94300, 201050, 383900, 487450, 731200, 731201]
 
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_head = [16550, 63100, 100500, 191950, 243700, 609350, 609350]
 
real(kind=rk), dimension(7), parameter, public tax_bracket_breaks_separately = [11600, 47150, 100525, 191950, 243725, 365600, 365601]
 

Detailed Description

Compute Taxes for USA.

Function/Subroutine Documentation

◆ max_bracket()

integer(kind=ik) function, public mrffl_us_taxes::max_bracket ( real(kind=rk), intent(in) val,
real(kind=rk), dimension(:), intent(in) brackets )

Find the bracket val belongs in given an array of bracket end points.

brackets is an array consisting of bracket endpoints \( [ e_1, e_2, ..., e_{n-1}, e_{n} ] \) such that \( e_1 < e_2 < ... < e_{n-1} < e_n \).

The endpoints define a set of intervals: \( (-\infty, e1], (e_1, e_2], ..., (e_{n-2}, e_{n-1}], (e_{n-1}, e_n), [e_n, \infity) \) Note the second to last interval is open – the rest are half open. We enumerate these intervals from 0 up to n.

This function returns the index for the interval containing val.

Definition at line 89 of file mrffl_us_taxes.f90.

References max_bracket().

Referenced by max_bracket().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tax()

real(kind=rk) function, public mrffl_us_taxes::tax ( real(kind=rk), intent(in) val,
real(kind=rk), dimension(:), intent(in) breaks,
real(kind=rk), dimension(:), intent(in) rates )

Compute tax given value, bracket breaks, and bracket rates.

see max_bracket() for a description of breaks. The rates array are the tax rates for each bracket.

Definition at line 113 of file mrffl_us_taxes.f90.

References mrffl_percentages::percentage_of(), tax(), and mrffl_config::zero_epsilon.

Referenced by effective_tax_rate(), projected_tax(), and tax().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ effective_tax_rate()

real(kind=rk) function, public mrffl_us_taxes::effective_tax_rate ( real(kind=rk), intent(in) val,
real(kind=rk), dimension(:), intent(in) breaks,
real(kind=rk), dimension(:), intent(in) rates )

Compute effective tax rate given value, bracket breaks, and bracket rates.

see max_bracket() for a description of breaks. The rates array are the tax rates for each bracket.

Definition at line 142 of file mrffl_us_taxes.f90.

References effective_tax_rate(), mrffl_percentages::percentage_of_total(), tax(), and mrffl_config::zero_epsilon.

Referenced by effective_tax_rate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projected_tax()

real(kind=rk) function, public mrffl_us_taxes::projected_tax ( real(kind=rk), intent(in) val,
real(kind=rk), dimension(:), intent(in) breaks,
real(kind=rk), dimension(:), intent(in) rates,
integer(kind=ik), intent(in) year,
real(kind=rk), intent(in) inflation )

Compute projected effective tax rate with tax() by adjusting the breaks into the future for inflation.

If year is in the past with respect to our tax information, then -1 is returned.

Definition at line 157 of file mrffl_us_taxes.f90.

References mrffl_tvm::fv_from_pv_n_i(), projected_tax(), seed_tax_year, and tax().

Referenced by projected_tax().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ seed_tax_year

integer(kind=ik), parameter, public mrffl_us_taxes::seed_tax_year = 2024

Definition at line 48 of file mrffl_us_taxes.f90.

Referenced by projected_tax().

◆ std_tax_deduction_single

real(kind=rk), parameter, public mrffl_us_taxes::std_tax_deduction_single = 14600

Definition at line 49 of file mrffl_us_taxes.f90.

◆ std_tax_deduction_joint

real(kind=rk), parameter, public mrffl_us_taxes::std_tax_deduction_joint = 29200

Definition at line 50 of file mrffl_us_taxes.f90.

◆ std_tax_deduction_separately

real(kind=rk), parameter, public mrffl_us_taxes::std_tax_deduction_separately = 14600

Definition at line 51 of file mrffl_us_taxes.f90.

◆ std_tax_deduction_head

real(kind=rk), parameter, public mrffl_us_taxes::std_tax_deduction_head = 21900

Definition at line 52 of file mrffl_us_taxes.f90.

◆ tax_bracket_rates

real(kind=rk), dimension(7), parameter, public mrffl_us_taxes::tax_bracket_rates = [ 10, 12, 22, 24, 32, 35, 37]

Definition at line 53 of file mrffl_us_taxes.f90.

◆ tax_bracket_breaks_single

real(kind=rk), dimension(7), parameter, public mrffl_us_taxes::tax_bracket_breaks_single = [11600, 47150, 100525, 191950, 243725, 609350, 609351]

Definition at line 54 of file mrffl_us_taxes.f90.

◆ tax_bracket_breaks_joint

real(kind=rk), dimension(7), parameter, public mrffl_us_taxes::tax_bracket_breaks_joint = [23200, 94300, 201050, 383900, 487450, 731200, 731201]

Definition at line 55 of file mrffl_us_taxes.f90.

◆ tax_bracket_breaks_head

real(kind=rk), dimension(7), parameter, public mrffl_us_taxes::tax_bracket_breaks_head = [16550, 63100, 100500, 191950, 243700, 609350, 609350]

Definition at line 56 of file mrffl_us_taxes.f90.

◆ tax_bracket_breaks_separately

real(kind=rk), dimension(7), parameter, public mrffl_us_taxes::tax_bracket_breaks_separately = [11600, 47150, 100525, 191950, 243725, 365600, 365601]

Definition at line 57 of file mrffl_us_taxes.f90.