Skip to content

R4GoodPersonalFinances 1.2.0

Latest

Choose a tag to compare

@kalimu kalimu released this 23 Nov 11:49

Minor changes

  • Changed implementation of formula for expected utility in the calc_expected_utility() internal function. Now the Constant Relative Risk Aversion (CRRA) utility and the second derivative of the CRRA utility are implemented in a way that provide more stable gradient for calculating optimal portfolio allocation.
    As a result of this change, the optimal allocation no longer jumps unexpectedly and is more stable over time.
  • Added new and improved existing debug messages visible when debug = TRUE argument is passed to simulate_scenario() function.
  • The function calc_gompertz_mode() is now exported and it can be used to calculate the mode of the Gompertz distribution based on expected life_expectancy.

Bug fixes

  • Fixed discretionary spending dropping unexpectedly to zero in some edge cases caused by division by zero while calculating ratio in the calc_discretionary_spending() function. Now, if the ratio is undefined, it it set to 1.
  • Fixed undefined Gompertz survival probability in a case when current_age equals target_age and max_age. Now, in such cases, the survival probability is set explicitly to 0.
  • Fixed discretionary spending at the last year of a simulation. Now the discretionary spending is set to net-worth at the last year of a simulation which results in zero of financial wealth at the end of the last year.