# Formulas and Calculations

## Volatility

The volatility of daily log returns is calculated as the standard deviation of the log returns. \
\
Volatility is "annualized" unless specified otherwise. Number of trading days for the index is typically 252.

$$
𝜎=\sqrt{\tfrac{1}{n-1}\displaystyle\sum\_{t=2}^n(\ln(\tfrac{P\_t}{P\_t-1})-\mu\_R)^2}
$$

Where:

* σ = Volatility (standard deviation of log returns).

* Pt = Index value on day t.

* Rt=ln⁡(Pt/Pt−1) = Log return on day t.

* μR​ = Mean of the log returns.

* n = Total number of days.

* **Annualized Volatility (𝜎annual):**

$$
𝜎annual=\sqrt{N}.𝜎daily
$$

Where:

* 𝜎annual = Annualized volatility.
* N = Number of trading days in a year.
* 𝜎daily = Standard deviation of daily log returns.

***

## Sharpe ratio

The Sharpe Ratio measures the excess return (above a risk-free rate) per unit of risk (volatility) for an investment.&#x20;

For the Sharpe ratio, we assume the risk-free return is zero.\\

$$
S = \tfrac{\overline{R}-R\_f}{𝜎}
$$

### **Definitions of Variables**

* **Average Daily Log Return (R‾):** \
  The mean of the daily log returns is:

$$
\overline{R}=\tfrac{1}{n-1}\displaystyle\sum\_{t=2}^nln(\tfrac{P\_t}{P\_t-1})
$$

* **Risk-Free Rate (Rf):** \
  The daily risk-free rate is a constant, typically derived from annualized rates (e.g., from treasury bonds) and converted to a daily equivalent.
* **Volatility (σ):** \
  The annualized standard deviation of the daily log returns, refer to the Volatility definition for further details.

***

## Sortino ratio

The Sortino ratio evaluates the risk-adjusted return of an investment, portfolio, or strategy.&#x20;

For the Sortino ratio, we assume the risk-free return is zero.

$$
S = \tfrac{\overline{R}-R\_f}{𝜎\_D}
$$

### **Definitions of Variables**

* **Risk-Free Return (Rf):** \
  The daily risk-free rate is a constant, typically derived from annualized rates (e.g., from treasury bonds) and converted to a daily equivalent.
* **Mean Daily Log Return (R‾):** \
  The average daily log return is:

$$
\overline{R}= \tfrac{1}{n-1}\displaystyle\sum\_{t=2}^nR\_t
$$

* **Downside Deviation (σD):** \
  The downside deviation measures the variability of returns that fall below the Risk-Free Rate. It is calculated as:

$$
𝜎\_D=\sqrt{\tfrac{1}{n-1}\displaystyle\sum\_{t=2}^mmax(0,R\_f-R\_t)^2}
$$

***

## Maximum Drawdown

Maximum Drawdown (MDD) measures the largest peak-to-trough decline in a portfolio's value over a given period, expressed as a percentage.

Given a sequence of daily index values P1, P2, ... Pt (where t represents the day or index number), the maximum drawdown is calculated as:

$$
MDD = *{1\leq{t}\leq{T}}^{max}(\tfrac{P\_t-max*{t\leq{i}\leq{t}}P\_i}{max\_{t\leq{i}\leq{t}}P\_i})
$$

Where:

* Pt: Value of the index at time t.
* T: Total number of time periods.
* max\_1≤i≤tPi: The highest value of the index observed from the beginning of the period up to time t.
* (P\_t-max\_1≤i≤tPi)/(max\_1≤i≤tPi): The relative drawdown at time t, which is the percentage loss from the highest value observed up to time t.&#x20;

***

## Rate of return

The return measures the percentage change in the value of an investment over a given period. For daily index values, the return is calculated using the initial and final index values.

$$
Return=\tfrac{P\_n}{P\_1}-1
$$

Where:

* P1​: The initial index value (on the first day of the period).
* Pn: The final index value (on the last day of the period).

***

## Annualized Return

The annualized return converts the total return over a period into an equivalent yearly return, assuming compounding. It helps to compare returns over different time periods.

$$
AnnualizedReturns=(1+Return)^\tfrac{365}{T}-1
$$

### **Definitions of Variables**

* **Return:** \
  The total return over the entire period, calculated as:

$$
Return=\tfrac{P\_n}{P\_1}-1
$$

* T: The total number of days in the period.
* 365: The number of days in a year, used for annualization.

\\
