12/30/2015 – Schopenhauer

These days my cooking music has turned from rap/classical to YouTube audio stories, I find it to be an excellent way to keep my mind stimulated while mindlessly cutting vegetables or making mashed potatoes.

One of the more interesting figures that I’ve learned about recently is the ideas of the 19th century German philosopher Arthur Schopenhauer, who suggested that the way to approach to life should be similar to Buddhist monks (known for his famous work The World as Will and Representation). Born in Germany in 1788 to wealthy parents, Schopenhauer studied the work of many prominent philosophers and began his famous work at the age of 26 (and finished it at age 31). I will (try to) summarize his ideas below in less than 250 words.

Schopenhauer believes there is a primal force called “will-to-life” within us (wile zum leben in German) that overcomes our logic reasoning and causes us to think, amongst other wasteful things, sex and love. Schopenhauer is more forgiving of the latter since he believes that love offers a logical goal, which is to conceive children. He argues that although people who opposite traits tend to fall in love with one another, they would actually make terrible friends and, apart from sex, would hate each others’ guts. Schopenhauer makes a comparison of humans to moles, which does its best to survive despite dismal living conditions (note that Schopenhauer considers living underground from a human’s perspective, and not the moles. Moles might love it there.).

In general, the “will-to-life” drives humans away from our “higher” logical self by wasting it on carnal pleasures and instincts, often reflecting regrettably over its aftermath. Schopenhauer believes that elder individuals’ faces are full of wrinkles because they are vastly disappointed that they have failed at the pursuit of happiness (on a side note, check out this old classic if you are interested in the stock market). Schopenhauer proposes two solutions:

  1. Emulate the actions of Eastern Buddhist monks – living in isolation, overcome one’s instincts, and never marry. Schopenhauer recognizes the difficulty of the average person overcoming such a thing and thus recommends highly the next solution,
  2. Immerse oneself in Arts and Philosophy – the objective is for it to act as a guide of continuous self-awareness to one’s actions, thus being able to look at oneself from an objective perspective and avoid the pitfall of being driven by the “will-to-life”.

Schopenhauer is an interesting character and it’s one of the philosophers that were eclipsed by the other ones I’ve studied in university. I admire him for recognizing the serene practicalities within the mysterious Eastern philosophy and being able to adapt it for the much more practical Western civilization. His comments on the misery of human life were sobering yet comical and witty, and although he didn’t end up being rich or famous, he found an audience for his work and died peacefully in 1860.

In my opinion, Schopenhauer’s approach to life is very conservative, his disdain for “will-to-life” may have held him back from doing certain things which would have made him more financially successful (but who knows what his definition of success was) or more popular (maybe fame isn’t the name of his game). However, his ideas are excellent in today’s hectic world and there is no doubt that a healthy dose of Schopenhaurism would bring a much needed break from our modern, fast-paced lifestyles.

It’s the last day of 2015 tomorrow, I’m expecting a fairly empty office and a shorter day tomorrow.


12/29/2015 – Investing

I’ve always read multiple books at the same time to prevent mental stagnation. Recently I have been reading two market related ones, The Intelligent Investor by Benjamin Graham and The New Market Wizards by Jack D. Schwagner. Both are great books and sheds light on different aspects of the market, the former is about how to intelligent allocate your capital for long term investing, and the latter is a summary of interviews with some of the top performing traders at the time of publishing (1992).

The biggest thing that both books agree on (with regards to how much I’ve read so far) seem to be that:
1) No one can consistently predict the stock market, and
2) Humans are ill-suited to handle themselves in the stock market

It’s important to note that The Intelligent Investor is a book that could benefit both investors/traders, and appeals to a large range of market participants. The Market Wizards series is great but it feels like Schwagner picked a biased subset of the trading world, or according to Nassim Taleb (author of the popular book The Black Swan), they were lucky. Alternatively, it could just mean that most people are too emotional to trade. This is an interesting phenomenon that has spawned countless behavioural finance courses and psychology studies.

