Sunday, January 13, 2019

Risk Concept of the Week: Bootstrapping

Bootstrapping
Bootstrapping is a method for evaluating the variance of an estimator using Nboot data sets each containing N points obtained by random (say Monte Carlo) sampling of the original set of N points.
The process is to assign measures of accuracy (defined in terms of bias, variance, confidence intervals, prediction error or some other such measure) to sample estimates.
For purposes of our example, lets assume that a candidate takes either 1 or 2 or 3 or 4 or 5 months to prepare for the FRM -P2 exam. We then select 5 random candidates from 20 different cities to check how many months do they take to prepare for the exam.
We begin with a statistical sample from a population that we know nothing about. Our goal will be a 90% confidence interval about the mean of the sample. Although other statistical techniques used to determine confidence intervals assume that we know the mean or standard deviation of our population, bootstrapping does not require anything other than the sample.
We now re-sample with replacement from our sample to form what are known as bootstrap samples. Each bootstrap sample will have a size of five, just like our original sample (1,2,3,4,5). Since we are randomly selecting and then are replacing each value, the bootstrap samples may be different from the original sample and from each other.
  1. Sample 1: 3,3,1,5,5. Mean of sample 1 = 3.4
  2. Sample 2: 1,2,2,3,3. Mean of sample 2 = 2.2
  3. Sample 3: 3,2,5,2,1. Mean of Sample 3 = 2.6
  4. Sample 4: 4,3,4,2,3. Mean of sample 4 = 3.2
  5. Sample 5: 1,2,4,4,4. Mean of Sample 5 = 3
  6. Sample 6: 2,2,2,2,2. Mean of Sample 6 = 2
  7. Sample 7: 5,4,3,1,1. Mean of sample 7 = 2.8
  8. Sample 8: 1,1,5,4,3. Mean of sample 8 = 2.8
  9. Sample 9: 3,3,4,4,1. Mean of sample 9 = 3
  10. Sample 10: 5,1,3,2,2. Mean of sample 10 = 2.6
  11. Sample 11: 5,5,4,1,4. Mean of sample 11 = 3.8
  12. Sample 12: 1,4,4,4,5. Mean of sample 12 = 3.6
  13. Sample 13: 3,3,1,1,1. Mean of sample 13 = 1.8
  14. Sample 14: 4,1,5,1,2. Mean of sample 14 = 2.6
  15. Sample 15: 5,5,5,5,4. Mean of Sample 15 = 4.8
  16. Sample 16: 1,2,5,1,1. Mean of sample 16 = 2
  17. Sample 17: 4,3,5,2,1. Mean of sample 17 = 3
  18. Sample 18: 5,1,2,1,5. Mean of sample 18 = 2.8
  19. Sample 19: 4,4,1,1,2. Mean of sample 19 = 2.4
  20. Sample 20: 5,5,1,2,3. Mean of sample 20 = 3.2

Mean

Since we are using bootstrapping to calculate a confidence interval for the population mean, we now calculate the means of each of our bootstrap samples. These means, arranged in ascending order are: 1.8, 2, 2, 2.2, 2.4, 2.6, 2.6, 2.6, 2.8, 2.8, 2.8, 3, 3, 3, 3.2, 3.2, 3.4, 3.6, 3.8 and 4.8

Confidence Interval

We now obtain from our list of bootstrap sample means a confidence interval. Since we want a 90% confidence interval, we use the 95th and 5th percentiles as the endpoints of the intervals. The reason for this is that we split 100% - 90% = 10% in half so that we will have the middle 90% of all of the bootstrap sample means. For our example above we have a confidence interval of 2 to 3.8 months that a candidate takes to prepare for the FRM-P2 exam.
The bootstrap is a robust, non-parametric, method that does well with smaller samples or awkward distributions.
One of the biggest advantages of the bootstrap method is its simplicity. There is no need to assume the specific data distribution based on some theoretical distribution. We use the empirical distribution and we can analyze the statistics which theoretical properties cannot be analyzed mathematically.

Sunday, January 6, 2019

The Hathaway Effect!

