IBKR Quant Blog


1 2 3 4 5 2 43


Quant

Measuring Factor Exposures: Uses and Abuses


The post Measuring Factor Exposures: Uses and Abuses appeared first on Alpha Architect Blog https://alphaarchitect.com/blog/

 

By Tommi Johnsen, PhD | December 3rd, 2018
 

Measuring Factor Exposures: Uses and Abuses

  • Ronen Israel and Adrienne Ross
  • The Journal of Alternative Investments
  • A version of this paper can be found here
  • Want to read our summaries of academic finance papers? Check out our Academic Research Insight category

What are the research questions?

  1. USES: Can investors really separate “alpha” from “beta”? What are the ins-and-outs of understanding the exposures in a portfolio and their contribution to “alpha”?
  2. ABUSES: Are there differences in the way strategies are constructed in academic articles vs. the way practitioners actually implement those strategies that are consequential for investors?

What are the Academic Insights?

  1. YES.  But it’s a bit complicated.  Two things are needed to separate alpha from beta: first, a risk model and second, use of regression to match the returns from a portfolio to the risk exposures present in that portfolio. What are the appropriate risk factors (CAPM, Fama-French, etc.) that are associated with or explain returns produced by a portfolio?  Once identified, then regression analysis is conducted to decompose portfolio returns into their component sources of risk as they exist in the portfolio. Portfolio returns are regressed again the returns of the risk variables which accomplishes the separation need to isolate alpha.  Any return that is not separated and associated with a risk exposure is real alpha.  The results of several such regressions are presented in Exhibit 3.  Four risk models are estimated beginning with the basic CAPM (model 1) and three Fama-French factors are added sequentially (models 2,3,4).  Note that as risk variables are added, alpha decreases from 6.1% to 1.8% as it is essentially being reassigned to the risk exposures actually embedded in the portfolio.
  2. YES.  While not intuitively obvious, the way that academics conduct research is designed to illustrate or test a theory and hopefully get the results published.  The studies are definitely not designed to illustrate how investors should implement their significant results.  Be aware of the following potential sources of discrepancies in the performance of actual portfolios and the academic results that are published. First, academics may not account for the costs of implementation including management fees, transactions costs, and taxes. Second, practitioners are generally interested in large and mid-cap universes for reasons of investibility. Academics may construct their studies to encompass all capitalization classes. Therefore, their results may be a function of the proportion of smaller capitalization ranges included in the study.  Academic studies are often unconcerned about industry exposures and, for the most part, they utilize equal weighting schemes. And while the studies are very concerned with making risk adjustments to their results (i.e., determining the presence of “alpha”) they are not concerned with the practical requirements of maintaining a particular active risk stance in the portfolio.  Factor studies generally construct portfolios using dollar and market neutral long-short positions to test their theories. And although practitioners may also construct long-short portfolios, they are often constrained by practical considerations such as the need to control active risk exposures and the need to maintain asset allocations. Finally, differences in how factors are measured (single component factors vs. multiple components) may produce more or less robust results.

Why does it matter?

When investors are choosing among managers and the various products offered, the comparison of alpha and beta can be tricky. Are the factors constructed similarly across managers and consistent with respect to implementation costs? Is the manager delivering a portfolio of factor tilts and is that consistent with the investment objective? Can any of the differences in performance relative to published research on factors be explained by the factor and portfolio construction process? Ultimately the investor will want to distinguish between managers offering a portfolio of factor tilts vs. managers delivering real alpha.

The most important chart from the paper

Quant-Alpha-Architect

 

The results are hypothetical results and are NOT an indicator of future results and do NOT represent returns that any investor actually attained. Indexes are unmanaged and do not reflect management or trading fees, and one cannot invest directly in an index.

Visit Alpha Architect Blog to read an abstract from the paper Measuring Factor Exposures: Uses and Abuses.

 

  • The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Alpha Architect, its affiliates or its employees. Our full disclosures are available here. Definitions of common statistics used in our analysis are available here (towards the bottom).
  • Join thousands of other readers and subscribe to our blog.
  • This site provides NO information on our value ETFs or our momentum ETFs. Please refer to this site.

  

Alpha Architect empowers investors through education. The company designs affordable active management strategies for Exchange-Traded Funds and Separately Managed Accounts. Visit their website to learn more: https://alphaarchitect.com

This article is from Alpha Architect Blog and is being posted with Alpha Architect’s permission. The views expressed in this article are solely those of the author and/or Alpha Architect and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


