You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been getting this error on many different series. I've tried various versions of Ruby 1.9 and 2.0. 1.9 tends to hang whereas 2.0 errors out fairly quickly. I've tried these same calculations in both Excel and the Java Apache POI library and they return good values. Any ideas?
Some examples:
[-1,-2,0,5].irr.to_f
=> 0.24189656303203824
[-1,-3,0,5].irr.to_f
RuntimeError: Failed to reduce function values (newton.rb:66 in nlsolve)
[-13000,-3000,-3000,0,0,5000,10000,20000].irr.to_f
RuntimeError: Singular Jacobian matrix. No change at x[0](jacobian.rb:58 in dfdxi)
The text was updated successfully, but these errors were encountered:
Yes. I can try to work on a better implementation. My solution is to guess an IRR and add this guess to the XIRR method.
Today the XIRR method takes 1.0 as the initial guess which can leads to error like these.
What do you think about it?
I've been getting this error on many different series. I've tried various versions of Ruby 1.9 and 2.0. 1.9 tends to hang whereas 2.0 errors out fairly quickly. I've tried these same calculations in both Excel and the Java Apache POI library and they return good values. Any ideas?
Some examples:
[-1,-2,0,5].irr.to_f
=> 0.24189656303203824
[-1,-3,0,5].irr.to_f
RuntimeError: Failed to reduce function values (newton.rb:66 in nlsolve)
[-13000,-3000,-3000,0,0,5000,10000,20000].irr.to_f
RuntimeError: Singular Jacobian matrix. No change at x[0](jacobian.rb:58 in dfdxi)
The text was updated successfully, but these errors were encountered: