QuantEcon.jl icon indicating copy to clipboard operation
QuantEcon.jl copied to clipboard

Add inv and derivativeinv to some utility functions

Open cc7768 opened this issue 6 years ago • 2 comments

Adds methods for u^{-1} and du^{-1} for utility functions where it can be computed by hand.

I have some tests that make sure u(u^{-1}) returns what we expect (also have them for du(du^{-1})), but it wouldn't hurt to have someone glance at the equations to make sure I didn't do anything stupid.

cc7768 avatar Oct 16 '18 16:10 cc7768

Codecov Report

Merging #225 into master will increase coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
+ Coverage   95.85%   95.89%   +0.04%     
==========================================
  Files          25       25              
  Lines        1061     1073      +12     
==========================================
+ Hits         1017     1029      +12     
  Misses         44       44
Impacted Files Coverage Δ
src/modeltools/utility.jl 95.83% <100%> (+1.38%) :arrow_up:
src/kalman.jl 100% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a8937f8...397f57c. Read the comment docs.

codecov-io avatar Oct 16 '18 16:10 codecov-io

General comment -- I think we should consider edge cases in both the implementation and the testing.

For example, what happens at derivativeinv(u::CRRAUtility, x) at x=0?

sglyon avatar Oct 16 '18 20:10 sglyon