Sunday, May 7, 2017

Correlations among the Fraser family members using R

So I've been fiddling around with R over the weekends. R is both the name of a programming language and an open-source software which is used for statistical computing. I'm using R in the workplace and it comes equipped with a full suite of packages for various kinds of data manipulation/analysis/etc.

Not too long ago, I wondered whether could R be used for investing-related purposes. True enough, there was a package known as quantmod which would be a treasure trove for traders. After some fiddling around, what I liked about quantmod is its ease in importing data from various financial sources (e.g. yahoo finance, google finance, etc) into R itself.

As I'm currently vested in some of the Fraser family members, I thought to myself how fun it would be if I could create a function in R that will be able to tell me how correlated the Fraser family members are.

Before proceeding further, there are some assumptions I have made. First, I've set the time period from 1 January 2016 to 31 December 2016. Second, I did not include Frasers Logistics & Industrial Trust as it does not have a full-year worth of data from the above-mentioned time period. Third, I assumed that there is a monotonic relationship among the Fraser family members. Monotonic relationships are less restrictive than linear relationships as linear relationships are monotonic, but not all monotonic relationships are linear. Therefore, I will be using the Spearman's correlation, which is suited for this task.

Basically, the function which I have written takes in three arguments: (a) the list of stocks to be correlated with one another, (b) the start date, and (c) the end date.

The function consists of the following steps:
1). use quantmod to import a list of stock symbols/tickers to be downloaded from yahoo finance
2). retain only the closing price of all the stock counters from the period between the start date to the end date (inclusive of both the start date and the end date as well)
3). join the closing prices together in one dataset, with each column representing one counter
4). produce scatterplot matrices and the Spearman's correlation table.

So, here's the scatterplot matrices produced by R:

At first glance, I thought that there was something wrong with the output. For example, if you look at the scatterplot in the first column from the left, second row from the top, it has F&N on its x-axis and FCL on its y-axis. A mirror-image of that scatterplot could be found on the second column from the left, first row from the top. The change is that now F&N is on the y-axis and FCL is on the x-axis. The scatterplots do really look different from one another if the counters swapped axis! I've checked the underlying raw data and everything seems to be correct. Guess it must be the compression of the y-axis (relative to the x-axis) that causes the distortion in presentation.

What about the Spearman's correlation table?

Over the last year, the performance of Frasers Centrepoint Trust is positively associated with the performance of Frasers Commercial Trust. Frasers Hospitality Trust is least associated with the other counters in the Frasers family (the correlation coefficients with the other counters are generally smaller).

That's all for now.

In the meantime, I shall touch up on my programming code. I realized that I have no error handling mechanism in my code (e.g. if only one symbol/ticker is used as an input, it should throw up a warning statement instead of an error). Also, the scatterplots could be made more visually appealing (most probably with the ggplot2 package).

Readers, if you want to know whether a counter correlate with another counter, do drop a comment. I'm keen to test my function out further. =P

Just specify the list of counters, start date, and end date!

Monday, May 1, 2017

A colleague's financial woes

Recently, a colleague of mine has been experiencing an increased amount of financial stress in his life. He is going to get married soon, have to pay the down payment for his flat, and commence paying the monthly installments like all budding home owners.

Besides the looming mountain of debt, he also has to service a whole life policy a "friend" sold him. Having read up a little on insurance after purchasing the whole life policy, he realized he got a sucker's deal. He is hesitant to terminate the policy as he would not get back the full value of premiums paid thus far. Hence, he is intending to continue paying the premiums for his whole life policy.

Add to that that both he and his wife-to-be only have contract jobs, the huge financial load that they would have to shoulder together as a couple seems all the more intimidating. From my conversations with him, I learn that he and his wife have bright dreams ahead of them. They both intend to further their studies. However, with their current situation, he has been thinking of shelving his dreams aside.

A female colleague was quick to point out that his wife-to-be would also be able to contribute financially. Shouldering the debt load was not his alone. He swiftly called her out on her bluff. After all, there is still the female expectation for males to support them financially even though ladies have surpassed men in earning power. Why touch your own savings and investments when there is a loving boyfriend/hubby that willingly and unconditionally provide for you? ;) Only touch your principal when there's no choice mah!

