Posts

Framework for capital allocation In this resource starved world, capital is scarce. Every dollar that you own has its place and deserves to be allocated properly. Currently, I already have a huge chunk of capital tied up in a diversified portfolio levered up to 1.4 times. Portfolio has (& expected to) outperformed/ matched up to market returns with 2 to 3 times lower risk - in terms of standard deviation and drawdown.

CONTINUE READING

Volatility targeting Currently, I’ve a suite of toolkits integrated into my Jarvis that advises me on the investing decisions that I’ve to make on a daily basis. On the latest feature I cobbled together on a Saturday evening, 2 weeks ago, I’ve decided to measure the volatility of my portfolio formally. Why I’m doing this is because managing risks in the form of volatility is easier than targeting returns.

CONTINUE READING

Mapreduce using java I haven’t coded in java in eons. The assignment (Mapreduce, Pig and Spark) I worked on over last 3 weeks is a good way to jolt me out from my comfort zone. Java is something I need to brush up on before taking the Software Development Process module which requires me to write an android app. Argh! Back to Mapreduce. It’s a useful framework if you’ve to summarise huge datasets (gigabytes, terabytes).

CONTINUE READING

Regime detection through hidden markov model It’s rumoured that in the early days of Renaissance Technologies - according to the book ‘The Man Who Solved the Market’ - hidden markov models are used for regime detection. Here I am, a couple of decades later - employing this strategy. This will be integrated into my ‘Jarvis’ - a series of Algorithmic toolkits that advises me in all situations. Hidden markov mode is a statistical unsupervised learning model used to model states.

CONTINUE READING

Embedding D3 interactive charts Part 2 - Testing reading in of file from directory Just having fun - testing to see if I could embed D3 charts in my blog. Seems like it works too! But I would have to upload the csv under public folder first. // set the dimensions and margins of the graph var margin = {top: 10, right: 30, bottom: 30, left: 60}, width = 460 - margin.

CONTINUE READING

Embedding D3 interactive charts Just having fun - testing to see if I could embed D3 charts in my blog. Seems like it works! // set the dimensions and margins of the graph var margin = {top: 10, right: 30, bottom: 30, left: 60}, width = 460 - margin.left - margin.right, height = 450 - margin.top - margin.bottom; // append the svg object to the body of the page var svg = d3.

CONTINUE READING

Fuzzy matching As a computer scientist graduate, I always strive to reduce my computational complexity through parallelization or vectorization! Explicit loops in data science is the root of evil! For loops & while loops have their places but definitely not in data science space (fairly broad statement here). In this post here, I hope to show a really cool example that avoids the dreaded O(n square) complexity. I will be using fuzzy matching to find the closet match of strings in data-frame 2, df2 against data-frame 1, df1.

CONTINUE READING

Lessons learnt I just realised that there’s a quick way to understand the xpaths’ patterns. In the past, usually what I did is to manually eyeball to infer the patterns from the page source or inspect page. Silly me! 1 quick way to understand the pattern is through the following, Right click on an element in a web page that you are interested in and click on ‘inspect’ Right click on the node and click ‘copy’ Copy full xpath And paste to a notepad.

CONTINUE READING

SRS analysis I haven’t paid much attention to SRS contributions as a way to reduce taxable income. But lately, I realised you could boost investment portfolio returns through this avenue at literally 0 cost. I find this blog post written by a local finance blogger to be really helpful in understanding the SRS contributions and withdrawal mechanics. For my own understanding, I also did some quick analysis using google sheet (see ‘Analysis in google sheet’ section) to evaluate if this works, and to my surprise, I found that free lunch does exist in Singapore!

CONTINUE READING

Birth of an idea of all places: In the Jungle Having to juggle both work and masters in computer science at the same time, it’s really hard to afford any more time to my side projects. But back in August, I had a break away from both school and work by going back for reservist. As it’s really bored in there where I spent most of the time in a small building (with no aircon!

CONTINUE READING