boknows / cfiresim-open Goto Github PK
View Code? Open in Web Editor NEWAn attempt to re-write the popular retirement calculator (cFIREsim.com) in mainly javascript, and begin the journey toward open-source.
License: Apache License 2.0
An attempt to re-write the popular retirement calculator (cFIREsim.com) in mainly javascript, and begin the journey toward open-source.
License: Apache License 2.0
I completely missed this until someone reviewed it. The Percent of Portfolio spending method should always have a floor/ceiling available, not just if you change the "percentage type".
I believe that the dropdowns in the form should be reworked to be closer to the legacy code, and the spending method itself needs to be adjusted to accept floor/ceiling for this whole spending method. I'm guessing that taking about "percentage type" altogether would be the best path.
It would be great if there was a spending plan based solely on RMD. This is one of the drawdown options I am considering and would love to be able to model it and compare the output to other drawdown methods. Thank you.
When I use the same simulation values for simulations in the old and new sites I get significantly different results.
Simulation values:
This should be a value in the dropdown for Data Options, not in the Investigate dropdown.
When selecting "Non-recurring" as "false", for either Income or Spending, those numbers do not show up in the "Portfolio Adjustments", or anywhere in the simulation.
This might be related to #34
Repeatable using the Percent of Portfolio spending plan. It appears that the spending floor is not being used.
Validation rules are preventing Initial Spending and Initial Portfolio from being $0. This is a bug.
If you put any "Retirement Start Year" in the future, the chart is blank. Initial research shows that the variable infAdjSpending is showing up as NaN and spending as "undefined" in the years before retirement, probably causing an error parsing into a chart.
This button needs to be at the top right of a given output page, and must open a download dialog. Currently there is an issue with it not functioning as a . Change it to an within a
https://github.com/boknows/cFIREsim-open/blob/master/cfiresim.sql#L42-L185
Guessing the S&P, U.S. Total, or World Total Stock?
This button needs to be bolder, and probably colored. We also need to find a good place for it in the top-right of the screen, so that people don't need to scroll down all the way (necessarily) to press it.
avgPortfolioAtRetirement and successRate are currently null. Make sure that all stats from legacy cFIREsim are included.
Example test portfolio:
$1,000,000 portfolio.
$50,000 SS income.
$60,000 yearly spend, inflation adjusted.
This is the Withdrawal Analysis
<
1st 5y : 1-10 : 11-20 : 21-30
Average: $60,000 $55,000 $60,000 $60,000
Median: $60,000 $60,000 $60,000 $60,000
St. Dev.: $0 $16,583 $0 $0
Highest: $60,000 $60,000 $60,000 $60,000
Lowest: $60,000 $0 $60,000 $60,000
Failures: 0 0 0 0
These numbers make no sense to me. Perhaps I don't understand what the number represents.
Ignoring inflation, I only need to spend $10,000 from the portfolio to make the $60,000 target.
So, numbers in the $55,000 to $60,000 range make no sense if it's total spending amount. I can't imagine I would ever have to drop down below the target $60,000 spending target given this scenario.
If the amount instead refers to how much I would be pulling from the portfolio to reach my spending target, again, numbers in the $55,000 to $60,000 range make no sense.
I can't figure out any other likely meanings for this number.
Is this a defect or am I just clueless?
Thanks!
cFIREsim legacy had an option to investigate what the maximum initial starting spending value would be given a user inputted minimum success rate. The simulation would vary the initial spending and track the success rate until it came up with a maximum number.
We must recreate this feature.
When the 'Equities' field in the target section is updated, the 'Gold' field is set to the same value. The same problem exists for the 'Bonds' and 'Cash' field.
I made a design decision to show the Yearly Spending graph no matter what the spending method chosen. In doing so, I found that the default values (Inflation Adjusted Spending, 40k spending) give a graph that is not exactly $40k/yr. It appears to fluctuate up/down by $0.01. This is likely due to a rounding issue.
Clicking on the logout button appears to do nothing.
Adding a pension and selecting "false" for inflation adjusted, seems to break the simulation in a few different ways. The graph shows a big discontinuity and the stats are zero in a lot of places.
Check to see if this also occurs with Savings/Spending that are not inflation adjusted.
While investigating different scenarios, I'll often run a single scenario, and tweak the inputs to see how it affects the result. After running 10 of these test scenarios, no new results are produced, and I have to close down the browser tab to reset the results. Allowing the user to right-click on a results tab and close that tab would be helpful.
Ideally, this would be done by using a copy of the current input.php, and adding step-by-step popup jquery tooltips to show how to walk through a scenario. For instance, you load a popup modal that states the following scenario "A couple is 40, and is aiming for 10 more years of savings. They save $10,000/yr in a 401k, and $11,000 in an IRA. Their expected SS is $____. Their spending is $_____." Each step of the way, it will show the user what to enter and where.
This should be modelled for several scenarios that all end up using the different things cFIREsim has to offer. ie: A scenario where someone is paying for kids college down the road, a scenario where someone lowers expenses half-way through the sim, a scenario where they use variable spending, etc.
The angular UI does not have any form validation rules. Rules for all inputs should be created.
User should have the option to delete or rename already saved simulations.
In https://github.com/boknows/cFIREsim-open/blob/master/js/marketData.js
2015 Market Data is a copy of 2014. At least CPI is wrong, probably all of it. You can check at this website with a stupid url: http://www.usinflationcalculator.com/inflation/consumer-price-index-and-annual-percent-changes-from-1913-to-2008/
Legacy cFIREsim had an "Investigate" option that showed the success rates when different "Fees/Drag" was applied. We must recreate this option in the "Data Options" section.
I get redirected to http://www.cfiresim.com/phpBB3/login.php and the password I used to use no longer works. I can't get a recovery email sent, it says no account is found with the account I used to use.
Forum appears to be hacked - all of the boards are locked except one, and the top thread in the only unlocked forum is porn.
Saved sims all have a name associated with them. These names should either be the output tab text itself, or be displayed somehow at the top of an output tab.
Portfolio.start should actually be the value: portfolio = portfolio - this.sim[i][j].spending + sumOfAdjustments;
This is in calcMarketGains(). After that line it should read:
this.sim[i][j].portfolio.start = portfolio;
Problem: Clicking Run simulation multiple times causes "download csv" to append to the last "download csv" which looks like this "download CSVdownload CSVdownload CSVdownload CSVdownload CSV"
http://i.imgur.com/tw7nvgV.png
Expected behavior: The "download csv" to be replaced by the newest, or to append on with a new line.
Add a call to getSavedQueries after submitting a new saved sim
In the legacy cfiresim, a given simulation would be able to be shared by providing a link such as http://www.cfiresim.com/input.php?id=12345.
We need to recreate the ability to load a simulation via the $_GET['id'] variable. This will also include showing the ID of the simulation in the load screen.
User submitted a scenario in which they had a 50/50 stock/bond portfolio of $2.5M, with $70k/yr spending, and a period from 2015-2070. This resulted in a maximum portfolio of over $1.5B (compared to a maximum of $30M in legacy cFIREsim).
Double check the bond calculation, how inflation is added, and other possible variables... specifically with that 1 errant $1.5B cycle.
In the legacy cFIREsim, each new simulation opened a new browser tab and that tab had a short summary of that simulation (G-K Spending, $1,000,000 Port / $40k Spend) etc.
In cFIREsim-open, the output is opened inside of a modal popup, which has a Twitter Bootstrap tab attached. We must add some identifying information for each simulation at the top of each output tab, and/or as a mouseover on the tab itself. This will provide better recognition and allow people to compare simulations easier.
This more accurately represents the field, as it can be used as either.
When running multiple simulations, the download CSV link keeps replicating itself and doesn't delete the old one.
If there is a defined spending floor present, some of the VPW cycles will run past $0 in portfolio. VPW, by definition, tries to hit $0 exactly.
Hi,
I believe there is a piece missing from the Guyton Klinger simulations. I don't know if this is related, but in the legacy cFIREsim it was labeled "Guyton-Klinger Method (simplified)". I suspect that the current cFIREsim is still using a simplified version.
So... I think this may be two issues really.
I would be happy to work on (2). I don't know how quickly it will happen, particularly since I think the reason it hasn't happened yet is that the code isn't factored to accommodate this kind of thing.
Regards,
M
Many of the statistics are already being calculated, but there is currently no visual representation for them. This should be a table that is somewhat like the one in the legacy output page.
Work on the logic for SumOfAdjustments. If pensions/SS/extra-income for a given year is greater than the required spending, nothing should actually be "taken out" of the portfolio. This logic should reflect that.
cFIREsim legacy logic: Add/remove SumOfAdjustments from portfolio before calculating market gains.
cFIREsim open current logic: Add/remove SumOfAdjustments after market gains.
Within the standard iteration framework, add the capability to process a "Extra Savings" object into the mix, and still calculate the output.
Test case: Default values for all. Select CAPE spending. Change CAPE modifier to 0.6. Set Defined Spending Floor of $35000.
You'll see that in the first 5 years of a few simulation cycles that the spending gets below $35000. I think it's only happening in the data used in the 1800s, which indicates that there is an issue when the CAPE data is missing (those first 10 years?).
Many of the stats, if not all, are based on all of the years of a simulation and probably should only include years in retirement. For example, if you choose 2020 as a retirement date, the Withdrawal Analysis table will show that you spent $0 on average in the "First 5 years" section. True, you spent $0 in the first 5 years of the simulation... but not the first 5 years of retirement.
Also, the Spending graph represents spending during all of the simulation, and not just retirement. So, for future retirement dates, it shows a long period of $0 spending before shooting up to the normal spending level. I think that we should probably leave it like that, but it's worth mentioning in the same vein as this bug.
I'm running Windows 10 and using Microsoft Edge. The graphs on the simulation are just white boxes and there's nothing under Statistics.
In the legacy cFIREsim, every new simulation creates a new browser tab. This allows for easy comparison between multiple similar simulations. With the new javascript code, I believe that it is inconveinient to open a new tab and pass along the data, which is why I opted for a pop-up window. However, this makes it hard to compare simulations, because you can't easily open multiple simulations at once.
We either need to implement some psuedo-tabs in the output pop-up, or re-implement the legacy version by sending the data to a new tab.
Reading the "Generalized PMT Withdrawal Method" thread on the cFIREsim forums should be taken into account. I think a "classic VPW" and a generalized method would be worth exploring.
Legacy cFIREsim had an "Investigate" option that explored the success rates of varying equities/bonds allocations in 5% increments. We must recreate this option in the "Data Options" section.
This should be slightly more robust than the legacy cFIREsim. We should be able to allow users to vary the amount of iterations. If we have a more math-oriented programmer out there, we could start adding in other types of distributions, rather than just the normal distribution.
I can provide the legacy code for this, to anyone willing to take up the task. (It isn't currently public).
I'm not entirely sure that this is just a validation problem. Obviously, if the data start/end dates are within a span of less years than the requested simulation (ie you give a span from 1960-1970 which is only 10 years, but you want a simultion from 2015-2040 which is 25 years) you'll get an error.
I would expect that if you used the default values, and simply changed the Data Options - Specific Years to Start Year: 1940, End Year: 1970, that it would work. However, this gives a blank output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.