owlplanner 2025.2.11__tar.gz → 2025.2.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. owlplanner-2025.2.15/.gitattributes +1 -0
  2. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/.github/workflows/github-actions-runtests.yml +1 -1
  3. owlplanner-2025.2.15/INSTALL.md +64 -0
  4. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/PKG-INFO +52 -242
  5. owlplanner-2025.2.15/README.md +189 -0
  6. owlplanner-2025.2.15/USER_GUIDE.md +225 -0
  7. owlplanner-2025.2.15/docker/Dockerfile +34 -0
  8. owlplanner-2025.2.15/docker/README.md +74 -0
  9. owlplanner-2025.2.15/docker/docker-compose.yml +7 -0
  10. owlplanner-2025.2.15/docker/fastentrypoint.sh +9 -0
  11. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/case_jack+jill.toml +1 -0
  12. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/case_joe.toml +1 -0
  13. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/case_john+sally.toml +1 -0
  14. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/case_kim+sam-bequest.toml +1 -0
  15. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/case_kim+sam-spending.toml +1 -0
  16. owlplanner-2025.2.15/owlplanner.cmd +20 -0
  17. owlplanner-2025.2.15/owlplanner.sh +9 -0
  18. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/pyproject.toml +1 -1
  19. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/config.py +2 -0
  20. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/plan.py +14 -4
  21. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/tax2025.py +63 -43
  22. owlplanner-2025.2.15/src/owlplanner/version.py +1 -0
  23. owlplanner-2025.2.15/ttt.py +20 -0
  24. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/About_Owl.py +7 -2
  25. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Create_Case.py +2 -2
  26. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Documentation.py +24 -38
  27. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Quick_Start.py +2 -1
  28. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Rates_Selection.py +4 -0
  29. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Settings.py +10 -0
  30. owlplanner-2025.2.15/ui/main+fonts.py +55 -0
  31. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/owlbridge.py +4 -0
  32. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/requirements.txt +1 -1
  33. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/sskeys.py +1 -0
  34. owlplanner-2025.2.15/ui/style.css +8 -0
  35. owlplanner-2025.2.11/INSTALL.md +0 -32
  36. owlplanner-2025.2.11/README.md +0 -379
  37. owlplanner-2025.2.11/owlplanner.cmd +0 -8
  38. owlplanner-2025.2.11/src/owlplanner/version.py +0 -1
  39. owlplanner-2025.2.11/test.py +0 -18
  40. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/.devcontainer/devcontainer.json +0 -0
  41. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/.flake8 +0 -0
  42. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/.gitignore +0 -0
  43. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/LICENSE +0 -0
  44. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/AD-taxDef.png +0 -0
  45. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/AD-taxFree.png +0 -0
  46. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/AD-taxable.png +0 -0
  47. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/Hist_Bequest.png +0 -0
  48. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/Hist_Spending.png +0 -0
  49. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/MC-tutorial2a.png +0 -0
  50. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/MC-tutorial2b.png +0 -0
  51. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/OwlUI.png +0 -0
  52. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/allocations.png +0 -0
  53. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/owl.png +0 -0
  54. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/profile.png +0 -0
  55. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/ratesCorrelations.png +0 -0
  56. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/ratesPlot.png +0 -0
  57. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/savingsPlot.png +0 -0
  58. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/sourcesPlot.png +0 -0
  59. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/spendingPlot.png +0 -0
  60. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/taxIncomePlot.png +0 -0
  61. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/images/taxesPlot.png +0 -0
  62. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/owl.pdf +0 -0
  63. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/docs/owl.tex +0 -0
  64. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/jack+jill.xlsx +0 -0
  65. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/joe.xlsx +0 -0
  66. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/john+sally.xlsx +0 -0
  67. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/examples/template.xlsx +0 -0
  68. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/notebooks/john+sally.ipynb +0 -0
  69. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/notebooks/kim+sam.ipynb +0 -0
  70. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/notebooks/template.ipynb +0 -0
  71. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/notebooks/tutorial_1.ipynb +0 -0
  72. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/notebooks/tutorial_2.ipynb +0 -0
  73. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/notebooks/tutorial_3.ipynb +0 -0
  74. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/requirements.txt +0 -0
  75. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/__init__.py +0 -0
  76. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/abcapi.py +0 -0
  77. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/data/__init__.py +0 -0
  78. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/data/rates.csv +0 -0
  79. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/logging.py +0 -0
  80. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/progress.py +0 -0
  81. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/rates.py +0 -0
  82. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/timelists.py +0 -0
  83. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/src/owlplanner/utils.py +0 -0
  84. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/tests/test_logger.py +0 -0
  85. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/tests/test_regressions.py +0 -0
  86. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/tests/test_repro.py +0 -0
  87. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/tests/test_toml_cases.py +0 -0
  88. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/tests/test_units.py +0 -0
  89. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Asset_Allocation.py +0 -0
  90. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Assets.py +0 -0
  91. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Fixed_Income.py +0 -0
  92. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Graphs.py +0 -0
  93. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Historical_Range.py +0 -0
  94. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Logs.py +0 -0
  95. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Monte_Carlo.py +0 -0
  96. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Optimization_Parameters.py +0 -0
  97. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Output_Files.py +0 -0
  98. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/README.md +0 -0
  99. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Wages_And_Contributions.py +0 -0
  100. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/Worksheets.py +0 -0
  101. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/main.py +0 -0
  102. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/plots.py +0 -0
  103. {owlplanner-2025.2.11 → owlplanner-2025.2.15}/ui/progress.py +0 -0
