lib/effective_interest_rate/relative_payment_stream.rb
# Returns the derivative of the net present value function of the
# payment stream as an anonymous function
# @return [Proc] the derivative of the net present value function
Returns the derivative of the net present value function of the
payment stream as an anonymous function
Returns the derivative of the net present value function of the payment stream as an anonymous function
def net_present_value_derivative
    lambda do |x|
      relative_payments.reduce(0) do |sum, relative_payment|
        sum + relative_payment.amount * -relative_payment.offset * (1 + x)**(-relative_payment.offset - 1)
      end
    end
  end
def net_present_value_derivative lambda do | x | relative_payments . reduce ( 0 ) do | sum , relative_payment | sum + relative_payment . amount * - relative_payment . offset * ( 1 + x ) ** ( - relative_payment . offset - 1 ) end end end
Returns the derivative of the net present value function of the
payment stream as an anonymous function
Returns the derivative of the net present value function of the payment stream as an anonymous function
the derivative of the net present value function
the derivative of the net present value function
Proc