# Duration calculation with negative cashflows

I have a pool of (mortgage) assets that pay cashflows as below. How could I correctly calculate the duration? Does it have a meaning in the sense of a vanilla/callable bond as the measure of price sensitivity?

Year CF

0 1

1 25

2 25

3 0

4 0

5 -5

6 0

7 -5

8 5

That is because the npv of the cashflows is: $NPV = \sum_i [ c_i * \exp(- y_i * t_i ) ]$
With $c_i$ the fixed cashflow amount at time $t_i$.
$d(NPV)/dy = - \sum[ c_i * t_i * \exp(- y_i * t_i ) ]$
If you divide that by the NPV, you get the definition of the duration. You see the formulas are valid regardless of the sign or amount of the $c_i$.