# Blog

## Variance Ratio Test - Lo and MacKinlay (1988)

A simple test for the random walk hypothesis of prices and efficient market.

## Minimum Variance Hedge Ratio

This note briefly explains what's the minimum variance hedge ratio and how to derive it in a cross hedge, where the asset to be hedged is not the same as underlying asset.

## Winsorization in SAS

These are two versions of winsorization in SAS, of which I recommend the first one.

## Call Option Value from Two Approaches

Suppose today the stock price is $$S$$ and in one year time, the stock price could be either $$S_1$$ or $$S_2$$. You hold an European call option on this stock with an exercise price of $$X=S$$, where $$S_1<X<S_2$$ for simplicity. So you'll exercise the call when the stock price turns out to be $$S_2$$ and leave it unexercised if $$S_1$$.

## Bank Holing Company Financials from FR Y-9C

A SAS macro used to extract BHC data.

## Merge Compustat and CRSP

Using the CRSP/Compustat Merged Database (CCM) to extract data is one of the fundamental steps in most finance studies. Here I document several SAS programs for annual, quarterly and monthly data, inspired by and adapted from several examples from the WRDS.1

## Reconciliation of Black-Scholes Variants

This note is just to show that the different variants of Black-Scholes formula in textbook and tutorial solutions are in fact the same.

## Decomposing Herfindahl–Hirschman (HHI) Index

Herfindahl–Hirschman (HHI) Index is a well-known market concentration measure determined by two factors:

1. the size distribution (variance) of firms, and
2. the number of firms.

Intuitively, having a hundred similar-sized gas stations in town means a far less concentrated environment than just one or two available, and when the number of firms is constant, their size distribution or variance determines the magnitude of market concentration.

Since these two properties jointly determine the HHI measure of concentration, naturally we want a decomposition of HHI that can reflects these two dimensions respectively. This is particularly useful when two distinct markets have the same level of HHI measure, but the concentration may result from different sources. Note that here these two markets do not necessarily have to be industry A versus industry B, but can be the same industry niche in two geographical areas, for example.

Thus, we can think of HHI as the sum of the actual market state's deviation from 1) all firms having the same size, and the deviation from 2) a fully competitive environment with infinite number of firms in the market. Some simple math can solve our problem.

## Bloomberg BQuant (BQNT)

Bloomberg is developing a new function in the Terminal, called BQuant, BQNT, under the Bloomberg Anywhere license. I happen to be able to test it thanks to a fund manager and find it could be a future way of using Bloomberg Terminal.

## Compute Weekly Return from Daily CRSP Data

Computing the weekly returns from the CRSP daily stock data is a common task but may be tricky sometimes. Let's discuss a few different ways to get it done incorrectly and correctly.

TL;DR Take me to the final solution!

Surely -> The solution