-
Notifications
You must be signed in to change notification settings - Fork 53
Fixed-Point Pass #134
Comments
Same goes for lectures that use the |
Where possible, we want to use out-of-place functions instead of inplace. They are usually faster, and much less errorprone for new users (i.e. forgetting the I will add it to style guide. |
I found that for roots, using Roots.jl was the best solution,
For optimization in an interval (using Optim.jl),
Not sure we want to go with |
The function I've had a few comments from users that they would rather see this logic --- that is, the logic of value function iteration --- written out explicitly. I agree with them. The lectures are, after all, intended to teach. So on the Python side, every time we iterate with a Bellman operator, we're going to write an explicit loop that looks like the while loop in input cell [8] of http://notes.quantecon.org/submission/5bae5cb538674f000fd2c8e3 |
As for other fixed point code as it currently stands, the naive "Picard" type of fixed point iteration used in many of these lectures is just one of many fixed point algorithms - and in general not the one you would start with. Anderson iteration, Newton iteration, etc. are often much better. For teaching people, I think we need to show them how the fixed point iteration can be written (as it now is in the intro lectures) but they should rarely do it by hand after that. Maybe the first time we show a dynamic programming problem we could show them the equivalent hardcoded code with picard iteration built-in. But for other places that have fixed point iterations:
Python is very different because it can't compose packages very well, so anyone writing python code will probably have to put the full logic in themselves (or else numba wouldn't work) |
@XiaojunGuan, can you make a note here of any issues you were having using the NLsolve |
@arnavs Okay, so I tried with |
@XiaojunGuan do you need help on the |
@Nosferican Yes, I would appreciate some help on that. When using |
Where are we on this one? Is there a checklist of which files still need the fixed-point pass? If not, we should create one. |
These are the three remaining ones that still need to replace
For these three files I have had the same problems as in According to @arnavs, there are also places that compute fixed point manually, which may also need a pass? |
We can wait to covert the other places that have manual fixed points |
@Nosferican is rewriting the |
Likewise as #135 |
Wherever possible, replace homebrewed fixed-point iteration with the
fixedpoint()
routine fromNLsolve.jl
. Need to make sure the math checks out. This could cause tests of exact equality to fail; will need to be updated.The text was updated successfully, but these errors were encountered: