XIRR of p2p loan book for R

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

XIRR of p2p loan book for R

Hi guys,

I've been trying to compute monthly cash flow, then calculate XIRR for each individual loan of more than 2 millions loan (p2p loan book). Excel can not handle such huge data set so it's crashed many times even though I split it into several files. I ran into some R solutions for XIRR, but they only take into account of date vector and amount of given cash flow vector.

For the cash flows in excel, they are computed as following:

I defined the issue dates, last payment dates, loan term (30 months & 60 months), lent amount, installment amount (monthly). I counted from the issue date to the last payment date (number of month) for each loan, this result is seen as "payment frequency" of the respective loan. On the other side of the sheet, I have 60 payment dates represent 60 cash flow vectors. If the number of month from the issue date is smaller or equal the number of "payment frequency", then it gives the value of monthly installment, otherwise gives 0 (because the loan is default). As a result, I'm facing the challenge of turning these arguments into R language.

Could any one please help me out?

I really appreciate your help guys. Many thanks!!!!!!!!!