Posts by Tags

Asset Pricing

Capital Asset Pricing Model (CAPM) with CARA Utility and Normal Returns Permalink

Published:

Starting from investors with CARA utility and normal returns, the note solves one investor’s portfolio problem, rescales it into the super-efficient portfolio with the highest Sharpe ratio, shows market clearing turns it into the market portfolio, and reads the beta relation off that condition.

Data Structures Application

How to Design a Limit Order Book? Permalink

Published:

This note aims to answer, but is not limited to, these questions: (i) what operations interact with a limit order book? (ii) what data structures are involved to build a limit order book? (iii) what are market makers? and what are the design principles of limit order book?

OLS as Orthogonal Projection Permalink

Published:

The note treats OLS as pure linear algebra — no randomness anywhere — deriving the closed form from the first-order condition, pinning existence and uniqueness on linear independence of the regressor columns, and then reading off three fitting properties that follow from residual orthogonality alone.

Econometrics

OLS as a Statistical Estimator Permalink

Published:

The companion to the linear-algebra view: here OLS is a random object, checked against unbiasedness, consistency, and efficiency, pushed through the central limit theorem to asymptotic normality, and closed with the degrees-of-freedom-corrected variance estimator that makes the t-statistic usable.

Life Thought

How Can We Constantly Be Happy? Permalink

Published:

The note treats constant happiness as a loop rather than a state — happiness and sadness define each other, so sadness is the price already agreed to, arriving on a geometric schedule that makes both long sad and long happy stretches unlikely.

Linear Algebra

What Does Principal Component Analysis (PCA) Do? Permalink

Published:

Beyond changing basis and reducing dimension, the note asks what else the eigenbasis buys you — total variance surviving the rotation untouched, a gap between in-sample and out-of-sample variance explained signalling a shifted variance structure, and each loading reading as a linear regression coefficient.

Principal Components and Eigenvectors Permalink

Published:

Maximizing the sample variance after coordinate projection, subject to unit length, turns the first-order condition into an eigenvector equation — so the principal components are the top eigenvectors of the sample variance-covariance matrix, obtainable directly from the right singular matrix of the demeaned data.

Machine Learning

DBSCAN Permalink

Published:

The note builds DBSCAN from \(\varepsilon\)-neighborhoods and core points, grows each cluster outward from a core point, contrasts it with K-means, whose cluster count is an input rather than a result, and picks \(\varepsilon\) from the elbow of the sorted \(m\)-th smallest distances, checked against noise and largest-cluster shares.

K-Means Clustering and K-Means++ Permalink

Published:

The note lays out K-means as alternating label assignment and centroid updates, shows the distortion function falls monotonically so the loop converges, though only to a local minimum, then picks \(K\) by the elbow point farthest below a chord, and fixes initialization with K-Means++.

Trading Strategies

An Introduction to Market Auction Theory (MAT) and Order Flow Trading Strategy Permalink

Published:

The note explains how to read a market as a two-sided auction — why price sticks in some ranges (balance) and runs through others (imbalance) — and then introduces the concrete tools (order book/DOM, volume profile, footprint chart, delta/CVD) and the entry rules (ride imbalance, fade exhaustion, read absorption vs. initiation) to act on that reading.