4 ms·
Yes, in fact GPUs are perfect for this. Here is a Monte Carlo financial simulation I built in WebGL 2. https://james.darpinian.com/money/ https://james.darpinia
by modeless 5y ago
Yes, in fact GPUs are perfect for this. Here is a Monte Carlo financial simulation I built in WebGL 2. https://james.darpinian.com/money/ https://james.darpinian.com/money/ (Warning, programmer UI) It performs one million Monte Carlo runs instantly every time you move a slider. Each run is one execution of a pixel shader and they all happen in parallel.
WebGPU will make this kind of thing more accessible. It's kind of a pain to do it in WebGL, but even so it's still totally possible and worthwhile because you can easily get 20 times the performance in many cases and handily beat native CPU code even on the web.
- neogodless 5y agoHmm the UI is super unresponsive for me. As in, I try to move a slider, I can't tell where it's moving to... then I let go and it's somewhere I didn't expect. Latest Firefox, Windows 10, Radeon RX 6700XT 16GB.
- modeless 5y agoDo other WebGL 2 demos work well for you? Does it work in Chromium? I haven't tested the code extensively so I'm sure it's broken in some configurations. It's just a proof of concept demo for now.
- neogodless 5y agoAh sorry - disregard. I had a background process gobbling up GPU, and now I can use it in Firefox or Edge. I do find it confusing, as I can put in numbers that get me well below a 3% withdrawal rate, but still have only 40% success rate. But I'm probably misunderstanding some of the mortgage sliders.
- modeless 5y agoYeah, it's confusing for sure. One day hopefully I'll have time to put a real UI on it. Right now it's assuming you buy a house with a mortgage (and property tax and yearly maintenance costs) at the same time as you retire. Put the house price to zero to eliminate all that. Also the expenses slider is before tax, so the tax rate slider influences how large your withdrawals actually are. The total withdrawal per year is displayed near the bottom.
- emi2k01 5y agoI'm on Windows 11 with a Radeon RX570 8gb and it runs fine under Edge. On Firefox it's way laggier but still usable.