Code & Data

CHAPTER 1: CHOOSING YOUR PRODUCT

BOX 1-3: CASE STUDY: INCENTIVES ALIGNMENT MODEL

BOX 1-4: CASE STUDY: “WHAT ARE THE HIDDEN COSTS OF GATES, LOCKUPS, AND SETTLEMENT PERIODS?”

CHAPTER 2: THE INVESTMENT PROCESS

CHAPTER 3: LEADERSHIP AND GOVERNANCE

  • Examples of a business case will appear in my next book. For copyright reasons, it is available only by request.
  • Examples of an investment policy statement will appear in my next book. For copyright reasons, it is available only by request.
  • Examples of investment due diligence will appear in my next book. For copyright reasons, it is available only by request.

CHAPTER 4: ASSET TYPES

BOX 4-1: VXX VS. VIX

FIGURE 4-3: ILLIQUID ASSETS CONSTRAIN OTHER ALLOCATIONS

BOX 4-2: A CRYPTOCURRENCY ARBITRAGE EXAMPLE

CHAPTER 5: FINANCIAL DATA

ORGANIZING FINANCIAL DATA

  • LARGE FILES AND BIG DATA https://www.mathworks.com/help/matlab/large-files-and-big-data.html
  • SPLAYED DATA (CODE)
  • SPLAYED DATA (DESCRIPTION) https://thinqkdb.wordpress.com/splayed-tables/

CAPITAL MARKETS ASSUMPTIONS

  • FIDUCIENT CAPITAL MARKETS ASSUMPTIONS
  • CODE TO CONVERT FIDUCENT CMAS TO OPTIMIZER INPUTS https://www.mathworks.com/matlabcentral/fileexchange/130689-scrape-fiducient-capital-markets-assumptions-and-other-table
  • BLACKROCK CAPITAL MARKETS ASSUMPTIONS https://www.blackrock.com/institutions/en-us/insights/charts/capital-market-assumptions
  • JPMORGAN CAPITAL MARKETS ASSUMPTIONS https://am.jpmorgan.com/us/en/asset-management/institutional/insights/portfolio-insights/ltcma/?gad=1&gclid=Cj0KCQjwj_ajBhCqARIsAA37s0yI3ylON-h7LtUJG-reVtYAdwZXUyanXLrLqo8WNuNANmSgiRcUfLsaAnTdEALw_wcB&gclsrc=aw.ds

ECONOMIC DATA

– NON-ARCHIVAL DATA

  • BLOOMBERG ECONOMIC DATA
  • CAPITIALIQ ECONOMIC DATA
  • REFINITIV ECONOMIC DATA

– ARCHIVAL DATA

  • ALFRED ECONOMIC DATA https://alfred.stlouisfed.org/

BULK AND DESCRIPTIVE DATA

  • MORNINGSTAR DESCRIPTIVE DATA www.morningstar.com (Morningstar access is available in the business library on campus)
  • BLOOMBERG DESCRIPTIVE DATA www.bloomberg.com (Bloomberg terminals are easy to find all over campus)
  • REFINITIV DESCRIPTIVE DATA www.refinitiv.com (Refinitiv terminals can be download on your computer from the Columbia library website).

FUNDAMENTAL DATA

  • BLOOMBERG FUNDAMENTAL DATA www.bloomberg.com
  • PARSE BLOOMBERG PORT HOLDINGS TREND DATA (CODE) https://www.mathworks.com/matlabcentral/fileexchange/132358-parse-bloomberg-port-holdings-trend-report
  • EDGAR FUNDAMENTAL DATA https://www.sec.gov/edgar/search-and-access
  • CRSP/COMPUSTAT MERGED DATABASE – FUNDAMENTALS QUARTERLY https://wrds-www.wharton.upenn.edu/pages/get-data/center-research-security-prices-crsp/annual-update/crspcompustat-merged/fundamentals-quarterly/
  • CRSP/COMPUSTAT MERGED – FUNDAMENTALS ANNUAL https://wrds-www.wharton.upenn.edu/pages/get-data/center-research-security-prices-crsp/quarterly-update/crspcompustat-merged/fundamentals-annual/
  • CRSP/COMPUSTAT FUNDAMENTAL FIELDS

SURVEY DATA

SAMPLING AND SYNTHETIC DATA

  • OVER- AND UNDERSAMPLING (E.G. SMOTE) SCRIPT
  • GIBBS SAMPLER FOR HIGH-FREQUENCY GDP AND PREDICTION

