[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Question about XIRR in financial.cpp
From:       "Alvaro Soliverez" <asoliverez () gmail ! com>
Date:       2008-07-18 14:14:34
Message-ID: 64e15f8f0807180714n33fecc93ib55a503d41a23ed8 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello Stefan,
thanks a lot for the prompt answer.
After some more debugging, I found a bug in our method that triggers an
infinite loop. The XIRR method in koffice has a way to prevent this. And
given that it is according to the OpenFormula spec, I think it would be
better to use that one.

I will adapt the function work in KMyMoney.  It is not possible to just link
to it, because there are major difference in data structures.

Since KMyMoney is GPL v2 or later, and the file here (
http://api.kde.org/koffice-api/koffice-apidocs/kspread/html/financial_8cpp-source.html#l02034)
is GPLv2 only, I will create a separate class with only the methods I need
and copy the corresponding copyright notice.
Is this ok with you? I see that you are one of the copyright holders in the
file.

Thanks again.

Regards,
Alvaro

On Fri, Jul 18, 2008 at 6:02 AM, Stefan Nikolaus <
stefan.nikolaus@kdemail.net> wrote:

>  On Thursday 17 July 2008 22:23:41 Alvaro Soliverez wrote:
>
> > Hello all,
>
> > I'm a developer of KMyMoney. I work mostly on reports and forecast for
> that
>
> > application.
>
> > Lately we have found some issues in the way we calculate IRR (internal
> rate
>
> > of return) when reports are over a couple of years.
>
> >
>
> > Looking for some info, I found the method func_xirr in financial.cpp,
> which
>
> > is used by KSpread and it looks very similar to the one we use.
>
> >
>
> > My question is, does it work fine when the series of cashflows are spread
>
> > over several years?
>
> > We found the issue when a user tried an IRR report on a series spread
> over
>
> > 10 years.
>
> >
>
> > Is that method even intended to provide results over several years? I
>
> > noticed the 365, which might lead to odd calculation when dates are over
> a
>
> > year.
>
> There are some tests for the functions in koffice/kspread/tests, for XIRR
> they are in TestFinancialFunctions.cpp. One of the tests spans over several
> years and is taken from the OpenFormula spec. As this test passes, XIRR
> seems to work okay.
>
> It would be great, if you can add the case the user had to the tests.
>
> --
>
> Stefan Nikolaus
>
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel
>
>

[Attachment #5 (text/html)]

<div dir="ltr">Hello Stefan,<br>thanks a lot for the prompt answer.<br>After some \
more debugging, I found a bug in our method that triggers an infinite loop. The XIRR \
method in koffice has a way to prevent this. And given that it is according to the \
OpenFormula spec, I think it would be better to use that one.<br> <br>I will adapt \
the function work in KMyMoney.&nbsp; It is not possible to just link to it, because \
there are major difference in data structures. <br><br>Since KMyMoney is GPL v2 or \
later, and the file here (<a \
href="http://api.kde.org/koffice-api/koffice-apidocs/kspread/html/financial_8cpp-sourc \
e.html#l02034">http://api.kde.org/koffice-api/koffice-apidocs/kspread/html/financial_8cpp-source.html#l02034</a>) \
is GPLv2 only, I will create a separate class with only the methods I need and copy \
the corresponding copyright notice.<br> Is this ok with you? I see that you are one \
of the copyright holders in the file.<br><br>Thanks \
again.<br><br>Regards,<br>Alvaro<br><br><div class="gmail_quote">On Fri, Jul 18, 2008 \
at 6:02 AM, Stefan Nikolaus &lt;<a \
href="mailto:stefan.nikolaus@kdemail.net">stefan.nikolaus@kdemail.net</a>&gt; \
wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style="font-size: \
9pt; font-weight: 400; font-style: normal;"><div><div></div><div class="Wj3C7c"> <p \
style="margin: 0px; text-indent: 0px;">On Thursday 17 July 2008 22:23:41 Alvaro \
Soliverez wrote:</p> <p style="margin: 0px; text-indent: 0px;">&gt; Hello all,</p>
<p style="margin: 0px; text-indent: 0px;">&gt; I&#39;m a developer of KMyMoney. I \
work mostly on reports and forecast for that</p> <p style="margin: 0px; text-indent: \
0px;">&gt; application.</p> <p style="margin: 0px; text-indent: 0px;">&gt; Lately we \
have found some issues in the way we calculate IRR (internal rate</p> <p \
style="margin: 0px; text-indent: 0px;">&gt; of return) when reports are over a couple \
of years.</p> <p style="margin: 0px; text-indent: 0px;">&gt;</p>
<p style="margin: 0px; text-indent: 0px;">&gt; Looking for some info, I found the \
method func_xirr in financial.cpp, which</p> <p style="margin: 0px; text-indent: \
0px;">&gt; is used by KSpread and it looks very similar to the one we use.</p> <p \
style="margin: 0px; text-indent: 0px;">&gt;</p> <p style="margin: 0px; text-indent: \
0px;">&gt; My question is, does it work fine when the series of cashflows are \
spread</p> <p style="margin: 0px; text-indent: 0px;">&gt; over several years?</p>
<p style="margin: 0px; text-indent: 0px;">&gt; We found the issue when a user tried \
an IRR report on a series spread over</p> <p style="margin: 0px; text-indent: \
0px;">&gt; 10 years.</p> <p style="margin: 0px; text-indent: 0px;">&gt;</p>
<p style="margin: 0px; text-indent: 0px;">&gt; Is that method even intended to \
provide results over several years? I</p> <p style="margin: 0px; text-indent: \
0px;">&gt; noticed the 365, which might lead to odd calculation when dates are over \
a</p> <p style="margin: 0px; text-indent: 0px;">&gt; year.</p>
<p style="margin: 0px; text-indent: 0px;"></p>
</div></div><p style="margin: 0px; text-indent: 0px;">There are some tests for the \
functions in koffice/kspread/tests, for XIRR they are in TestFinancialFunctions.cpp. \
One of the tests spans over several years and is taken from the OpenFormula spec. As \
this test passes, XIRR seems to work okay.</p>

<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">It would be great, if you can add the case \
the user had to the tests.</p> <p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">-- </p>
<p style="margin: 0px; text-indent: 0px;">Stefan \
Nikolaus</p></div><br>_______________________________________________<br> \
koffice-devel mailing list<br> <a \
href="mailto:koffice-devel@kde.org">koffice-devel@kde.org</a><br> <a \
href="https://mail.kde.org/mailman/listinfo/koffice-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/koffice-devel</a><br> \
<br></blockquote></div><br></div>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic