{"id":802,"date":"2020-09-25T23:30:46","date_gmt":"2020-09-26T03:30:46","guid":{"rendered":"http:\/\/commoncents.blogwyrm.com\/?p=802"},"modified":"2022-03-27T20:23:08","modified_gmt":"2022-03-28T00:23:08","slug":"financial-arbitrage-redux","status":"publish","type":"post","link":"https:\/\/commoncents.blogwyrm.com\/?p=802","title":{"rendered":"Financial Arbitrage Redux"},"content":{"rendered":"<p>The previous blog introduced the notion of financial arbitrage and briefly explored the Capital Asset Pricing Model (CAPM) and the Arbitrage Pricing Theory (APT) models for pricing an asset (e.g. stock).\u00a0 The CAPM correlates a particular asset with some macroeconomic factor (e.g. inflation or one of the indices) to determine the expected return on the arbitrage.\u00a0 The APT generalizes this 1-dimensional correlation to the case where multiple factors affect the asset price.\u00a0 The applicable formula that covers both cases is<\/p>\n<p>R<sub>A<\/sub>\u00a0= R<sub>free<\/sub>\u00a0+ \u03b2<sub>1<\/sub>\u00a0( P<sub>1<\/sub>\u00a0- R<sub>free<\/sub>\u00a0) + \u03b2<sub>2<\/sub>\u00a0( P<sub>2<\/sub>\u00a0- R<sub>free<\/sub>\u00a0) + ...\u00a0= R<sub>free<\/sub>\u00a0+ \u03b2<sub>1<\/sub>\u00a0RP<sub>1<\/sub>\u00a0+ \u03b2<sub>2<\/sub>\u00a0RP<sub>2<\/sub>\u00a0+ ...<\/p>\n<p>where:<\/p>\n<p>R<sub>A<\/sub>\u00a0is the expected rate of return of the asset in question,<\/p>\n<p>R<sub>free<\/sub>\u00a0is the rate of return if the asset had no dependence on the identified macroeconomic factors (free rate of return),<\/p>\n<p>\u03b2<sub>i<\/sub>\u00a0is the sensitivity of the asset with respect to the\u00a0<em>i<\/em>th macroeconomic factor, and<\/p>\n<p>P<sub>i<\/sub>\u00a0is the additional\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Risk_premium\">risk premium<\/a>\u00a0associated with the\u00a0<em>i<\/em>th macroeconomic factor with RP<sub>i<\/sub>\u00a0= P<sub>i<\/sub>\u00a0- R<sub>free<\/sub>\u00a0being the actual risk premium.<\/p>\n<p>Obviously, setting all the \u03b2<sub>i<\/sub> beyond \u03b2<sub>1<\/sub> to be zero in the APT recovers the CAPM.<\/p>\n<p>To use either of these models, the arbitrageur needs to set multiple free parameters (R<sub>free<\/sub>, R<sub>A<\/sub>, \u03b2<sub>i<\/sub>, P<sub>i<\/sub>) using his judgement based on historical data and some of the aspects of this procedure will be the focus of this post.<\/p>\n<p>For simplicity, we\u2019ll limit the analysis to correlate one stock with one index and we\u2019ll follow the excellent article entitled <a href=\"https:\/\/www.wallstreetmojo.com\/capm-beta-definition-formula-calculate-beta-in-excel\/\">CAPM Beta - Definition, Formula, Calculate CAPM Beta in Excel<\/a> by Dheeraj Vaidya for WallStreetMojo.\u00a0 I\u2019ll be adding only a few points here and there just to round out what Vaidya presented but it is worth emphasizing what a fine job he did in his presentation.<\/p>\n<p>The correlation we\u2019ll be exploring is between a company called MakeMyTrip (MMYT ticker symbol) and the NASDAQ Composite (^IXIC ticker symbol).\u00a0 To match, Vaidya\u2019s analysis, we confine our time frame from January 1<sup>st<\/sup>, 2012 to October 30<sup>th<\/sup>, 2014.\u00a0 Yahoo Finance served quotes under the historical data link that presents itself after entering a ticker symbol (see green ellipse in the figure below)<\/p>\n<p><a href=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/YahooFinance.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-952\" src=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/YahooFinance.png\" alt=\"\" width=\"857\" height=\"492\" srcset=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/YahooFinance.png 857w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/YahooFinance-300x172.png 300w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/YahooFinance-768x441.png 768w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/YahooFinance-810x465.png 810w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><\/a><\/p>\n<p>Selecting the time span and downloading the data in CSV format are easy.\u00a0 I read the data for MMYT and ^IXIC in pandas data frames but since the average price of the NASDAQ Composite over that time span was $3563.91 compared to an average of $18.98 for MakeMyTrip, plotting each time series on a common plot won\u2019t work, even with a log scaling.\u00a0 Instead, taking a page from Z-scoring in statistics, I made a plot of the normalized stock price for each listing in which the instantaneous price was divided the average.<\/p>\n<p><a href=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-951\" src=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices.png\" alt=\"\" width=\"800\" height=\"400\" srcset=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices.png 800w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices-300x150.png 300w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices-768x384.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>There is no obvious correlation between the two time series. The NASDAQ Composite, more or less, rose steadily during this time span while MakeMyTrip shows a more of a parabolic behavior, with a downward trend during roughly the first third of the time span followed by minimum in the second third, and punctuated by rapid, and often volatile growth, in the third.<\/p>\n<p>These differences in the qualitative evolution of the two assets presents itself even more strongly in a scatter plot showing the adjusted closing price of each asset.<\/p>\n<p><a href=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices_scatter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-950\" src=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices_scatter.png\" alt=\"\" width=\"640\" height=\"480\" srcset=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices_scatter.png 640w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Normalized_stock_prices_scatter-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Nonetheless, there is a reasonably good correlation between the two assets in terms of their fractional gain, defined as the difference between two successive days relative to the price of the earlier of the two days (i.e. (p<sub>i+1<\/sub> \u2013 p<sub>i<\/sub>)\/p<sub>i<\/sub> where p<sub>i<\/sub> is the price of the asset on the <em>i<\/em><sup>th<\/sup> day).<\/p>\n<p><a href=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Fractional_Gain.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-949\" src=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Fractional_Gain.png\" alt=\"\" width=\"640\" height=\"480\" srcset=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Fractional_Gain.png 640w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/Fractional_Gain-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>There is a definite but weak positive correlation between the adjusted close of the NASDAQ Composite and MakeMyTrip.\u00a0 A linear regression, computed using numpy\u2019s polyfit routine (order 1), confirmed the same value of 0.9858 for the slope of a linear regression line that Vaidya reported.\u00a0 This value is then the \u03b2 between MakeMyTrip and the NASDAQ composite for this time span.<\/p>\n<p>But the fun doesn\u2019t stop there.\u00a0 We can use the power of the pandas package to extend Vaidya\u2019s presentation by randomly sampling the data to get an idea of the spread in the value of \u03b2 based on using different samples due to differences in time span or reporting interval.\u00a0 Running a Monte Carlo with 350 samples each (almost exactly half of the total number of available data points) for N = 10,000 trials gives the following statistics for \u03b2:<\/p>\n<ul>\n<li>the mean was 0.9835<\/li>\n<li>the standard deviation was 0.1443<\/li>\n<li>the distribution of \u03b2 values is normal<\/li>\n<\/ul>\n<p><a href=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/beta_histrogram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-948\" src=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/beta_histrogram.png\" alt=\"\" width=\"640\" height=\"480\" srcset=\"https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/beta_histrogram.png 640w, https:\/\/commoncents.blogwyrm.com\/wp-content\/uploads\/2022\/03\/beta_histrogram-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Using the standard techniques of statistical analysis, we might be inclined to report the beta value as \u03b2 = 0.9835 \u00b1 0.0014 or, said equivalently, \u03b2 could lie in the range of 0.9807 and 0.9863 with the usual 95% confidence.\u00a0 \u00a0This uncertainty in the value of \u03b2 is about 5.7% and this translates directly into a 5.7% uncertainty in the assessment of the assets rate of return.\u00a0 A 5% uncertainty is likely to be a good rule of thumb for the arbitrageur in estimating whether he wants to look further at an asset.<\/p>\n<p>Another source of error that arbitrageur must wrestle with is the value for R<sub>free<\/sub>, the <a href=\"https:\/\/www.investopedia.com\/terms\/r\/risk-freereturn.asp\">risk-free rate of return<\/a>.\u00a0 According to Investopia.com, while a true risk-free rate of return is only theoretically realizable, the 3-month Treasury note is taken as a good proxy.\u00a0 However, even this \u2018sure fire\u2019 investment vehicle sees movement on the secondary market.\u00a0 The <a href=\"https:\/\/www.wsj.com\/market-data\/quotes\/bond\/BX\/TMUBMUSD03M\/historical-prices\">Wall Street Journal has excellent data and plots<\/a> which show that, at least in recent months, the daily movement of the R<sub>free<\/sub> can be 5-10%.<\/p>\n<p>The final ingredient in the CAPM model is RP, the additional risk premium associated with the asset.\u00a0 The way this value is set is probably as much an art as a data science question since it not only has to account for the actual financial strengths and weaknesses of the asset but also the market sentiment.\u00a0 If the example in last month\u2019s blog were indicative, values ranging from 2-10% are reasonable.\u00a0 The uncertainty in the estimation of those risk premiums are probably correspondingly larger, maybe in the 20-30% range.<\/p>\n<p>All told, the estimated value for the real rate of return on an asset must account for all of these errors sources.\u00a0 To illustrate this, lets continue on with the comparison of MakeMyTrip with the NASDAQ composite by assuming the following:<\/p>\n<ul>\n<li>\u03b2 = 0.9835 with a 1-standard deviation uncertainty of 0.0014<\/li>\n<li>R<sub>free<\/sub> = 0.5% with a 1-standard deviation uncertainty of 0.025% (5% of the 0.5% value)<\/li>\n<li>RP = 2.5% with a 1-standard deviation uncertainty of 0.5 % (20% of the 2.5% value)<\/li>\n<\/ul>\n<p>With these assumptions, the CAPM rate of return would then be RA = 0.5% + 0.9835*2.5% = 2.9588%. \u00a0The corresponding error in that estimation is obtained using the usual propagation of error techniques and takes the value of 0.4943%.\u00a0 This value means that the arbitrageur needs to figure in about 0.5% slop 67% of the time he undertakes this transaction.<\/p>\n<p>All this machinery of linear regression, Monte Carlo simulations, and propagation of error explains the rise of algorithmic trading and the mathematical analysts (so-called \u2018quants\u2019) in todays modern market.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The previous blog introduced the notion of financial arbitrage and briefly explored the Capital Asset Pricing Model (CAPM) and the Arbitrage Pricing Theory (APT) models for pricing an asset (e.g.... <a class=\"read-more-button\" href=\"https:\/\/commoncents.blogwyrm.com\/?p=802\">Read more &gt;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-802","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=802"}],"version-history":[{"count":3,"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/802\/revisions"}],"predecessor-version":[{"id":953,"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=\/wp\/v2\/posts\/802\/revisions\/953"}],"wp:attachment":[{"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/commoncents.blogwyrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}