272 Pages 33 B/W Illustrations
    by Chapman & Hall

    272 Pages 33 B/W Illustrations
    by Chapman & Hall

    This textbook shows how to bring theoretical concepts from finance and econometrics to the data. Focusing on coding and data analysis with Python, we show how to conduct research in empirical finance from scratch. We start by introducing the concepts of tidy data and coding principles using pandas, numpy, and plotnine. Code is provided to prepare common open-source and proprietary financial data sources (CRSP, Compustat, Mergent FISD, TRACE) and organize them in a database. We reuse these data in all the subsequent chapters, which we keep as self-contained as possible. The empirical applications range from key concepts of empirical asset pricing (beta estimation, portfolio sorts, performance analysis, Fama-French factors) to modeling and machine learning applications (fixed effects estimation, clustering standard errors, difference-in-difference estimators, ridge regression, Lasso, Elastic net, random forests, neural networks) and portfolio optimization techniques.

    Key Features:

    • Self-contained chapters on the most important applications and methodologies in finance, which can easily be used for the reader’s research or as a reference for courses on empirical finance.
    • Each chapter is reproducible in the sense that the reader can replicate every single figure, table, or number by simply copying and pasting the code we provide.
    • A full-fledged introduction to machine learning with scikit-learn based on tidy principles to show how factor selection and option pricing can benefit from Machine Learning methods.
    • We show how to retrieve and prepare the most important datasets financial economics: CRSP and Compustat, including detailed explanations of the most relevant data characteristics.
    • Each chapter provides exercises based on established lectures and classes which are designed to help students to dig deeper. The exercises can be used for self-studying or as a source of inspiration for teaching exercises.

    Preface

    Author Biographies

    Part 1: Getting Started

    1. Setting Up Your Environment

    2. Introduction to Tidy Finance

    Part 2: Financial Data

    3. Accessing and Managing Financial Data

    4. WRDS, CRSP, and Compustat

    5. TRACE and FISD

    6. Other Data Providers

    Part 3: Asset Pricing

    7. Beta Estimation

    8. Univariate Portfolio Sorts

    9. Size Sorts and p-Hacking

    10. Value and Bivariate Sorts

    11. Replicating Fama and French Factors

    12. Fama-MacBeth Regressions

    Part 4: Modeling and Machine Learning

    13. Fixed Effects and Clustered Standard Errors

    14. Difference in Differences

    15. Factor Selection via Machine Learning

    16. Option Pricing via Machine Learning

    Part 5: Portfolio Optimization

    17. Parametric Portfolio Policies

    18. Constrained Optimization and Backtesting

    Appendices

    A. Colophon

    B. Proofs

    C. WRDS Dummy Data

    D. Clean Enhanced TRACE with Python

    E. Cover Image

    Bibliography

    Index

    Biography

    Christoph Frey is a Quantitative Researcher and Portfolio Manager at a family office in Hamburg and a Research Fellow at the Centre for Financial Econometrics, Asset Markets and Macroeconomic Policy at Lancaster University. Prior to this, he was the leading quantitative researcher for systematic multi-asset strategies at Berenberg Bank and worked as an Assistant Professor at the Erasmus Universiteit Rotterdam. Christoph published research on Bayesian Econometrics and specializes in financial econometrics and portfolio optimization problems.

    Christoph Scheuch is the Head of Artificial Intelligence at the social trading platform wikifolio.com. He is responsible for researching, designing, and prototyping of cutting-edge AI-driven products using R and Python. Before his focus on AI, he was responsible for product management and business intelligence at wikifolio.com and an external lecturer at the Vienna University of Economics and Business, where he taught finance students how to manage empirical projects.

    Stefan Voigt is an Assistant Professor of Finance at the Department of Economics at the University in Copenhagen and a research fellow at the Danish Finance Institute. His research focuses on blockchain technology, high-frequency trading, and financial econometrics. Stefan's research has been published in the leading finance and econometrics journals and he received the Danish Finance Institute Teaching Award 2022 for his courses for students and practitioners on empirical finance based on Tidy Finance.

    Patrick Weiss is an Assistant Professor of Finance at Reykjavik University and an external lecturer at the Vienna University of Economics and Business. His research activity centers around the intersection of empirical asset pricing and corporate finance, with his research appearing in leading journals in financial economics. Patrick is especially passionate about empirical asset pricing and strives to understand the impact of methodological uncertainty on research outcomes.

    “A fantastic book bringing together financial theory, sound econometrics, thorough data processing and powerful programming techniques using R. An absolute must for every student and scholar in empirical finance.”

    Nikolaus Hautsch, Professor of Finance & Statistics at University of Vienna

    “Tidy Finance is a fantastic resource that lowers the threshold for entry into empirical finance, all in the spirit of open and reproducible science.”

    Björn Hagströmer, Professor of Finance at Stockholm Business School

    “To have a deep understanding of empirical asset pricing, one needs to write code using actual data. To learn how to do this, there is no better starting point than Tidy Finance. [...] I strongly recommend Tidy Finance to both beginners and experts.”

    Raman Uppal, Professor of Finance at EDHEC Business School

    “Students and professionals alike are led step by step until they suddenly find themselves coding on their own. A brilliant and required resource!”

    Mark Salmon, Professor of Economics at University of Cambridge