21826




Quant

2018 Recap - Popular Quant Article Tags


Python takes the crown for the most popular article tag in the IBKR Quant Blog 2018 Tag Cloud.

R programming language ranks second, followed closely by Algo Trading, Machine Learning, and Artificial Intelligence.
 

Quant

Graph source: IBKR Tag Cloud Image created with Free online Wordcloud generator https://www.wordclouds.com/. Data from IBKR Quant Blog.

 

Find links below to read articles on these popular topics.


Python


R

 

Algo Trading, Machine Learning, and Artificial Intelligence

 

 

What to look for in 2019?

As data science tools constantly evolve, stay tuned for more articles on Alternative Data and Cryptocurrency. Learn more about the current trends in this field with these articles:

 

 

Information posted on IBKR Quant that is provided by third-parties and not by Interactive Brokers does NOT constitute a recommendation by Interactive Brokers that you should contract for the services of that third party. Third-party participants who contribute to IBKR Quant are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.


21875




Quant

Decision Tree For Trading Using Python - Part III


By Mario Pisa PeñaQuantInsti Blog

In this installment, the author will discuss how to Obtain the data set for decision trees. In Part I and Part II, he discussed creating the predictor variables.

Obtaining the data set for decision trees

We have all the data ready! We have downloaded the market data, applied some technical indicators as predictor variables and defined the target variable for each type of problem, a categorical variable for the classification decision tree and a continuous variable for the regression decision tree.

We are going to do a small operation to sanitize the data and prepare the data set that each algorithm will use. We must to clean the data dropping the NA data, this step is crucial to compute cleanly the trees.

Next, we are going to create the data set of the predictor variables, that is to say, the indicators that we have calculated, this data set is common to the two decision trees that we are going to create, a classification decision tree and a regression decision tree.

X = df[predictors_list]
X.tail()

Quant

We then select the target dataset for the classification decision tree:

y_cls = df.target_cls
y_cls.tail()

Quant

Finally, we select the target dataset for the regression decision tree:

y_rgs = df.target_rgs
y_rgs.tail()

Quant

Splitting the data into training and testing data sets

The last step to finish with the preparation of the data sets is to split them into train and test data sets. This is necessary to fit the model with a set of data, usually 70% or 80% and the remainder, to test the goodness of the model. If we do not do so, we would run the risk of over-fitting the model. We want to test the model with unknown data, once the model has been fitted in order to evaluate the model accuracy.

We’re going to create the train data set with the 70% of the data from predictor and target variables data sets and the remainder 30% to test the model.

For classification decision trees, we’re going to use the train_test_split function from sklearn model_selection library to split the dataset. Since the output is categorical, it is important that the training and test datasets are proportional train_test_split function has as input the predictor and target datasets and some input parameters:

  • test_size: The size of the test data set, in this case, 30% of the data for the tests and, therefore, 70% for the training.
  • random_state: Since the sampling is random, this parameter allows us to reproduce the same randomness in each execution.
  • stratify: To ensure that the training and test sample data are proportional, we set the parameter to yes. This means that, for example, if there are more days with positive than negative return, the training and test samples will keep the same proportion.
from sklearn.model_selection import train_test_split
y=y_cls
X_cls_train, X_cls_test, y_cls_train, y_cls_test = train_test_split(X, y, test_size=0.3, random_state=432, stratify=y)
print (X_cls_train.shape, y_cls_train.shape)
print (X_cls_test.shape, y_cls_test.shape)

Here we have:

  • Train predictor variables dataset: X_cls_train
  • Train target variables dataset: y_cls_train
  • Test predictor variables dataset: X_cls_test
  • Test target variables dataset: y_cls_test

For regression decision trees we simply split the data at the specified rate, since the output is continuous, we don’t worry about the proportionality of the output in training and test datasets.

Again, here we have:

  • Train target variables dataset: y_rgs_train
  • Test predictor variables dataset: X_rgs_test
  • Test target variables dataset: y_rgs_test

So far we’ve done:

  • Download the market data.
  • Calculate the indicators that we will use as predictor variables.
  • Define the target variables.
  • Split the data into training set and test set.

With slight variations in obtaining the target variables and the procedure of splitting the data sets, the steps taken have been the same so far.

Decision Trees for Classification

Now let’s create the classification decision tree using the DecisionTreeClassifier function from the sklearn.tree library.

Although the DecisionTreeClassifier function has many parameters that I invite you to know and experiment with (help(DecisionTreeClassifier)), here we will see the basics to create the classification decision tree.

