docs

statistical significants: z-score

Suppose we look at a typically volatile stock like Tesla (TSLA) and typically very stable stock like Pfizer (PFE). Both their share prices increase by 10% from yesterday to today. For Pfizer, that would be exciting, but it wouldn't be as surprising for Tesla.

The z-score is like a special way to tell how extraordinary something is. If we use the z-score for Tesla's jump, it might not be that high because it consideres to those big swings in the past. But if we use it for Pfizer's jump, it might be much higher because it doesn't usually move so much.

So, the z-score helps us see how different a stock's movement is compared to its usual ups and downs. By applying it to a whole market and calculating it for each individual asset, it provides a simple way to distill the most interesting price movements, taking into account the typical ups and downs of each stock, in contrast to looking at just the biggest winners or losers.

our calculation method

To calculate the Z-Score, we use logarithmic returns. Logarithmic returns have useful qualities in this context, including symmetry around zero and additivity over time.

To determine the Z-Score for a specific financial asset's recent return (from the day before yesterday to yesterday), we follow these steps:

  1. Calculate the daily logarithmic return for the last two years.
  2. Find the average and standard deviation of these returns.
  3. Plug the most recent return X into the Z-Score formula.
z-score = (X - mean) / standard deviation