I’ve been trading the stock market for fun since early 2013 with a small amount of capital (for me at that time), and during my short stint with the stock market I’ve always questioned whether it is better to invest for the long run or rack up a series of winning trades using leverage and options over a much shorter period of time. As a consequence my strategies were inconsistent and I wasn’t able to produce consistent wins. Due to the recent oil crisis my commodity related options were crushed and brought me to a point where I need to re-evaluate my goals or face eventual annihilation of my trading net worth. Luckily these options only consist of 20% of my high risk capital so much of my trading portfolio is still intact.

I’m currently educating myself on trading indicators so I could make more accurate directional assessments, with the eventual goal of building a probability based trading system with buy/sell signals. This process has been an interesting one, as much of the indicators use a combination of mathematics that feels quite artificial and closer to a computer programming experience than statistics or abstract mathematics. I will update any research efforts as they become available.

12/29/2015 – Wait Time

Running an advanced algorithm in SAS takes a long time, just came back from lunch and the query is still running. Life is a game of patience and frankly by the time it finishes running I’d be fossilized. To be fair, my lunch lasted less than half an hour so it probably isn’t a giant query like the one I wrote a few months a go (which took 50min).

Most of the issues with time comes from joining giant tables, I tried adjusting the algorithms to make it more efficient like reducing the joining data set, adding as much action into each query as I could so there’d be less computation in the next one, and writing macros so that there’d be less . However it seems that code efficiency does not mean computation efficiency.

There may be a few things causing this problem:

  1. Macros are actually slowing things down: since I’m joining huge datasets they are running through them again and again, there is no way to avoid this issue since I need to obtain the same information for different risk levels from the same tables. A possible cure is run the programs through a subset of the original database.
  2. Too many actions in one query: after a bit of Googling I found that this isn’t a problem, it’s actually beneficial to combine different actions into one query. That is one myth busted.
  3. Crummy coding: this is a little unlikely since I’m writing SQL code and they’re quite similar across the board as I’m merely extracting data at this point for exploratory analyses, perhaps I could throw them into separate queries and see how long they take individually.
  4. Conflicting computation requirements: it seems that I’m not the only one not taking vacations a few days after Christmas and before New Years. Plus there’s a minor issue that is currently on the hot seat with another team so they’re requesting a lot of support from the data analysts who operate within and out of the SAS systems. Again, no way out of this one but patience.

I could only potentially improve on 1/4 of the issues described above (#3), so it wouldn’t produce much improvement in processing speed at all. I might spend some time reviewing the loess method I implemented last week, this interesting regression method has yielded some interesting insights regarding some of our products. So far I’ve only been interpreting them visually, so there could be additional information that I could uncover once I (re)learn how to interpret the coefficients.


Update: I was able to get the run time to decrease by almost half after using the function <compress=yes> and joining tables using unique accounts to reduce the size of every table created. It turns out that one of the tables had 251 million rows of data, when I tried to join it with another table the information multiplied and thus overwhelmed the system. The new program took about 50 minutes in total for all the risk levels I tested, which is a drastic improvement.


Hi all, I’ve decided to create a new blog dedicated to articulating my daily thoughts. After reading about the benefits around the mental benefits of keeping daily track of one’s thoughts and activities, it seems a no-brainer to try to replenish my diminishing dictionary of words via this method. It would mainly be a series of short excerpts of my current thoughts and musings like Twitter, except there is no 140 character limit on blog entries. I’ll try to make each entry as meaningful as possible, and if not possible then it hopefully would be entertaining to the reader(s). Online memories are as light as a feather and there is no guarantee it would be kept in one form or another, until we all start getting plugged into a form of virtual reality.

A little background, I’m currently working at a financial institution in Toronto in a data consultant role, which deals mainly in analysing and producing actionable deliverables for various initiatives via statistical modeling and analyses in SAS. I’ve thrown in a few data visualisation using R for fun and it has proven useful that I’d be using it as a complement to SAS. In our current world riddled with excessive amount of information being able to decipher and find patterns within oceans of data is a challenging and exciting opportunity to those who are statistically trained. Fortunately while studying for my actuarial degree I took a few (mandatory) statistics courses were practical in nature such as simulations, applied probability, and forecasting. The language of statistics is quite similar to the decision-making process of a computer, hence the extensive use of statistics in artificial intelligence and ‘smart’-items like watches, cars, and wearables.

It would be interesting to see how long I can keep this up, considering that my previous online endeavours gave way after a few months, life in the real world is just too interesting.