Quant

Basically refer to the parameters with which the algorithm must build the tree, because it follows a recursive approach to build the tree, we must set some limits to create it.

  • criterion: For the classification decision trees we can choose Gini or Entropy and Information Gain, these criteria refer to the loss function to evaluate the performance of a learning machine algorithm and are the most used for the classification algorithms, although it is beyond the scope of this post, basically serves us to adjust the accuracy of the model, also the algorithm to build the tree, stops evaluating the branches in which no improvement is obtained according to the loss function.
  • max_depth: Maximum number of levels the tree will have.
  • min_samples_leaf: This parameter is optimizable and indicates the minimum number of samples that we want to have in leaves.
     
from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier(criterion='gini', max_depth=3, min_samples_leaf=6)
clf

Now we are going to train the model with the training datasets, we fit the model and the algorithm would already be fully trained.

clf = clf.fit(X_cls_train, y_cls_train)
clf

Now we need to make forecasts with the model on unknown data, for this we will use 30% of the data that we had left reserved for testing and, finally, evaluate the performance of the model. But first, let’s take a graphical look at the classification decision tree that the ML algorithm has automatically created for us.

 

To download the code in this article, visit QuantInsti website and the educational offerings at their Executive Programme in Algorithmic Trading (EPAT™).

This article is from QuantInsti and is being posted with QuantInsti’s permission. The views expressed in this article are solely those of the author and/or QuantInsti and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


21872




Quant

Deep learning in Satellite imagery


By Damian Rodziewicz, Appsilon Data Science

 

In this article, I hope to inspire you to start exploring satellite imagery datasets. Recently, this technology has gained huge momentum, and we are finding that new possibilities arise when we use satellite image analysis. Satellite data changes the game because it allows us to gather new information that is not readily available to businesses.

 

Why are satellite images a unique data source? What is currently available, and what properties do you have to take into account when choosing which images to use?

Satellite images allow you to view Earth from a broader perspective. You can point to any location on Earth and get the latest satellite images of that area. Also, this information is easy to access. There are free sources that allow you to download the mapped image onto your computer, and then, you can play with it locally.

One of the most important aspects of using satellite images is that you can also browse past images of certain locations. This means that you can track how the area changed over time and predict how it will change in the future. All you have to do is define the properties that are relevant to your use case.

To give you an idea of how satellites track our progress on Earth, we have to take a look at what is above us.

Satelite-Appsilon

Source: European Space Agency

There are currently over 45 hundred satellites orbiting the Earth. Some are used for communication or GPS, but over 600 of them are regularly taking pictures of the Earth’s surface. Currently (as of end of 2018), the best available resolution is 25cm per pixel, which means that 1 pixel covers a square of 25cm x 25cm. This translates to a person taking about 3 pixels on an image.

The current technology we have actually allows us to get an even better resolution, but it is not available, as many governments don’t allow us to take more detailed images due to security reasons. Meaning, you won’t be able to access better quality unless you have security clearance.

Available sources of satellite images

The first group is free public images. Amongst them are American Landsat and European Sentinel, which are the most popular free images. Landsat will provide you images with a resolution of 30m per pixel every 14 days for any location. Sentinel will provide images with a resolution of 10m per pixel every 7 days.

There are also commercial providers, like DigitalGlobe, that can provide you with images with a resolution up to 25cm per pixel where images are available twice a day. It is important to strike a balance between the different properties that you need, as the best resolution doesn’t always mean that you get the most frequent images.

Also, cost is an important factor. The best images can cost up to a couple hundred dollars so it is wise to start building your solution with lower quality images. Just make sure you use the best ones for your particular use cases. Of course, commercial sources offer subscriptions, which will reduce the images’ cost.

Appsilon-Satelite-Data

Properties of satellite images

Let’s go through the properties that you have to balance out when choosing an image source. First is spatial resolution. As you can see, technology has been rapidly advancing, and there is more and more money being invested into launching better satellites and making them available.

The second factor is temporal resolution. This is how often you get a picture of a given place. This is an important aspect because of how clouds may block your point of interest. For example, if you only get 1 image every 7 days, and your location is in a cloudy area, then it is likely all your images in a month might be blocked by clouds, which stops you from collecting data in your area. There are some algorithms being created to mitigate this issue, however, it is still a big problem when browsing images. For the most part, it is better to get the highest possible frequency to improve your chances of getting a clean shot of the given area in the selected time frame.

