## Display PageViews and List of Popular Posts on a Static Site

##### Sep 6, 2019

A static site, like this one based on Hugo, cannot easily display site statistics. But there’s a solution. When the page is loaded on the client side, a Javascript pulls the relevant statistics from my server then render it to the page. The server runs a small Python program to contact Google Analytics API in order to get the statistics and return to the frontend. We can even use it to build a list of popular posts. ...

## Beta - Unlevered and Levered

##### Sep 5, 2019

Beta is a measure of market risk. Unlevered Firm $u$ If a firm has no debt, it’s all equity-financed and thus its equity’s beta $\beta_{E}$ equals its asset’s beta $\beta_{A}$. This beta is also the unlevered beta, $\beta_{\text{unlevered}}$, since it’s unaffected by leverage. The unlevered beta measures the market risk exposure of the firm’s shareholders. Let’s call this firm $u$, Hence, we have: $$\beta_{\text{unlevered}}=\beta_E^u=\beta_A^u$$ This equality says that in an unlevered firm, the unlevered beta equals its equaity beta and its asset beta. ...

...

## LeGao to Make Your Own LEGO Mosaics

##### Aug 27, 2019

I made an online app that turns a picture into a LEGO mosaic, available at mingze-gao.com/legao. A few weeks ago, I went to the new LEGO flagship store at Bondi with my fiancee, Sherry, and we were impressed by the LEGO Mosaics – Sydney Harbour Bridge and Opera House in sunset, designed by Ryan McNaught (photo credit: jaysbrickblog.com). This mosaic is made of 62,300 bricks and took 282 hours to build. ...

## Timetable for Tutorial, Workshop and Consultation

##### Aug 8, 2019

Below is the schedule of my tutorials, workshops and consulations, if any, for the current and past semesters since 2018.

...

## Identify Chinese State-Owned Enterprise using CSMAR

##### Aug 6, 2019

Many research papers on Chinese firms include a control variable that indicates if the firm is a state-owned enterprise (SOE). This is important as SOEs and non-SOEs differ in many aspects and may have “structural differences”. This post documents the way to construct this indicator variable from the CSMAR databases. Specifically, we need the CSMAR China Listed Firms Shareholders - Controlling Shareholders dataset. On WRDS, this dataset is named hld_contrshr, located at /wrds/csmar/sasdata/hld. ...

## When Costly Small Loans are the Best Option

##### Jul 31, 2019

This is a case study about why sometimes a costly small loan may be the only way out for certain people, adapted from the report of Trends in the Australian Small Loan Market by the Australian Centre for Financial Studies. I add some discussions and further questions in the end. Case Study Background Alice is a single mom with children who relies only on Centrelink payments. Her refrigerator suddenly broke and she needs a new one as soon as possible before the frozen food for the family perishes. ...

## Decomposing Herfindahl–Hirschman (HHI) Index

##### Jul 23, 2019

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. ...