3

I have an array consisting in payments on a bank account, sorted per day. I would like to extract recurring payments, such as salaries, for instance.

An example is given in the linked data file. The monthly salary (e.g. 3139.75 in this example) is being paid every month between the 25th and 31st. Other payments are being spread randomly.

My idea was to perform an FFT and have both the amount and frequency of the monthly salary, but it looks like taking the FFT of a pseudo comb function will not give me this answer straight away.

Any idea?

  • Do you need more information than what this would give you: `np.unique(transactions,return_index=True,return_counts=True)`? – WhoIsJack Jul 20 '17 at 13:18
  • Your data file seems to have only one row per date? Does this mean all transactions on that day are lumped into one row? – Ahmed Fasih Jul 20 '17 at 20:37
  • @WhoIsJack thanks for the tip, it could help indeed, but it still wouldn't let me identify this easily in case of slight changes in the monthly salary, whereas an fft would, I think. – Bertrand Delvaux Jul 21 '17 at 07:08
  • @AhmedFasih for clarity purpose, I created the data so that there is maximum one transaction a day. The real data, however, are made up of potentially more than one transaction a day, hence a greater granularity. There would be one row such as the file per customer, and I would like to extract the recurring incomes and expenses, e.g. "Customer x receives 1570 monthly, 3680 yearly and spends 650 monthly and 200 fortnightly." – Bertrand Delvaux Jul 21 '17 at 07:13
  • Thanks for the clarification, yes, that changes things a lot. The FFT is probably *not* going to be as helpful as you hope—it’s great for finding periodicities in neatly-sampled data, but in this problem, multiple “data” (payments) come at the same “time sample” (date), and an attempt to use FFT (or [periodogram](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.periodogram.html) or any of the spectral estimators) is going to run into combinatorial problems as you try to see whether this one payment is part of a recurrence or is a one-off occurrence. A great question though. – Ahmed Fasih Jul 21 '17 at 14:11
  • You *could* try to collapse all transactions on a single day into a single sample by summing them, and using e.g. the periodogram which they use to detect periodicities in sunspot, or wildlife population, data. It will detect the large recurring transactions, but probably miss the small ones. I feel there has to be a totally different approach but I can’t think of quite what that would be :-/ – Ahmed Fasih Jul 21 '17 at 14:13

0 Answers0