PHP Classes

Issue with XIRR() method

Recommend this page to a friend!

      Financial  >  All threads  >  Issue with XIRR() method  >  (Un) Subscribe thread alerts  
Subject:Issue with XIRR() method
Summary:Issue with XIRR() method
Messages:1
Author:Sagarr Singah
Date:2016-02-01 05:06:53
 

  1. Issue with XIRR() method   Reply   Report abuse  
Picture of Sagarr Singah Sagarr Singah - 2016-02-01 05:06:53
Hi Enrique,

Great job!!

XIRR() method is not giving correct result in all of the cases. Like for most cases of wrong results its returning value of -1.5714. For example:

$value=array(0 => -50000,1 => -50000,2 => 5000,3 => 50000,4 => 25000,5 => -25000);
$date=array(0 => strtotime('2015-01-01')
,1 => strtotime('2015-02-02')
,2 => strtotime('2015-03-03')
,3 => strtotime('2015-04-04')
,4 => strtotime('2015-05-05')
,5 => strtotime('2015-05-05')
);
echo $data = $f->XIRR($value, $date, 0.1);
value comes: -1.5714


$value=array(0 => -50000,1 => -50000,2 => 5000,3 => 70000);
$date=array(0 => strtotime('2015-01-01')
,1 => strtotime('2015-02-02')
,2 => strtotime('2015-03-03')
,3 => strtotime('2015-03-31')
);
echo $data = $f->XIRR($value, $date, 0.1);
value comes -1.5714


$value=array(0 => -179099965,1 => -520896230,2 => 699996195);
$date=array(0 => strtotime('2014-12-16')
,1 => strtotime('2014-12-16')
,2 => strtotime('2015-09-30')
);
echo $data = $f->XIRR($value, $date, 0.1);
value comes : -3.8146, which is also incorrect.


Can you please look into this matter on priority.
Thanks in advance.

Sagarr