In this post, I describe my thought process in designing a simple relational database to store historical OHLCV for equities, including why I chose MariaDB and code for populating the database.

Read more...
In this post, I present my opinion to a question I frequently get asked: how do I get started with machine learning?

Read more...
Decision trees make for pretty vanilla classifiers: they do an unspectacular job with most machine learning tasks, and you’d be forgiven for overlooking them when deciding on a classification algorithm. But decision trees happen to be the cornerstone of a powerful class of learning algorithms: gradient tree boosting methods. I will try to elucidate the (short) history of gradient tree boosting, starting with the pioneering implementation of boosted trees and ending with the state-of-the-art. I’m afraid there will be a hearty amount of mathematics, but it is really a very intuitive topic at its core.

Read more...
You may have heard a mathematician or physicist (or more likely your maths teacher) describe mathematics as beautiful. What could they mean by this? There is just something mysteriously attractive about the purity, complexity, interconnectedness, and underlying truth of it all (“Beauty is truth, truth beauty” - Keats).

Read more...
Yahoo Finance has long been an excellent free financial resource with a wealth of data and a convenient API, allowing open source programming libraries to access stock data. But not any more. As of May 2017, they have discontinued their API, probably as a result of Yahoo’s pending acquisition by Verizon. This means that excellent tools like pandas-datareader are now broken, much to the dismay of many amateur algorithmic traders or analysts. It turns out that there is a rather hackish workaround which allows us to download the data as CSV (i.e spreadsheet) files, which of course can then be read into excel, pandas dataframes etc.

Read more...
25 Jul 2017 ·
7 min read
[
physics
]
I have been slowly working through David Griffith’s widely-used textbook, Introduction to Electrodynamics. It is known for having a large number of reasonably difficult exercises, which are instrumental in conveying some concepts not directly addressed in the main text. I found an elegant shortcut to one of the questions, which was not noted in the solution manual. The shortcut involves (ab)using a very versatile, if slightly overlooked theorem in calculus – the Leibniz integral rule. I will briefly discuss this, before working through the problem.

Read more...
21 Jul 2017 ·
5 min read
[
maths
]
We now pick up where we left off and fully elucidate the link between the factorial and the gamma function.

Read more...
16 Jul 2017 ·
7 min read
[
maths
]
In Part 1, we showed that repeated differentiation gives rise to a factorial. In this second post of Intuiting the gamma function, we are going to show that integration by parts can also produce a factorial – an instrumental step in generalising the idea of a factorial to non-integers.

Read more...
11 Jul 2017 ·
6 min read
[
maths
]
What is the factorial of a half? This series of posts builds up from middle-school algebra to the enigmatic gamma function in an attempt to answer this simple question.

Read more...
a python approach to XKCD’s Social Seating problem

Read more...