The female colleague then rubbed it in with the bride price and the 四点金 (si dian jin). For non-Chinese readers, the si dian jin is a 4-piece jewellery set presented to the bride. This meant additional savings on his part.

I realized that my colleague has been spending more time on his hobbies to unwind.....

On a separate (yet related) note, he is also concerned about job stability and career progression in our industry. As I have shared in my blog postings before, you need at least a Masters degree before you can get a permanent job in my field of social science research. With rampant paper qualifications-inflation these days, sooner or later you would need a PhD just to get a job. (In fact, this is what is happening in my previous work place. PhD holders are applying for Masters level positions).

Upon some reflection, social science graduates can also be broadly categorized by what they intend to do with their degree following graduation. There are those that get a degree to satisfy the basic requirements of jobs available in the marketplace today. Therefore, what jobs they take up after graduation may or may not be related to the field of their degree. Hence, you have people working in banking, human resource, finance, consulting, business services, etc.

Conversely, you have those that do want their jobs to be an extension of their degree programme, applying what they have learned in school to the workplace. Here you have the social science researcher or the social science practitioner.

When posed with "am I in the right place/career" questions from interns and colleagues who are newer to the workforce such as said male colleague above, I am always unable to answer their question adequately. It is a personal question that is best answered by the questioner himself/herself.

If you want to be a social science practitioner, you have to either save a lot or come from a rich family (spend $100000 or so for both Bachelor Degree and Masters). You must be willing to accept a low pay even after many years of studies as well as the exorbitant tuition fees you fork out. Those who seek this path do so out of helping others self-actualize. Cost of studying and low remuneration should be a non-issue to them; what brings satisfaction is seeing the joy on your client's face.

For those who gravitate towards the former, the requirements and expectations are indeed different. Paper qualifications are not the be-all and end-all. Your job experience is much more esteemed by your employer. You work in vastly different environments and have a higher base pay and pay progression to boot.

There is no right or wrong answer. And this is why the person is in the best position to answer the question themselves.

Saturday, April 22, 2017

Epicurean Delights: AGgs

Welcome to Epicurean Delights. Your host for today, Unintelligent Nerd, will be investigating and providing coverage on the fine dining scene. According to some undisclosed sources, AGgs are purported to be one of the most exotic dishes that have hit the scene.

Unintelligent Nerd (UN): Hello there, would you like to share with the audience your creation?

Chef: Yes. AGgs will definitely tantalize your taste buds. They are made for the sophisticated connoisseur who are able to appreciate the finer things in life. First, you need eggs.

UN: Eggs? Is it an egg-based dish?

Chef: Bingo! Next, we have to boil the egg.

~ Some time elapses ~

Chef: Once you have a hard-boiled egg, mash it up. Next, we will be adding in the "mystery ingredient." Wrap the mashed egg and the mystery ingredient together with a plastic wrap.

~ Some more time elapses ~

Chef: Annnddd wala! You have your AGgs!

~ Scroll down the page ~

UN: ................

Disclaimer: This post is for educational purposes only. Unintelligent Nerd is against the artificial toning of silver bullion (AG) with eggs for ethical reasons. The sulfur present in hard-boiled eggs interact with silver to produce the toning effect. For antique silver bullion buyers, do your own due diligence if you ever consider buying toned coins.

Friday, April 14, 2017

The newest con artist on the block

I'm still feeling pretty angry over an episode that happened earlier today. I was out with my mum for a leisurely stroll around the neighbourhood and she was approached by an individual who possessed certain characteristics that evoked pity.

At first, said individual offered some "products" to her, citing that it is for "charity." According to the individual, these products are "free"; the recipient is given the freedom to decide whether they would want to give a token amount to said individual.

Despite my mum's reluctance, said individual forced the products on my mum's hands. My mum tried to return the products but said individual physically withdrew from us. Following which, the individual followed us for some distance, before insisting my mum to pay.

Lo and behold! The individual pointed out that there is a price tag on the product, My mum then paid to avoid any unnecessary drama.

