_index.org

Linearity Tests

Last edited: August 8, 2025

CAPM, a Review

Note that we will be using the Sharpe-Linter version of CAPM:

\begin{equation} E[R_{i}-R_{f}] = \beta_{im} E[(R_{m}-R_{f})] \end{equation}

\begin{equation} \beta_{im} := \frac{Cov[(R_{i}-R_{f}),(R_{m}-R_{f})]}{Var[R_{m}-R_{f}]} \end{equation}

Recall that we declare \(R_{f}\) (the risk-free rate) to be non-stochastic.

Let us begin. We will create a generic function to analyze some given stock.

Data Import

We will first import our utilities

import pandas as pd
import numpy as np

Let’s load the data from our market (NYSE) as well as our 10 year t-bill data.

linked files

Last edited: August 8, 2025

linked files is a linked list: in every block, it stores the location of the next block; we don’t store files contiguously. We simply store a part of the file in a block, and a pointer to wherever the next block where the file is located is.

this solves the contiguous allocation’s fragmentation problem.

problems

  • massive seek time to get all the blocks for a given file: data scattered
  • random access of files (“find the middle”) is hard: can’t easily jump to an arbitrary location; we had to read the file from the start

lipsh

Last edited: August 8, 2025

LiquidNet

Last edited: August 8, 2025
  • Using P2P to trade stocks in a darkpool
  • Sweep across LiquidNet and send normall if not needed