MARKET DATA

  • 3,500 ETF INVESTMENT UNIVERSE
  • BLOOMBERG ADJUSTED PRICES https://www.mathworks.com/matlabcentral/fileexchange/130684-load-adjusted-prices-from-bloomberg
  • BLOOMBERG ADJUSTED PRICES SCRIPT https://www.mathworks.com/matlabcentral/fileexchange/130729-load-large-bloomberg-excel-data-file
  • LOAD LARGE BLOOMBERG EXCEL DATA FILE SCRIPT
  • CRSP ADJUSTED PRICES
  • CRSP ADJUSTED PRICES AND TOTAL RETURNS TO PRICESTT SCRIPT https://www.mathworks.com/matlabcentral/fileexchange/130674-crsp-to-matlab-adjusted-prices-and-total-returns
  • YAHOO! ADJUSTED PRICES
  • YAHOO! ADJUSTED PRICES SCRIPT https://www.mathworks.com/matlabcentral/fileexchange/130679-download-yahoo-adjusted-prices
  • MORNINGSTAR ADJUSTED PRICES
  • MORNINGSTAR ADJUSTED PRICES SCRIPT
  • YCHARTS ADJUSTED PRICES
  • YCHARTS ADJUSTED PRICES SCRIPT

MODEL PORTFOLIO HISTORY

  • 101 ROBOADVISORS
  • PROPRIETARY MODELS
  • MARKET IMPLIED PORTFOLIOS
  • BENCHMARK AND MODEL PERFORMANCE HISTORY
  • ROLLING RETURNS AND YEARLY RETURNS SCRIPT https://www.mathworks.com/matlabcentral/fileexchange/130974-rolling-returns-and-yearly-returns

BENCHMARK HISTORY

  • S&P 500 CONSTITUENT HISTORY
  • MSCI ALL COUNTRY WORLD INDEX (ACWI ) CONSTITUENT HISTORY
  • MSCI ALL COUNTRY WORLD INDEX (ACWI) SECTOR AND GEOGRAPHIC HISTORY
  • PREQIN PRIVATE EQUITY DATA https://wrds-www.wharton.upenn.edu/pages/get-data/preqin/private-equity/
  • PREQIN VENTURE CAPITAL DATA https://wrds-www.wharton.upenn.edu/pages/get-data/preqin/venture-capital/

MISSING DATA

Vector Error Correction  https://www.youtube.com/watch?v=ew4bHzIS4Sw&ab_channel=MATLAB

SAMPLING AND SYNTHETIC DATA

BOX 5-2: USING A GIBBS SAMPLER TO CHANGE FREQUENCY

BOX 5-3: ROLL EXAMPLE

BOX 5-5 CASE STUDY: RIA DATA

  • MTSS-GAN Derek Snow, MTSS-GAN”
  • Time GAN: TimeGAN/tutorial_timegan.ipynb at master ú jsyoon0823/TimeGAN ú GitHub
  • Cholesky Method https://www.mathworks.com/help/finance/portsim.html
  • Monte Carlo with Copulas: https://www.mathworks.com/help/stats/copulas-generate-correlated-samples.html

HIGH FREQUENCY AND BIG DATA

  • NYSE TAQ https://wrds-www.wharton.upenn.edu/pages/get-data/nyse-trade-and-quote/
  • KDB+ 4/5 COLUMN UPLOAD SCRIPT
  • HIGH-FREQUENCY TRANSACTIONS USING DATASTORE, TALL ARRAYS, AND THE KDB+ API”
  • KDB+ WRDS/TAQ UPLOAD SCRIPT

CHAPTER 6: FEATURES

  • SECTOR AND GEOGRAPHIC MAPS
  • INFLATION PROTECTION FEATURES
  • DIVIDEND GROWTH FEATURES
  • QUALITY GROWTH FEATURES
  • ESG FEATURES
  • FIXED INCOME FEATURES
  • TAX-LOSS HARVESTING FEATURES

“PREPROCESSING, MISSING DATA, & OUTLIERS”

  • MISSING AND MINORITY DATA GENERATION USING BORDERLINE SMOTE

FEATURE EXTRACTION

TEMPORAL TRANSFORMATIONS

SYNTHETIC DATA GENERATION

  • TIME-GANN SYNTHETIC FINANCIAL DATA GENERATION FOR MONTE CARLO ANALYSIS