Coincidentally, said individual was walking in the same direction as us. We observed as said individual goes for the next kill.

This time, it was more aggressive. While crossing the road, said individual approached a lady from behind, grabbed her arm, and dumped the products between her bag and her body. As the products were no longer in said individual's hands, payment was the name of "charity." Disoriented, the lady paid. Mind you, this happened in the middle of the road.

I was furious. We began thinking of ways to protect ourselves if we are that unfortunate to meet such individuals in the future. Here are some of our thoughts:

First, we realized that ladies with multiple bags/handbags are vulnerable. Since ladies are struggling with multiple bags/handbags + shopping bags, it makes it all the more easier for such individuals to shove and wedge the products somewhere on them. Case in point, the product was expertly shoved and wedged between that particular lady's forearm and torso. As the product is "now yours", you'll have to pay.

Second. Want to return the product? Said individual has already increased the physical distance from you. Put it somewhere nearby to demonstrate disinterest? Don't forget that they possess certain characteristics that evoked pity. Unless you want to become the next social media sensation, pay up or you will be discriminated as a bully.

Third. Always remember that if a stranger approaches you, consciously remind yourself not to ever extend your hand to them. This is a natural reflex, I think, when people present you with something. No hands, no products shoved on it.

Fourth. Call police? Then got drama liao. You will be looked upon as a meanie by passerbys.

Fifth. Walk fast. On my own, I'm a naturally fast walker, so I tend to speed away from strangers soliciting my attention (e.g. insurance agents, etc.) This doesn't work if you are out with family and friends.

Sixth. Have a dao face like Unintelligent Nerd. On my own, people rarely approach me. Natural protection LOL!

Readers, Stay safe!

Tuesday, April 4, 2017

Q1 2017 Portfolio Update

Time flies. With a blink of an eye, the first quarter of 2017 has ended. How has my portfolio fared for the first three months of 2017? Decently, I guess? I think I should let the two charts do the talking.

At one glance, Q1 2017 seems waaaaayyy horrible than Q1 2016. The huge bump in dividend in Q1 2016 was attributed to Saizen REIT.

Portfolio-wise, I have been decreasing my reliance on REITs for income. I have initiated new non-REIT positions to reduce the proportion that REITs play in my portfolio. In fact, there is a slight departure in the way that I usually invest. I initiated a new position in United Industrial Corporation as an asset play in January. We shall see how this turns out.

Meanwhile, monthly DCA-ing into the Nikko AM STI ETF via the POSB Invest Saver continues in the background.

Apart from Dairy Farm's USD-denominated dividends, I have also started receiving USD dividends from the other US counters I am vested in. I am going slow here. The US market is at an all-time high. Still, there are some occasional bargains in the consumer staples sector which I find delectable.

The USD dividends can barely pay for one meal, but I've gotta start somewhere, right?

Work is amazing. I am very grateful for the series of blessings I have received. First, my office shifted to a place nearer to home, cutting down my travel time by half. Next, I had a very huge pay raise a couple of weeks back. I had trouble wiping off the perpetually cheerful demeanour on my face (must be discreet mah!)

Third, I am going to be involved in another research project as a participant. Let's just say the cash incentives for participation is quite good.

Fourth, I just received my bonus today. I totally did not expect it. You see, temp jobs as a social science researcher normally does not come with medical/dental benefits, flexible benefits, group insurance, and bonuses. For this, I am real grateful.

I'm halfway done with my 1-year academic programme. I still remember pulling my hair out in frustration sometime in January when one of my teammates left the course and another social-loafed through the group projects. By then, I had resigned to fate that my grades are gone liao. Come results release day, I got perfect GPA. Must be the bell curve god at work here since I know I did not do well for certain assessment components.

I'll need to put in more effort and, if I pull it off correctly, I can graduate with a perfect GPA for real and tick a life goal off my list.

Never the zhuo bo guy, I have signed up for the CMFAS Module 9 (Life Insurance and Investment-Linked Policies) course during the semester break. I will be sitting for the paper before my official school term commences again.

I have met Mister High-Flyer, Rolf, twice over this quarter. Thanks for the great conversation and the dinner treat!

That's all for now.