Git Product home page Git Product logo

stock-indexing-optimization's Introduction

Stock-Indexing-Optimization

Problem Statement

Create an index fund with "m" stocks to track the NASDAQ-100 index with "n" stocks, where m << n.

Constructing an index fund that tracks a specific broad market index could be done by simply purchasing all n stocks in the index, with the same weights as in the index. However, this approach is impractical (many small positions) and expensive (rebalancing costs may frequently be incurred, price response to trading). An index fund with m stocks, where m is substantially smaller than the size of the target population, n, seems desirable.

Approach

Method (i): Solving one Integer Programming and one Linear Programming problem

We created the index fund in multiple steps. First, we formulated an integer program that picked exactly m out of n stocks for our portfolio. This integer program took as input a ‘similarity matrix’, which we call 𝜌. The individual elements of this matrix, 𝜌ij, represent daily return correlation between stock i and j. Next, we solved a linear program to decide how many of each chosen stock to buy for your portfolio and finally evaluate how well our index fund does as compared to the NASDAQ-100 index, out of sample.

Method (ii): Solving one Mixed Integer Programming problem

This approach involved creating the index fund in a single shot by solving a mixed integer programming problem. We re-formulated the weight selection problem to be an MIP that constraints non-zero weights to be an integer. This problem solves for both stock selection and weight allocation in a single attempt.

Tracking error comparison

image

The main difference between the two approaches is that the first approach calculates stock selection and the weights separately, while the second approach ignores the stock picking aspect and calculates the weights and stocks used in one step. Both approaches have the same general trend with additional stocks decreasing the tracking error, but at the 60-stock mark the first approach diverges significantly.

stock-indexing-optimization's People

Contributors

aniketcomps avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.