CHAPTER 7: FINANCIAL AND ECONOMIC FACTORS

FEATURE COMPLEXITY AND HIERARCHY

  • FOOTNOTE 4 & FIGURE 7-1: LAYERING MODELS IN AN ECONOMICALLY INTUITIVE HIERARCH

DESCRIPTIVE FEATURES

BLOOMBERG DESCRIPTIVE FEATURES

MORNINGSTAR DESCRIPTIVE FEATURES

ECONOMIC FEATURES

  • FOOTNOTE 8: GIBBS SAMPLER

CROSS-ASSET FEATURES

ASSET AND MARKET FEATURES

  • FOOTNOTE 17: ECONOMIC SURPRISE

ALTERNATIVE FEATURES

EXECUTION FEATURES

FEATURE CONDITIONING AND TIMING

FACTOR EFFICACY

MECHANISTIC TRANSFORMATIONS

CHAPTER 8: CREATING FACTOR FORECASTS

CAPITAL MARKETS ASSUMPTIONS

STRATEGIC FORECASTING

TACTICAL FORECASTING

RISK PREMIA

FIXED INCOME PREMIA

  • FOOTNOTE 13: PAR YIELD CURVE

EQUITY PREMIA

OTHER PREMIA

CHAPTER 9: STRATEGY, OBJECTIVE, & CONDITIONS

REMOVING TIME DEPENDENCE

FIXED HORIZON VERSUS PATH DEPENDENCY

“ALLOCATION, SELECTION, DIRECTION, TIMING, AND QUANTITY”

CHAPTER 10: TIME SERIES & CROSS-SECTIONAL ANALYSIS

  • ECONOMETRICS MODELLER APP https://www.mathworks.com/help/econ/econometric-modeler-overview.html
  • REGRESSION LEARNER APP https://www.mathworks.com/help/stats/regression-learner-app.html
  • CLASSIFICATION LEARNER APP https://www.mathworks.com/help/stats/classificationlearner-app.html
  • DEEP NETWORK DESIGNER APP https://www.mathworks.com/help/deeplearning/deep-network-designer-app.html
  • REINFORCEMENT LEARNING DESIGNER APP https://www.mathworks.com/help/reinforcement-learning/ug/design-dqn-using-rl-designer.html

CHAPTER 11: ALPHA AND RISK MODELS

