Tax deductions are not free money

So you deducted your loan interest in your taxes. That means the interest was essentially free right? I could not quite figure out the answer to this question in my head recently, so I thought I would do a simple example and share it here, in case it could be useful for someone else.

First, the conclusion: Just because an expense is deductible does not make it free. It would have been better to not have the expense in the first place. However, if you cannot avoid the expense, then deductibles are of course great!

Let’s say we pay $10 interest on a loan, our income is $100 and we pay 50% tax. The table below shows the scenario where our interest is not deductible, compared to the scenario where our interest is 100% deductible1.

DescriptionAmount w/o deductible Amount w/ deductible
Income$100$100
Taxable income$100$90
Tax-$50-$45
Net income$50$55
Interest-$10-$10
Final income$40$45

In case we can deduct all of the interest, we would have $5 extra disposable income. Thus, about half of the interest in this example were “free” ($5). However, If we did not have to pay interest at all, we would of course have $50 in final income.

In other words, if we can completely avoid an expense, even if it is tax deductible, that is always the best financial outcome. In practice, this is not always possible, but I think it is a good principle to keep in mind.

Reinforcement learning

I have been looking into a machine learning technique called reinforcement learning (RL) lately. This was on my TODO for a while, and I must say, this field is incredibly exciting! I played around with some OpenAI Gym environments and re-implemented two RL algorithms mostly based on code I found from other authors.

After spending many hours on this, I can still only get my algorithm to solve the Cartpole problem, where the goal is to balance a pole on a moving cart (video below). I haven’t cracked the nut on a continuous action problem like Pendulum, where the goal is to swing the pendulum into an upright position and keep it there (video below).

Anyway, here is my implementation of the RL algorithms. Perhaps it will be useful for someone :-)

A bank transaction analysis tool for the browser

Screenshot from Off The Books showing most common expenses in 2018

This graph shows my four most common expense categories during 2018 and how they changed from month to month. It is a screenshot from one of the charts in OTB, a bank transaction analysis tool that I have been working on for a while.

OTB was created to fulfill my need for seeing what expense categories I spend my money on. Although a lot of apps can do this, I had some special use cases that were not quite being solved by existing solutions. On top of that, it concerned me a bit to hand over my bank transactions to a 3rd party, even though some financial apps are regulated and have good security.

Privacy might actually be the main feature of OTB at this point. All the data (transactions, categories, etc.) are kept in the browser only, instead of storing the data in the cloud. It is thus impossible for the data to leak, unless the browser itself is compromised.

I have been using OTB regularly for a few months now. I have added and categorized 3840 bank transactions from two different banks in two different currencies (DKK/SEK), stretching back 3-6 years. A simple machine learning algorithm helps select categories, and when I add new transactions (which I do once or twice per month), I usually have to categorize 3-7 transactions by hand, and the rest (anywhere between 20 and 100 transactions) are correctly guessed by the algorithm, because my purchasing patterns are quite regular from month to month.

To be honest, the app is a bit messy, and not at all user-friendly, but I am happy with the outcome of the project so far, since it has actually started to become useful to me. For example, the chart at the beginning of this post shows, among other things, that I spent more on eating out in February and June than I spent on groceries. This is the kind of insight I was hoping to get from the app when I started working on it, and there is a lot of room for improvement.

I could go into a lot more detail about why I created OTB, what the limitations and trade-offs were in the design, and what I plan hope to do next, but I will save this for another time :-)

For now, feel free to check out OTB or take a look at the source code.