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