IRR

  • Thread starter Thread starter Wei
  • Start date Start date
W

Wei

I have 30 numbers, some are positive and some are
negative. I want to calculate something called "becker's
IRR" on the 30 numbers. This is what exactly what I mean
by "becker's IRR": if a number is negative, I look at the
numbers immediately before it, until I find a positive
number.

Example: I have numbers: 10, 20, -9, -25, 44, 99. Now -9
and -25 are negative, so I discount them back to the
positive number before them, which is 20, using a constant
IRR rate of 0.05. And I get: 20+ (-9)/1.05 + (-2)/1.05^2 =
9.6. Now I form a new set of numbers: 10, 9.6, 0, 0, 44,
99. Since all the numbers in the sequence are positive.
I'm done. Essentially, I want to get a sequence of non-
negative numbers.

Please help.

Wei
 
Hi Wei

If you have an algorithm (a logical, unambiguous series of steps to achieve
your result) then you can write code to do the job.

I suggest you start with a function that takes the IRR rate and an array of
values as arguments, and returns the array of modified values.

However, you have not given nearly enough information to specify an
algorithm, and they example you gave does not seem to make sense. In the
following expression:
20+ (-9)/1.05 + (-2)/1.05^2
where does the (-2) come from? And why is the rate squared in the second
term?

Also, what should happen if the expression gives a negative result? Or if
the first number in the series is negative?

There are many questions to be answered.
 
Back
Top