Anna Hathaway, Multi-factor Regression, Robotraders, Warren Buffet & Information Bias for once, have come together to just give a glimpse of a probable hypothesis and its impact on Risk Management.
While studying for my FRM Level 1 exams, I learnt about "Hathaway Effect", correlation of positive news about the actress Anna Hathaway and uptick in the stock price of Warren Buffet's Berkshire Hathaway. I was curious to deocde this spurious correlation to check the reasons how would the logic come to play at ground level.
multi-factor regression analysis is a process to estimate returns on a stock over a period of say one year using multiple factors equation:
for eg: E[Rx] = Risk-free rate + Beta of factor 1 * Factor 1+ Beta of factor 2* Factor 2+...... + Beta of Factor n*Factor n; where E[Rx] is the expected return on stock x.
Lets say returns of stock x depends only upon 2 factors:
Factor 1: GDP of the country (say India) & Factor 2: Inflation Rate.
Given Risk free rate is 5%, Beta of Factor 1 is 1.5 and Beta of Factor 2 is -0.5.
If the GDP for 2017 is 8% and Inflation Rate is 6%, we can arrive at the return on stock x as
E[Rx] = 5% + 1.5 *8 - 0.5*6 = 14%
Using the multi-factor regression, models are built to estimate and predict mispriced securities and trade over them to gain arbitrage opportunities. Using this theory, the new age technologist & quants have build sophisticated robotraders which use the information available on the internet, estimate if there is a misprice and directly buy/sell positions.
What looked like a simple process, looses common sense when performed by robotraders. The understanding is that such robotraders have algorithms that pick up trends, news, or hashtags about Hathaway on the net and apply it on the stock prices.
Blogger Dan Mirvish was the first to spot this pattern, pointing out a few occasions since 2008 where the correlation was striking:
  • September 26, 2008 – Passengers opens: BRK.A up 1.43%
  • October 3, 2008 – Rachel Getting Married Opens: BRK.A up 0.44%
  • January 5, 2009 – Bride Wars opens: BRK.A up 2.61%
  • February 8, 2010 – Valentine’s Day opens: BRK.A up 1.01%
  • March 5, 2010 – Alice in Wonderland opens: BRK.A up 0.74%
  • November 24, 2010 – Love and Other Drugs opens: BRK.A up 1.62%
  • November 29, 2010 – Anne announced as co-host of the 83rd Academy Awards: BRK.A up 0.25%
  • February 28, 2011 – Anne co-hosts the 83rd Academy Awards: BRK.A up 2.94%
Sauro Locatelli from Pinnacle Advisory had published article on the Hathaway effect. He actually crunched the numbers and found that the average daily return during major Anne Hathaway news appearances since January 2008 was 1.38%, while it was -0.02% on all other days. A simple statistical test based on sample size and standard deviations indicates that the two average daily returns are statistically distinguishable from each other with 98% confidence.
Various banks on the Wall Street have acknowledged that the algorithms might not be full-proof and hence they have established Model review teams and forums to control these models from various risk including information biases.
In on of my direct conversation with a MD who heads risk management for a well know bank on the street agreed that 'information bias from use of algorithms, machine learning, robotics is a one of the many risks faced by every bank. These are mitigated through Estimation and Model reviews and risk policies'.
Wondering how tech and social media giants like Facebook, Google, Microsoft and others manage such risks???

Hit-me Clown



I was introduced to science at very early stage of 4 years. Water vapor, steam, oil floating on water, growth of mushrooms on the wooden door, blossoming of flowers in my garden kept me intrigued.
Once my friend's father got a "Hit-me Clown" for my friend. I was fascinated to see that this clown when punched would hit the floor and still get up back to its original position, all by itself. This was magic for me and I was curious to know why wouldn't it stay flat on the floor as other toys would.
Back then the only way to know was to dissect the clown and see what is inside it. On one sunny afternoon, me and my friend took the hit-me clown to the terrace and made the first dissection right on the nose of that toy with a scissor just to find nothing but air. The bottom of the doll had another section which contained sand. Our curiosity had no bounds as we couldn't understand the science of that clown.
Some years later I learnt about “center of gravity". Gravity pulls on you from every point, head to toe, but if you put all those effects together, you can come up with one spot that’s body will come back to, which in this case was the base of the clown made of sand.
When Sylvester Stallone in Rocky says "it ain't about how hard ya hit. It's about how hard you can get hit and keep moving forward" the hit-me clown came right in my mind. But the question remained - what should be the base of me? how can I get up and still move forward?
Through my experience of life, one has to mix strong values and beliefs, work ethics, and care for others in that base. Values that makes you take the blows and Beliefs that give you strength when you know that you are done but you still want to fight back. Work ethics that lead to same behavior in spite of thousands and thousands of blows and care for others that one doesn't retaliate back with a punch!
Today as well, I do have my sets of punches and victories. The victories are sweet, the punches are hard. But that base helps me to get up back again and move forward!
To all those who face a tough situation in life remember Rocky and the hit-me clown "How much you can take and keep moving forward. That's how winning is done!”