Now, the third factor is interesting. It is spectral resolution. When you think about an image, you usually think of three layers: red, green, and blue; these layers compose a visual image of the area. This is because our human eye has three color-sensitive cones, which react to red, green, and blue.

Satelite Data

 

Visit Appsilon Data Science Blog to learn how to leverage satellite data source in our R projects, and to read the rest of the article:

https://appsilon.com/deep-learning-in-satellite-imagery/

 

-------------------------------------------

About Appsilon  

Our Vision: To discover tomorrow’s applications of data & apply them today. We constantly improve how data is acquired, processed and used. We are driven by using Data Science at the forefront of business, leveraging the potential of the ever increasing amount of data. https://appsilon.com/

 

 

This article is from Appsilon and is being posted with Appsilon’s permission. The views expressed in this article are solely those of the author and/or Appsilon and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


21831




Quant

A Portfolio of Leveraged Exchange Traded Funds vs. Benchmark Asset Allocation


By Quantpedia

A new interesting financial research paper gives an idea to build a diversified portfolio of leveraged ETFs (scaled down to have the same risk as a benchmark asset allocation built from a non-leveraged ETFs) to beat benchmark asset allocation. However, caution is needed as the most of the outperformance is due to inherent leveraged position in bonds because excess ratio of cash in portfolio (which is the result of using leveraged ETFs instead of non-leveraged ETFs) is invested in a short to medium term bonds:

Authors: Trainor, Chhachhi, Brown

Title: A Portfolio of Leveraged Exchange Traded Funds

Link: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3272486

Abstract:

Leveraged exchange traded funds (LETFs) are marketed as short-term trading vehicles that magnify the daily returns of an underlying index. With the proliferation of LETFs over the last 10 years, a diversified portfolio that mimics the returns of a 100% investment can be created using only a fraction of the investor’s wealth. Results suggest a portfolio created with LETFs outperforms a portfolio using traditional ETFs by approximately 0.6% to 1.4% annually by investing the excess wealth in a diversified or short to mid-duration bond portfolio. Downside risk is reduced using LETFs because the majority of the LETF portfolio is invested in a relatively safe bond fund.

To learn more about this paper, view the full article on Quantpedia website:
https://quantpedia.com/Blog/Details/a-portfolio-of-leveraged-exchange-traded-funds-vs-benchmark-asset-allocation

 

About Quantpedia

Quantpedia Mission is to process financial academic research into a more user-friendly form to help anyone who seeks new quantitative trading strategy ideas. Quantpedia team consists of members with strong financial and mathematical background (former quantitative portfolio managers and founders of Quantconferences.com) combined with members with outstanding IT and technical knowledge. Learn more about Quantpedia here: https://quantpedia.com

This article is from Quantpedia and is being posted with Quantpedia’s permission. The views expressed in this article are solely those of the author and/or Quantpedia and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


21827




1 2 3 4 5 2 43

Disclosures

We appreciate your feedback. If you have any questions or comments about IBKR Quant Blog please contact ibkrquant@ibkr.com.

The material (including articles and commentary) provided on IBKR Quant Blog is offered for informational purposes only. The posted material is NOT a recommendation by Interactive Brokers (IB) that you or your clients should contract for the services of or invest with any of the independent advisors or hedge funds or others who may post on IBKR Quant Blog or invest with any advisors or hedge funds. The advisors, hedge funds and other analysts who may post on IBKR Quant Blog are independent of IB and IB does not make any representations or warranties concerning the past or future performance of these advisors, hedge funds and others or the accuracy of the information they provide. Interactive Brokers does not conduct a "suitability review" to make sure the trading of any advisor or hedge fund or other party is suitable for you.

Securities or other financial instruments mentioned in the material posted are not suitable for all investors. The material posted does not take into account your particular investment objectives, financial situations or needs and is not intended as a recommendation to you of any particular securities, financial instruments or strategies. Before making any investment or trade, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice. Past performance is no guarantee of future results.

Any information provided by third parties has been obtained from sources believed to be reliable and accurate; however, IB does not warrant its accuracy and assumes no responsibility for any errors or omissions.

Any information posted by employees of IB or an affiliated company is based upon information that is believed to be reliable. However, neither IB nor its affiliates warrant its completeness, accuracy or adequacy. IB does not make any representations or warranties concerning the past or future performance of any financial instrument. By posting material on IB Quant Blog, IB is not representing that any particular financial instrument or trading strategy is appropriate for you.