CHAPTER 12: ASSET ALLOCATION

  • PORTFOLIO OPTIMIZATION OBJECT (INCLUDING CVAR OPTIMIZATION
  • BLACK-LITTERMAN PORTFOLIO OPTIMIZATION USING FACTORS https://www.mathworks.com/help/finance/asset-allocation-and-portfolio-optimization.html

CHAPTER 13: SECURITY SELECTION

  • ECONOMETRICS FOR SECURITY SELECTION
  • REGRESSION LEARNER FOR SECURITY SELECTION
  • CLASSIFICATION LEARNER FOR SECURITY SELECTION
  • DEEP LEARNING FOR SECURITY SELECTION
  • REINFORCEMENT LEARNER FOR SECURITY SELECTION
  • UEC (ENVIRONMENTAL SOCIAL & GOVERNANCE (ESG) HEDGE FUND) DATA & SCREENS

CHAPTER 14: BACKTESTING

  • BACKTESTING FRAMEWORK
  • EMSC ORDER SIMULATION OBJECT AND TEST CODE
  • ENHANCED BACKTESTING OBJECT

CHAPTER 15: TRANSACTION COSTS & FEES

  • ENHANCED TCA OBJECT
  • ENHANCED KX/KDB+/Q OBJECT
  • TRANSACTION COST ANALYSIS DATABASE BUILDER
  • TRANSACTION COST ANALYSIS FORECAST
  • TRANSACTION COST ANALYSIS POST-ANALYSIS
  • TRANSACTION COST ANALYSIS RECALIBRATION TOOL

CHAPTER 16: REBALANCING AND TAXES

  • TAX-LOSS HARVESTING PERFORMANCE CALCULATOR
  • TAX-LOSS HARVESTING TRADE RECOMMENDATION

CASE STUDY: PERFORMANCE OF THE LARGEST 101 ROBOADVISORS

CHAPTER 17: TIME SERIES & CROSS-SECTIONAL ANALYSIS

CASE STUDY: VECTOR ERROR CORRECTING (VEC) VS DYNAMIC STOCHASTIC GENERAL EQUILIBRIUM MODEL (DSGE)

  • VECTOR ERROR CORRECTING (VEC)
  • DYNAMIC STOCHASTIC GENERAL EQUILIBRIUM MODEL (DSGE)

CHAPTER 18: PERFORMANCE & RISK MANAGEMENT

CHAPTER 19: INVESTMENT, RISK, & CASH MANAGEMENT

CASE STUDIES

CASE STUDY: FEE ENGINEERING

CASE STUDY: GATES, LOCKUPS, AND SETTLEMENT PERIODS

CASE STUDY: CONTAGION

CASE STUDY: ECONOMIC SURPRISE

CASE STUDY: QUANTEMENTAL GTAA

CASE STUDY: ESG TAA

CASE STUDY: SOUTH AFRICAN TAA

CASE STUDY: LAZY (OPPORTUNISTIC) REBALANCING

OTHER RESOURCES

TEXTBOOK

* http://www.quantitativeassetmanagement.com/

DATA

* Datasets: Obtain a WRDS account https://www8.gsb.columbia.edu/itg/faculty/research_at_cbs/database/wrdsrequest

* CRSP/COMPUSTAT MERGED DATABASE – SECURITIES DAILY https://wrds-www.wharton.upenn.edu/pages/get-data/center-research-security-prices-crsp/annual-update/crspcompustat-merged/security-daily/

* CRSP MUTUAL FUNDS – HOLDINGS https://wrds-www.wharton.upenn.edu/pages/get-data/center-research-security-prices-crsp/quarterly-update/mutual-funds/portfolio-holdings/

* FINANCIAL RATIOS https://wrds-www.wharton.upenn.edu/pages/get-data/financial-ratios-suite-wrds/

* INTRADAY INDICATORS https://wrds-www.wharton.upenn.edu/pages/get-data/intraday-indicators-wrds/

* VENTURE CAPITAL https://wrds-www.wharton.upenn.edu/pages/get-data/wrds-venture-capital/

* FACTORS https://wrds-www.wharton.upenn.edu/pages/get-data/wrds-factors/

* SEC ANALYTICS https://wrds-www.wharton.upenn.edu/pages/get-data/wrds-sec-analytics-suite/

* I/B/E/S ANALYSTS’ FORCAST DETAIL HISTORY https://wrds-www.wharton.upenn.edu/pages/get-data/ibes-thomson-reuters/ibes-academic/detail-history/detail/

* THOMSON REUTERS MUTUAL FUND HOLDINGS – S12 MASTER FILE https://wrds-www.wharton.upenn.edu/pages/get-data/thomson-reuters/mutual-fund-holdings-s12/s12-master-file/

* THOMPSON/REFINITIV DATASTREAM DAILY INDEX CONSTITUENTS https://wrds-www.wharton.upenn.edu/pages/get-data/thomson-reuters/datastream/equities-data/dly_index_const/

* NEW YORK STOCK EXCHANGE & AMERICAN STOCK EXCHANGE & NASDAQ NATIONAL MARKET SYSTEM MILLISECOND TRADE AND QUOTE DATABASE https://wrds-www.wharton.upenn.edu/pages/get-data/nyse-trade-and-quote/

SOFTWARE

* Install MATLAB https://www.mathworks.com/academia/tah-portal/columbia-university-650045.html

 

BIG DATA

* Review and run this example: https://www.mathworks.com/help/matlab/large-files-and-big-data.html

* Review and run the examples at the BOTTOM of this page:  https://www.mathworks.com/products/datafeed.html

BACKTESTING

* Review and run this example: https://www.mathworks.com/help/finance/portfolio-backtest-framework.html?s_tid=CRUX_lftnav

* Review and run this example: https://www.mathworks.com/videos/backtesting-strategy-framework-in-financial-toolbox-1606119787183.html

* Review and run this example: https://www.mathworks.com/help/finance/backtest-investment-strategies.html

* Review and run this example: https://www.mathworks.com/help/finance/backtest-investment-strategies-with-trading-signals.html

* Review and run this example: https://www.mathworks.com/help/finance/backtesting-using-risk-based-equity-indexation.html

* Review and run this example:  https://www.mathworks.com/help/finance/backtest-strategies-using-deep-learning.html

* Review available code here: http://www.quantitativeassetmanagement.com/computercode/

TRADING

* Read https://www.mathworks.com/help/datafeed/bloomberg-emsx.html

* Read https://www.schwab.com/learn/story/stock-order-types-and-conditions-overview

* Have a quick look at https://emsx-api-doc.readthedocs.io/en/latest/

* Read https://www.backtrader.com/docu/

* Watch https://www.mathworks.com/videos/series/getting-started-with-trading-toolbox-94461.html

MARKET IMPACT

* Source data from papers like https://arxiv.org/abs/1705.03233

* Source data from Github like https://github.com/rorysroes/SGX-Full-OrderBook-Tick-Data-Trading-Strategy

* Source data from WRDS (you need an account from the library) https://wrds-www.wharton.upenn.edu/

* Source data from paid services (e.g. LOBSTER) https://lobsterdata.com/

* Look for open-source data like https://awesomeopensource.com/projects/orderbook

* Contact X and ask for data from LOBSTER

* Review and run this example: https://www.mathworks.com/videos/feature-extraction-using-diagnostic-feature-designer-app-1551178861512.html?s_tid=srchtitle_learner%20app_6

* Review and run this example: https://www.mathworks.com/videos/classify-data-using-the-classification-learner-app-106171.html

* Review and run this example: https://www.mathworks.com/help/matlab/large-files-and-big-data.html

* Review and run this example: https://www.mathworks.com/videos/forecast-electrical-load-using-the-regression-learner-app-1536231842528.html?s_tid=srchtitle_regression%20learner%20app_1

* Run this code: https://www.mathworks.com/help/finance/deep-reinforcement-learning-for-optimal-trade-execution.html 

PORTFOLIO CONSTRUCTION

* Review and run this example: https://www.mathworks.com/help/finance/portfolio-optimization-examples.html

* Review and run this example: https://www.mathworks.com/help/finance/portfolio-optimization-against-a-benchmark.html

* Review and run this example: https://www.mathworks.com/help/finance/backtest-investment-strategies.html

* Review and run this example: https://www.mathworks.com/help/finance/backtest-investment-strategies.html

* Review and run this example: https://www.mathworks.com/help/finance/backtest-investment-strategies-with-trading-signals.html

* Review and run this example: https://www.mathworks.com/help/finance/backtest-strategies-using-deep-learning.html

* Review and run this example: https://www.mathworks.com/help/finance/portfolio-optimization-using-social-constraints.html

* Review and run this example: https://www.mathworks.com/help/finance/diversification-of-esg-portfolios.html

* Review and run this example: https://www.mathworks.com/help/finance/backtesting-using-risk-based-equity-indexation.html

* Review and run this example: https://www.mathworks.com/help/finance/create-hierarchical-risk-parity-portfolio.html

* Review and run this example: https://www.mathworks.com/help/finance/diversify-portfolio-using-custom-objective-function.html

* Review and run this examplehttps://www.mathworks.com/help/finance/custom-objective-function-for-min-variance-with-tracking-error-penalty.html

* Review and run this example: https://www.mathworks.com/help/finance/black-litterman-portfolio-optimization.html

* Review and run this example: https://www.mathworks.com/help/finance/portfolio-optimization-using-factor-models.html

* Review and run this example: https://www.mathworks.com/help/finance/asset-allocation-case-study.html

* Review and run this example: https://www.mathworks.com/help/finance/create-risk-budgeting-portfolio.html

* Review and run this example: https://www.mathworks.com/help/finance/using-custom-objective-function-for-min-tracking-return-with-net-return-constraint.html

* Review and run this example: https://www.mathworks.com/help/finance/hedging-using-cvar-portfolio-optimization.html

* Review and run this example: https://www.mathworks.com/help/finance/compute-maximum-reward-to-risk-using-cvar-portfolio-optimization.html

* Review and run this example: https://www.mathworks.com/help/finance/mixed-integer-mad-portfolio-optimization-problem.html

* Review and run this example: https://www.mathworks.com/help/finance/index.html?s_tid=CRUX_topnav

* Review available code here: http://www.quantitativeassetmanagement.com/computercode/

PERFORMANCE

* Read about GICS: https://www.msci.com/our-solutions/indexes/gics

* Review and run this example: https://www.mathworks.com/help/finance/investment-performance-metrics-1.html

SCENARIOS AND STRESS

“* Read https://www.bloomberg.com/professional/blog/whats-worst-nightmare-heres-find-portfolio-ready/#:~:text=Bloomberg%27s%20scenario%20analysis%20tool%20in,a%20group%20of%20risk%20factors.”

* Review and run this example: https://www.mathworks.com/help/finance/investment-performance-metrics-1.html