Closed Smit-create closed 2 years ago
I modified the code slightly ( fixed some minor bugs) to make it jit compile and got the following results:
@jstac Does this look good now?
Thanks @Smit-create , please see my comments above.
Thanks @Smit-create . I wonder if we should modify cartesian
to be jit-aware --- otherwise we will need to repeat your product
function in quite a few files for this project. It's just a suggestion and I'm open to other ideas.
Regarding the figures, I notice that the font size for "in the money" and "out of the money" is too large in the Python code (please see above).
Finally, for successive approximation, perhaps we should use https://quanteconpy.readthedocs.io/en/latest/tools/compute_fp.html
Finally, for successive approximation, perhaps we should use https://quanteconpy.readthedocs.io/en/latest/tools/compute_fp.html
I was trying to avoid using direct library functions so that if anyone tries to compare python and Julia code, it would be easy to relate the things easily.
Fixed the plot
I wonder if we should modify
cartesian
to be jit-aware
We can try to make that change in the quantecon
itself? I mean we can try to make the functions/classes jit-aware as much as we can?
Thanks, @jstac. I have addressed your comments. If we replace successive_approx
with compute_fp
then we will need to do that in all the previous code to maintain uniformity and that will make it differ slightly from Julia code. Should I change that? Or keep the current version?
Thanks for the fixes @Smit-create
If we replace successive_approx with compute_fp then we will need to do that in all the previous code to maintain uniformity and that will make it differ slightly from Julia code. Should I change that? Or keep the current version?
I hadn't thought about this carefully enough. How about this policy: we don't worry about matching Python and Julia code, as long as we reproduce the figures.
As a general rule, let's write the Python code as efficiently as possible, and with minimal repetition.
Following this rule, let's use compute_fp
here. But there's no need to go back and change the earlier ones --- it might be good for people who are starting out to see all the details.
As a general rule, let's write the Python code as efficiently as possible, with minimal repetition.
Thanks, @jstac. I just replaced the product
and instead used loops with prange
and also used compute_fp
from quantecon
. This works very fast now.
Very nice work @Smit-create . I'll merge this now.
Results from firm exit: