Tidy Finance Blog
tidyfinance is an Python package that contains a set of helper functions for empirical research in financial economics, addressing a variety of topics covered in this book. We designed the package to provide easy shortcuts for the applications that we discuss in the book. If you want to inspect the details of the package or propose new features, feel free to visit the package repository on Github…
import pandas as pd import numpy as np import datetime as dt In this chapter, we extend the univariate portfolio analysis of Univariate Portfolio Sorts to bivariate sorts, which means we assign stocks to portfolios based on two characteristics. Bivariate sorts are regularly used in the academic asset pricing literature and are the basis for factors in the Fama-French three-factor model. However, …
Tidy Finance is an opinionated approach to empirical research in financial economics - a fully transparent, open-source code base in multiple programming languages. A clean coding environment is a prerequisite for building a relevant investment platform and conducting meaningful factor research. Tidy Finance is the name of the game, giving aspiring academics and finance practitioners just what th…
Optimal Portfolio Choice Minimum variance portfolio The minimum variance portfolio weights are given by the solution to \[\omega_\text{mvp} = \arg\min \omega'\Sigma \omega \text{ s.t. } \iota'\omega= 1,\] where \(\iota\) is an \((N \times 1)\) vector of ones. The Lagrangian reads \[ \mathcal{L}(\omega) = \omega'\Sigma \omega - \lambda(\omega'\iota - 1).\] We can solve the first-order conditions o…
Optimal Portfolio Choice Minimum variance portfolio The minimum variance portfolio weights are given by the solution to \[\omega_\text{mvp} = \arg\min \omega'\Sigma \omega \text{ s.t. } \iota'\omega= 1,\] where \(\iota\) is an \((N \times 1)\) vector of ones. The Lagrangian reads \[ \mathcal{L}(\omega) = \omega'\Sigma \omega - \lambda(\omega'\iota - 1).\] We can solve the first-order conditions o…
tidyfinance is an R package that contains a set of helper functions for empirical research in financial economics, addressing a variety of topics covered in this book. We designed the package to provide easy shortcuts for the applications that we discuss in the book. If you want to inspect the details of the package or propose new features, feel free to visit the package repository on Github. Ins…
The providers of this website (www.tidy-finance.org) and its sites are Christoph Frey, Christoph Scheuch, Stefan Voigt, and Patrick Weiss. Direct inquiries related to its contents to [email protected]. The use of the website is free of charge. Various open-source licenses govern parts of the distributed content (such as packages or programming languages) created by third parties, and any further …
Join our mission to support reproducible finance by contributing to the Tidy Finance Blog. The blog follows our endeavors to increase transparency in financial economics and opens a new channel for you. We actively encourage the finance community to share their insights on coding. We hope to inspire others to share their code publicly and take part in our journey toward more reproducible research…
Tidy Finance is and will remain an open-source project. We are grateful for all the support we have received so far. Of course, we do not force anybody to support us, but every gesture is very much appreciated. We have three options if you want to give something back and support our efforts. Moreover, most options come at no additional cost to you, i.e., they just increase our share of the pie. W…
Experimental and external contributions based on Tidy Finance with R. Contribute your ideas! No matching items Experimental and external contributions based on Tidy Finance with R. Contribute your ideas!
library(RSQLite) library(dbplyr) We recently updated our data handling procedures from SQLite to Parquet files. This change was made to improve performance and cross-programming language consistency. However, we understand that some users may still need access to the legacy SQLite database. Therefore, the following blog post contains the code snippets and (in a condensed form), the previous expla…
import pandas as pd import numpy as np from fmpapi import fmp_get from plotnine import * from mizani.formatters import percent_format from adjustText import adjust_text Financial statements and ratios are fundamental tools for understanding and evaluating companies. While we discuss how assets are priced in equilibrium in the previous chapter on the Capital Asset Pricing Model, this chapter exami…
library(tidyverse) library(tidyfinance) library(RSQLite) library(readxl) library(janitor) In this blog post, we show how to obtain and analyze shareholder proposal voting data for publicly listed firms in the US. For context, the SEC allows shareholders to submit proposals a few months before the annual general meeting (AGM), and these proposals end up on the ballot and are voted on if (1) a firm…
library(tidyverse) library(tidyfinance) library(RSQLite) library(readxl) library(janitor) In this blog post, we show how to obtain and analyze shareholder proposal voting data for publicly listed firms in the US. For context, the SEC allows shareholders to submit proposals a few months before the annual general meeting (AGM), and these proposals end up on the ballot and are voted on if (1) a firm…
import pandas as pd import numpy as np import io import re import zipfile from curl_cffi import requests In this chapter, we suggest a way to organize your financial data. Everybody who has experience with data is also familiar with storing data in various formats like CSV, XLS, XLSX, or other delimited value storage. Reading and saving data can become very cumbersome when using different data fo…
import pandas as pd import numpy as np import tidyfinance as tf import pyarrow as pa import pyarrow.parquet as pq import pyarrow.dataset as ds from plotnine import * from mizani.formatters import comma_format, percent_format from datetime import datetime This chapter shows how to connect to Wharton Research Data Services (WRDS), a popular provider of financial and economic data for research appli…
library(tidyverse) library(tidyfinance) library(arrow) library(dbplyr) This chapter shows how to connect to Wharton Research Data Services (WRDS), a popular provider of financial and economic data for research applications. We use this connection to download the most commonly used data for stock and firm characteristics, CRSP and Compustat. Unfortunately, this data is not freely available, but mo…
library(tidyverse) library(tidyfinance) library(scales) In this chapter, we suggest a way to organize your financial data. Everybody who has experience with data is also familiar with storing data in various formats like CSV, XLS, XLSX, or other delimited value storage. Reading and saving data can become very cumbersome in the case of using different data formats, both across different projects a…
install.packages("tidyfinance") We are happy to annouce the release of version 0.4.0 of the tidyfinance R package on CRAN. The package contains a set of helper functions for empirical research in financial economics, addressing a variety of topics covered in Tidy Finance with R (TFWR). We designed the package to provide easy shortcuts for the applications that we discuss in the book. If you want …
research.ioSign up to keep scrolling
Create your feed subscriptions, save articles, keep scrolling.