| Title: | Assorted Functions and Observations by P0bs |
|---|---|
| Description: | Provides assorted functions by p0bs. |
| Authors: | Robin Penfold [aut, cre] |
| Maintainer: | Robin Penfold <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.4.0 |
| Built: | 2026-05-25 06:24:58 UTC |
| Source: | https://github.com/p0bs/p0bservations |
This function applies the prevailing tax bands and rates to give a simple calculation for UK Income Tax and National Insurance (to the nearest couple of pounds). Please note that these are approximations, so do not rely on them for financial returns or planning. The output is a named list containing: 'income_net' for the net income after Income Tax and National Insurance; 'income_tax' for the Income Tax liability; 'ni' for the National Insurance liability; and 'total_tax' for the combined liability. 'income_taxable' may be a numeric vector; all output list elements will be vectors of the same length.
liability_tax(income_taxable, tax_year_end)liability_tax(income_taxable, tax_year_end)
income_taxable |
The taxable income level (i.e. after deductions for things like pension contributions). May be a numeric vector. |
tax_year_end |
The calendar year in which the tax year ends, as a YYYY integer. For example, tax year 2023/24 would be 2024. |
liability_tax( income_taxable = 38000, tax_year_end = 2024 )$total_tax # Vectorised over multiple incomes liability_tax( income_taxable = c(22000, 40000, 65000), tax_year_end = 2024 )$total_taxliability_tax( income_taxable = 38000, tax_year_end = 2024 )$total_tax # Vectorised over multiple incomes liability_tax( income_taxable = c(22000, 40000, 65000), tax_year_end = 2024 )$total_tax
This function uses the Milevsky-Robinson method to analyse the probability of retirement ruin, by parsimoniously meshing investment risk and return, mortality estimates and spending rates without resorting to opaque Monte Carlo simulations. For further details, see: Milevsky, M. and C. Robinson; "A Sustainable Spending Rate without Simulation"; Financial Analysts Journal, Volume 61, Number 6. (2005). Please note that these are approximations, so do not rely on them for financial returns or planning. All arguments are vectorised and are recycled in the standard R fashion.
probability_ruin( return_expected, return_sd, life_remaining_expected, rate_spend )probability_ruin( return_expected, return_sd, life_remaining_expected, rate_spend )
return_expected |
The expected real return of the entire pension portfolio. |
return_sd |
The projected standard deviation of the returns of the entire pension portfolio. |
life_remaining_expected |
The median projected remaining lifespan of the individual in question. |
rate_spend |
The annual spending rate applied by the individual to their pension portfolio. |
probability_ruin( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, rate_spend = 0.05 ) # Vectorised: sweep over spending rates probability_ruin( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, rate_spend = c(0.03, 0.04, 0.05) )probability_ruin( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, rate_spend = 0.05 ) # Vectorised: sweep over spending rates probability_ruin( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, rate_spend = c(0.03, 0.04, 0.05) )
This function uses the Milevsky-Robinson method to find the spend rate corresponding to a given probability of retirement ruin, by parsimoniously meshing investment risk and return, mortality estimates and spending rates without resorting to opaque Monte Carlo simulations. For further details, see: Milevsky, M. and C. Robinson; "A Sustainable Spending Rate without Simulation"; Financial Analysts Journal, Volume 61, Number 6. (2005). Please note that these are approximations, so do not rely on them for financial returns or planning. All arguments are vectorised and are recycled in the standard R fashion.
probability_ruin_rate( return_expected, return_sd, life_remaining_expected, value_probability_ruin )probability_ruin_rate( return_expected, return_sd, life_remaining_expected, value_probability_ruin )
return_expected |
The expected real return of the entire pension portfolio. |
return_sd |
The projected standard deviation of the returns of the entire pension portfolio. |
life_remaining_expected |
The median projected remaining lifespan of the individual in question. |
value_probability_ruin |
The desired probability of retirement ruin, strictly between 0 and 1. |
probability_ruin_rate( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, value_probability_ruin = 0.1 ) # Vectorised: sweep over target ruin probabilities probability_ruin_rate( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, value_probability_ruin = c(0.05, 0.1, 0.2) )probability_ruin_rate( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, value_probability_ruin = 0.1 ) # Vectorised: sweep over target ruin probabilities probability_ruin_rate( return_expected = 0.07, return_sd = 0.2, life_remaining_expected = 28.1, value_probability_ruin = c(0.05, 0.1, 0.2) )
This function retrieves data on UK annuity rates from Sharing Pensions. Rates are available for different specifications and ages. See the website for further details. Please note that these are approximations, so do not rely on them for financial returns or planning.
rate_annuity(value_age, value_specifications)rate_annuity(value_age, value_specifications)
value_age |
These are the choices for the age of the annuitant, namely: '55', '60', '65', '70' or '75'. The ensuing annuity rates imply that the annuity begins to be paid immediately and thereafter on a monthly basis. |
value_specifications |
These are the specifications available, varying by: whether the annuity is on a single basis or a joint basis (and, if so, whether the last remaining spouse receives half or all of the annuity); whether the annuity is guaranteed for ten years or not; and whether the payments will escalate at 3 are available:
|
<https://www.sharingpensions.co.uk/annuity_rates.htm>
## Not run: rate_annuity(value_age = "65", value_specifications = "single_simple") ## End(Not run)## Not run: rate_annuity(value_age = "65", value_specifications = "single_simple") ## End(Not run)
A dataset containing the main tax parameters used for calculating net income for the UK (outside of Scotland).
tax_parameterstax_parameters
A data frame with 3 rows (one for each tax year) and 14 variables:
the calendar year in which the end of the tax year occurs
the lower level breakpoint for National Insurance
the upper level breakpoint for National Insurance
the lower level breakpoint for personal allowance
the upper level breakpoint for personal allowance
the income breakpoint for higher rate income tax
the income breakpoint for upper rate income tax
the lower level tax rate for National Insurance
the upper level tax rate for National Insurance
the rate at which personal allowance drops after 'level_allowance_upper'
the basic rate of income tax
the higher rate of income tax
the upper rate of income tax
the rate of sales tax, also called VAT
https://www.crunch.co.uk/knowledge-tax/tax-rates-thresholds-and-allowances-for-current-tax-year/