@@ -0,0 +1 @@
1
+ *.sh -crlf
@@ -11,7 +11,7 @@ jobs:
11
11
  strategy:
12
12
  fail-fast: false
13
13
  matrix:
14
- python-version: ["3.9", "3.10", "3.12"]
14
+ python-version: ["3.9", "3.10", "3.12", "3.13"]
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@v4
@@ -0,0 +1,64 @@
1
+ # Owl
2
+
3
+ ## A retirement exploration tool based on linear programming
4
+
5
+ <img align=right src="https://raw.github.com/mdlacasse/Owl/main/docs/images/owl.png" width="250">
6
+
7
+ ------------------------------------------------------------------------------------
8
+ ### About
9
+ This document is aimed at software developers desiring to install the Owl source code
10
+ and run it locally on their computer.
11
+
12
+ For end-users, we suggest accessing Owl from the [Streamlit Community Server](http://owlplanner.streamlit.app)
13
+ or, if one prefers to have everything on their own computer,
14
+ to install and run a Docker image as described in these [instructions](docker/README.md).
15
+
16
+ ### Requirements
17
+ You will need Python and `pip` installed on your computer for that purpose.
18
+
19
+ ### Installation steps for developers
20
+ These instructions are command-line instructions.
21
+ You will need the latest version of Owl from GitHub.
22
+ ```shell
23
+ git clone https://github.com/mdlacasse/Owl.git
24
+
25
+ ```
26
+ Go (`cd`) to the directory where you installed Owl.
27
+ From the top directory of the source code run:
28
+ ```shell
29
+ python -m build
30
+ pip install -e .
31
+ ```
32
+ The -e instructs Python to load the live version in the current directory tree.
33
+
34
+ ### Running the streamlit frontend
35
+ Running the Owl user interface locally from Windows:
36
+ ```shell
37
+ ./owlplanner.cmd
38
+ ```
39
+ Running the Owl user interface locally from Linux or MacOS:
40
+ ```shell
41
+ ./owlplanner.sh
42
+ ```
43
+
44
+ ### Publishing a version (for reference only)
45
+ Run checks before commit:
46
+ ```
47
+ flake8 ui src tests
48
+ pytest
49
+ ```
50
+ Edit version number in `src/owlplanner/version.py`, `ui/requirements.txt`, and in `pyproject.toml`. Then,
51
+ ```shell
52
+ rm dist/*
53
+ python -m build
54
+ twine upload --repository [repo] dist/*
55
+ ```
56
+ where [repo] is *testpypi* or *pypi* depending on the type of release.
57
+
58
+ ### Installation steps for Python package only
59
+ You can install the Owl package directly from the [Python Package Index](http://pypi.org).
60
+ The following command will install the current version of owlplanner and all its dependencies:
61
+ ```shell
62
+ pip install -r ui/requirements.txt
63
+ ```
64
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: owlplanner
3
- Version: 2025.2.11
3
+ Version: 2025.2.15
4
4
  Summary: Owl: Retirement planner with great wisdom
5
5
  Project-URL: HomePage, https://github.com/mdlacasse/owl
6
6
  Project-URL: Repository, https://github.com/mdlacasse/owl
@@ -708,15 +708,21 @@ Description-Content-Type: text/markdown
708
708
 
709
709
  <img align=right src="https://raw.github.com/mdlacasse/Owl/main/docs/images/owl.png" width="250">
710
710
 
711
- -----
711
+ -------------------------------------------------------------------------------------
712
+
713
+ ### TL;DR
714
+ Owl is a planning tool that uses a linear programming optimization algorithm to provide guidance on retirement decisions. There are a few ways to run Owl.
712
715
 
713
- ### TLDR
714
- Owl is a planning tool that uses a linear programming optimization algorithm to provide guidance on retirement decisions.
716
+ - Run Owl directly on the Streamlit Community Server at [owlplanner.streamlit.app](https://owlplanner.streamlit.app).
715
717
 
716
- Go to [owlplanner.streamlit.app](https://owlplanner.streamlit.app) and explore the app to learn about its capabilities.
718
+ - Run locally on your computer using a Docker image.
719
+ Follow these [instructions](docker/README.md) for this option.
717
720
 
718
- -----
721
+ - Run locally on your computer using Python code and libraries.
722
+ Follow these [instructions](INSTALL.md) to install Owl from the source code and run it on your computer.
719
723
 
724
+ -------------------------------------------------------------------------------------
725
+ ## Overview
720
726
  This package is a retirement modeling framework for exploring the sensitivity of retirement financial decisions.
721
727
  Strictly speaking, it is not a planning tool, but more an environment for exploring *what if* scenarios.
722
728
  It provides different realizations of a financial strategy through the rigorous
@@ -750,21 +756,21 @@ The algorithms in Owl rely on the open-source HiGHS linear programming solver. T
750
756
  detailed description of the underlying
751
757
  mathematical model can be found [here](https://raw.github.com/mdlacasse/Owl/main/docs/owl.pdf).
752
758
 
753
- While Owl can be used through Jupyter notebooks,
754
- its simple API also serves as a back-end for a Web application using Streamlit.
755
- A hosted version of the app can be found at [owlplanner.streamlit.app](https://owlplanner.streamlit.app).
756
- Alternatively, the application can also be run locally by simply running the script
757
- `owlplanner.cmd` once all the dependencies have been installed.
759
+ It is anticipated that most end users will use Owl through the graphical interface
760
+ either at [owlplanner.streamlit.app](https://owlplanner.streamlit.app)
761
+ or [installed](INSTALL.md) on their own computer.
762
+ The underlying Python package can also be used directly through Python scripts or a Jupyter Notebook
763
+ as described [here](USER_GUIDE.md).
758
764
 
759
765
  Not every retirement decision strategy can be framed as an easy-to-solve optimization problem.
760
766
  In particular, if one is interested in comparing different withdrawal strategies,
761
- [FI Calc](ficalc.app) is a more appropriate and elegant application that addresses this need.
767
+ [FI Calc](ficalc.app) is an elegant application that addresses this need.
762
768
  If, however, you also want to optimize spending, bequest, and Roth conversions, with
763
769
  an approach also considering Medicare and federal income tax over the next few years,
764
770
  then Owl is definitely a tool that can help guide your decisions.
765
771
 
766
772
  --------------------------------------------------------------------------------------
767
- ## Basic capabilities
773
+ ## Capabilities
768
774
  Owl can optimize for either maximum net spending under the constraint of a given bequest (which can be zero),
769
775
  or maximize the after-tax value of a bequest under the constraint of a desired net spending profile,
770
776
  and under the assumption of a heirs marginal tax rate.
@@ -783,7 +789,7 @@ Other asset classes can easily be added, but would add complexity while only pro
783
789
  Historical data used are from
784
790
  [Aswath Damodaran](https://pages.stern.nyu.edu/~adamodar/) at the Stern School of Business.
785
791
  Asset allocations are selected for the duration of the plan, and these can glide linearly
786
- or along a configurable s-curve from now to the last year of the plan.
792
+ or along a configurable s-curve over the lifespan of the individual.
787
793
 
788
794
  Spending profiles are adjusted for inflation, and so are all other indexable quantities. Proflies can be
789
795
  flat or follow a *smile* curve which is also adjustable through two simple parameters.
@@ -794,10 +800,10 @@ the statistical characteristics (means and covariance matrix) of
794
800
  a selected historical year range. Pure *stochastic* rates can also be generated
795
801
  if the user provides means, volatility (expressed as standard deviation), and optionally
796
802
  the correlations between the different assets return rates provided as a matrix, or a list of
797
- the off-diagonal elements (see the notebook tutorial for details).
803
+ the off-diagonal elements (see documentation for details).
798
804
  Average rates calculated over a historical data period can also be chosen.
799
805
 
800
- Monte Carlo simulations capabilities are included and provide a probability of success and a histogram of
806
+ Monte Carlo simulations capabilities are included and provide a probability of success and a histogram of
801
807
  outcomes. These simulations can be used for either determining the probability distribution of the
802
808
  maximum net spending amount under
803
809
  the constraint of a desired bequest, or the probability distribution of the maximum
@@ -805,32 +811,37 @@ bequest under the constraint of a desired net spending amount. Unlike discrete-e
805
811
  simulators, Owl uses an optimization algorithm for every new scenario, which results in more
806
812
  calculations being performed. As a result, the number of cases to be considered should be kept
807
813
  to a reasonable number. For a few hundred cases, a few minutes of calculations can provide very good estimates
808
- and reliable probability distributions. Optimizing each solution is more representative in the sense that optimal solutions
809
- will naturally adjust to the return scenarios being considered. This is more realistic as retirees would certainly re-evaluate
810
- their expectations under severe market drops or gains. This optimal approach provides a net benefit over event-based simulations,
814
+ and reliable probability distributions.
815
+
816
+ Optimizing each solution is more representative than event-base simulators
817
+ in the sense that optimal solutions
818
+ will naturally adjust to the return scenarios being considered.
819
+ This is more realistic as retirees would certainly re-evaluate
820
+ their expectations under severe market drops or gains.
821
+ This optimal approach provides a net benefit over event-based simulators,
811
822
  which maintain a distribution strategy either fixed, or within guardrails for capturing the
812
- retirees' reactions to the market.
823
+ retirees' reactions to the market.
813
824
 
814
- Basic input parameters are given through function calls while optional additional time series can be read from
825
+ Basic input parameters can be entered through the user interface
826
+ while optional additional time series can be read from
815
827
  an Excel spreadsheet that contains future wages, contributions
816
- to savings accounts, and planned *big-ticket items* such as the purchase of a lake house, the sale of a boat,
817
- large gifts, or inheritance.
828
+ to savings accounts, and planned *big-ticket items* such as the purchase of a lake house,
829
+ the sale of a boat, large gifts, or inheritance.
818
830
 
819
831
  Three types of savings accounts are considered: taxable, tax-deferred, and tax-exempt,
820
832
  which are all tracked separately for married individuals. Asset transition to the surviving spouse
821
- is done according to beneficiary fractions for each account type.
833
+ is done according to beneficiary fractions for each type of savings account.
822
834
  Tax status covers married filing jointly and single, depending on the number of individuals reported.
823
835
 
824
- Medicare and IRMAA calculations are performed through a self-consistent loop on cash flow constraints. Future
825
- values are simple projections of current values with the assumed inflation rates.
826
-
827
- See one of the notebooks for a tutorial and representative user cases.
836
+ Medicare and IRMAA calculations are performed through a self-consistent loop on cash flow constraints.
837
+ Future values are simple projections of current values with the assumed inflation rates.
828
838
 
829
839
  ### Limitations
830
840
  Owl is work in progress. At the current time:
831
841
  - Only the US federal income tax is considered (and minimized through the optimization algorithm).
832
842
  Head of household filing status has not been added but can easily be.
833
- - Required minimum distributions are calculated, but tables for spouses more than 10 years apart are not included. An error message will be generated for these cases.
843
+ - Required minimum distributions are calculated, but tables for spouses more than 10 years apart are not included.
844
+ These cases are detected and will generate an error message.
834
845
  - Social security rule for surviving spouse assumes that benefits were taken at full retirement age.
835
846
  - Current version has no optimization of asset allocations between individuals and/or types of savings accounts.
836
847
  If there is interest, that could be added in the future.
@@ -839,12 +850,12 @@ If there is interest, that could be added in the future.
839
850
  This means that the Medicare premiums are calculated after an initial solution is generated,
840
851
  and then a new solution is re-generated with these premiums as a constraint.
841
852
  In some situations, when the income (MAGI) is near an IRMAA bracket, oscillatory solutions can arise.
842
- Owl will detect these cases and inform the user.
843
- While the solutions generated are very close to one another, Owl will pick the smallest one
853
+ While the solutions generated are very close to one another, Owl will pick the smallest solution
844
854
  for being conservative.
845
- - Part D is not included in the IRMAA calculations. Being considerably more, only Part B is taken into account.
846
- - Future tax brackets are pure speculations derived from the little we know now and projected to the next 30 years. Your guesses are as good as mine.
847
- Having a knob to adjust future rates might be an interesting feature to add for measuring the impact on Roth conversions.
855
+ - Part D is not included in the IRMAA calculations. Being considerably more significant,
856
+ only Part B is taken into account.
857
+ - Future tax brackets are pure speculations derived from the little we know now and projected to the next 30 years.
858
+ Your guesses are as good as mine.
848
859
 
849
860
  The solution from an optimization algorithm has only two states: feasible and infeasible.
850
861
  Therefore, unlike event-driven simulators that can tell you that your distribution strategy runs
@@ -854,215 +865,12 @@ estate value too large for the savings assets to support, even with zero net spe
854
865
  or maximizing the bequest subject to a net spending basis that is already too large for the savings
855
866
  assets to support, even with no estate being left.
856
867
 
857
- -----------------------------------------------------------------------
858
- ## An example of Owl's functionality
859
- With about 10 lines of Python code, one can generate a full case study.
860
- Here is a typical plan with some comments.
861
- A plan starts with the names of the individuals, their birth years and life expectancies, and a name for the plan.
862
- Dollar amounts are in k\$ (i.e. thousands) and ratios in percentage.
863
- ```python
864
- import owlplanner as owl
865
- # Jack was born in 1962 and expects to live to age 89. Jill was born in 1965 and hopes to live to age 92.
866
- # Plan starts on Jan 1st of this year.
867
- plan = owl.Plan(['Jack', 'Jill'], [1962, 1965], [89, 92], 'jack & jill - tutorial', startDate='01-01')
868
- # Jack has $90.5k in a taxable investment account, $600.5k in a tax-deferred account and $70k from 2 tax-exempt accounts.
869
- # Jill has $60.2k in her taxable account, $150k in a 403b, and $40k in a Roth IRA.
870
- plan.setAccountBalances(taxable=[90.5, 60.2], taxDeferred=[600.5, 150], taxFree=[50.6 + 20, 40.8])
871
- # An Excel file contains 2 tabs (one for Jill, one for Jack) describing anticipated wages and contributions.
872
- plan.readContributions('jack+jill.xlsx')
873
- # Jack will glide an s-curve for asset allocations from a 60/40 -> 70/30 stocks/bonds portfolio.
874
- # Jill will do the same thing but is a bit more conservative from 50/50 -> 70/30 stocks/bonds portfolio.
875
- plan.setInterpolationMethod('s-curve')
876
- plan.setAllocationRatios('individual', generic=[[[60, 40, 0, 0], [70, 30, 0, 0]], [[50, 50, 0, 0], [70, 30, 0, 0]]])
877
- # Jack has no pension, but Jill will receive $10k per year at 65 yo.
878
- plan.setPension([0, 10.5], [65, 65])
879
- # Jack anticipates receiving social security of $28.4k at age 70, and Jill $19.7k at age 62. All values are in today's $.
880
- plan.setSocialSecurity([28.4, 19.7], [70, 62])
881
- # Instead of a 'flat' profile, we select a 'smile' spending profile, with 60% needs for the survivor.
882
- plan.setSpendingProfile('smile', 60)
883
- # We will reproduce the historical sequence of returns starting in year 1969.
884
- plan.setRates('historical', 1969)
885
- # Jack and Jill want to leave a bequest of $500k, and limit Roth conversions to $100k per year.
886
- # Jill's 403b plan does not support in-plan Roth conversions.
887
- # We solve for the maximum net spending profile under these constraints.
888
- plan.solve('maxSpending', options={'maxRothConversion': 100, 'bequest': 500, 'noRothConversions': 'Jill'})
889
- ```
890
- The output can be seen using the following commands that display various plots of the decision variables in time.
891
- ```python
892
- plan.showNetSpending()
893
- plan.showGrossIncome()
894
- plan.showTaxes()
895
- plan.showSources()
896
- plan.showAccounts()
897
- plan.showAssetDistribution()
898
- ...
899
- ```
900
- By default, all these plots are in nominal dollars. To get values in today's $, a call to
901
- ```python
902
- plan.setDefaultPlots('today')
903
- ```
904
- would change all graphs to report in today's dollars. Each plot can also override the default by setting the `value`
905
- parameters to either *nominal* or *today*, such as in the following example, which shows the taxable ordinary
906
- income over the duration of the plan,
907
- along with inflation-adjusted extrapolated tax brackets. Notice how the optimized income is surfing
908
- the boundaries of tax brackets.
909
- ```python
910
- plan.showGrossIncome(value='nominal')
911
- ```
912
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/taxIncomePlot.png" width="75%">
913
-
914
- The optimal spending profile is shown in the next plot (in today's dollars). Notice the drop
915
- (recall we selected 60% survivor needs) at the passing of the first spouse.
916
- ```python
917
- plan.showProfile('today')
918
- ```
919
-
920
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/spendingPlot.png" width="75%">
921
-
922
- The following plot shows the account balances in nominal value for all savings accounts owned by Jack and Jill.
923
- It was generated using
924
- ```python
925
- plan.showAccounts(value='nominal')
926
- ```
927
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/savingsPlot.png" width="75%">
928
-
929
- while this plot shows the complex cash flow from all sources, which was generated with
930
- ```python
931
- plan.showSources(value='nominal')
932
- ```
933
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/sourcesPlot.png" width="75%">
934
-
935
- For taxes, the following call will display Medicare premiums (including Part B IRMAA fees) and federal income tax
936
- ```python
937
- plan.showTaxes(value='nominal')
938
- ```
939
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/taxesPlot.png" width="75%">
940
-
941
- For the case at hand, recall that asset allocations were selected above through
942
-
943
- ```python
944
- plan.setAllocationRatios('individual', generic=[[[60, 40, 0, 0], [70, 30, 0, 0]], [[50, 50, 0, 0], [70, 30, 0, 0]]])
945
- ```
946
- gliding from a 60%/40% stocks/bonds portfolio to 70%/30% for Jack, and 50%/50% -> 70%/30% for Jill.
947
- Assets distribution in all accounts in today's $ over time can be displayed from
948
- ```python
949
- plan.showAssetDistribution(value='today')
950
- ```
951
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/AD-taxable.png" width="75%">
952
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/AD-taxDef.png" width="75%">
953
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/AD-taxFree.png" width="75%">
954
-
955
- These plots are irregular because we used historical rates from 1969. The volatility of
956
- the rates offers Roth conversion benefits which are exploited by the optimizer.
957
- The rates used can be displayed by:
958
- ```python
959
- plan.showRates()
960
- ```
961
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/ratesPlot.png" width="75%">
962
-
963
- Values between brackets <> are the average values and volatility over the selected period.
964
-
965
- For the statisticians, rates distributions and correlations between them can be shown using:
966
- ```python
967
- plan.showRatesCorrelations()
968
- ```
969
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/ratesCorrelations.png" width="75%">
970
-
971
- A short text summary of the outcome of the optimization can be displayed through using:
972
- ```python
973
- plan.summary()
974
- ```
975
- The output of the last command reports that if future rates are exactly like those observed
976
- starting from 1969 and the following years, Jack and Jill could afford an annual spending of
977
- \\$97k starting this year
978
- (with a basis of \\$88.8k - the basis multiplies the profile which can vary over the course of the plan).
979
- The summary also contains some details:
980
- ```
981
- SUMMARY ================================================================
982
- Net yearly spending basis in 2025$: $91,812
983
- Net yearly spending for year 2025: $100,448
984
- Net spending remaining in year 2025: $100,448
985
- Total net spending in 2025$: $2,809,453 ($7,757,092 nominal)
986
- Total Roth conversions in 2025$: $320,639 ($456,454 nominal)
987
- Total income tax paid on ordinary income in 2025$: $247,788 ($469,522 nominal)
988
- Total tax paid on gains and dividends in 2025$: $3,313 ($3,768 nominal)
989
- Total Medicare premiums paid in 2025$: $117,660 ($343,388 nominal)
990
- Spousal wealth transfer from Jack to Jill in year 2051 (nominal): taxable: $0 tax-def: $57,224 tax-free: $2,102,173
991
- Sum of spousal bequests to Jill in year 2051 in 2025$: $499,341 ($2,159,397 nominal)
992
- Post-tax non-spousal bequests from Jack in year 2051 (nominal): taxable: $0 tax-def: $0 tax-free: $0
993
- Sum of post-tax non-spousal bequests from Jack in year 2051 in 2025$: $0 ($0 nominal)
994
- Post-tax account values at the end of final plan year 2057 (nominal): taxable: $0 tax-def: $0 tax-free: $2,488,808
995
- Total estate value at the end of final plan year 2057 in 2025$: $500,000 ($2,488,808 nominal)
996
- Plan starting date: 01-01
997
- Cumulative inflation factor from start date to end of plan: 4.98
998
- Jack's 27-year life horizon: 2025 -> 2051
999
- Jill's 33-year life horizon: 2025 -> 2057
1000
- Plan name: jack & jill - tutorial
1001
- Number of decision variables: 996
1002
- Number of constraints: 867
1003
- Case executed on: 2025-02-04 at 22:55:03
1004
- ------------------------------------------------------------------------
1005
- ```
1006
- And an Excel workbook can be saved with all the detailed amounts over the years by using the following command:
1007
- ```python
1008
- plan.saveWorkbook(overwrite=True)
1009
- ```
1010
- For Monte Carlo simulations, the mean return rates, their volatility and covariance are specified
1011
- and used to generate random scenarios. A histogram of outcomes is generated such as this one for Jack and Jill, which was generated
1012
- by selecting *stochastic* rates and using
1013
- ```
1014
- plan.runMC('maxSpending', ...)
1015
- ```
1016
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/MC-tutorial2a.png" width="75%">
1017
-
1018
- Similarly, the next one was generated using
1019
- ```
1020
- plan.runMC('maxBequest', ...)
1021
- ```
1022
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/MC-tutorial2b.png" width="75%">
1023
-
1024
-
1025
- See tutorial notebooks [1](https://github.com/mdlacasse/Owl/blob/main/notebooks/tutorial_1.ipynb),
1026
- [2](https://github.com/mdlacasse/Owl/blob/main/notebooks/tutorial_2.ipynb), and
1027
- [3](https://github.com/mdlacasse/Owl/blob/main/notebooks/tutorial_3.ipynb) for more info.
1028
-
1029
-
1030
868
  ---------------------------------------------------------------
1031
- ## Requirements
1032
-
1033
- If you have Python already installed on your computer, Owl can be installed as a package using the following commands:
1034
- ```shell
1035
- python -m build
1036
- pip install .
1037
- ```
1038
- These commands need to run from the Owl directory where you downloaded Owl from GitHub either through git or a zip file.
1039
- Pip will install all the required dependencies.
869
+ ## Documentation
1040
870
 
1041
- Owl relies on common Python modules such as NumPy, Pandas, SciPy, matplotlib, and Seaborn.
1042
- The user front-end was built on Streamlit.
1043
- Package `odfpy` might be required if one read files created by LibreOffice. Again, these dependencies
1044
- will be installed by pip.
1045
-
1046
- The simplest way to get started with Owl is to use the `streamlit` browser-based user interface
1047
- that is started by the `owlplanner.cmd` script, which will start a user interface on your own browser.
1048
- Here is a screenshot of one of the multiple tabs of the interface:
1049
-
1050
- <img src="https://raw.github.com/mdlacasse/Owl/main/docs/images/OwlUI.png" width="100%">
1051
-
1052
- Alternatively, one can prefer using Owl from Jupyter notebooks. For that purpose, the `examples` directory
1053
- contains many files as a tutorial. The Jupyter Notebook interface is a browser-based application for authoring documents that combines live-code with narrative text, equations and visualizations.
1054
- Jupyter will run in your default web browser, from your computer to your browser, and therefore no data is ever transferred on the Internet
1055
- (your computer, i.e., `localhost`, is the server).
1056
-
1057
- For simulating your own realizations, use the files beginning with the word *template*.
1058
- Make a copy and rename them with your own names while keeping the same extension.
1059
- Then you'll be able to personalize a case with your own numbers and start experimenting with Owl.
1060
- Notebooks with detailed explanations can be found in
1061
- [tutorial_1](https://github.com/mdlacasse/Owl/blob/main/examples/tutorial_1.ipynb),
1062
- [tutorial_2](https://github.com/mdlacasse/Owl/blob/main/examples/tutorial_1.ipynb), and
1063
- [tutorial_3](https://github.com/mdlacasse/Owl/blob/main/examples/tutorial_2.ipynb).
1064
-
1065
- Finally, you will also need the capability to read and edit Excel files. One can have an Excel license, or use the LibreOffice free alternative. You can also use Google docs.
871
+ - Documentation for the app user interface is available from the interface itself.
872
+ - Installation guide and software requirements can be found [here](INSTALL.md).
873
+ - User guide for the underlying Python package as used in a Jupyter notebook can be found [here](USER_GUIDE.md).
1066
874
 
1067
875
  ---------------------------------------------------------------------
1068
876
 
@@ -1071,12 +879,14 @@ Finally, you will also need the capability to read and edit Excel files. One can
1071
879
  - Image from [freepik](https://freepik.com)
1072
880
  - Optimization solver from [HiGHS](https://highs.dev)
1073
881
  - Streamlit Community Cloud [Streamlit](https://streamlit.io)
882
+ - Contributors: Josh (noimjosh@gmail.com) for Docker image code
1074
883
 
1075
884
  ---------------------------------------------------------------------
1076
885
 
1077
886
  Copyright &copy; 2024 - Martin-D. Lacasse
1078
887
 
1079
- Disclaimers: I am not a financial planner. You make your own decisions. This program comes with no guarantee. Use at your own risk.
888
+ Disclaimers: I am not a financial planner. You make your own decisions.
889
+ This program comes with no guarantee. Use at your own risk.
1080
890
 
1081
891
  --------------------------------------------------------
1082
892