Interpreting Beta When Benchmark Return Variance Is Zero
Summary
The document examines the beta formula, which divides covariance between an asset and a benchmark by the benchmark’s return variance. Its example uses price series whose log returns are constant, making both sample covariance and benchmark variance zero; direct computation therefore produces an undefined result. The accepted answer says zero may be used as a convention, particularly for display, while cautioning that a zero beta does not imply a risk-free asset.
The example clarifies that zero beta can arise when returns have no measured co-movement with the market, but the calculation is degenerate when the benchmark itself has no variation. Whether software should display zero or raise an error depends on downstream use and business expectations. The short exchange offers no general statistical treatment for near-zero variance, estimation uncertainty, or alternative handling, so its suggested convention should not be taken as a universal rule.
Key ideas
- Beta is undefined when benchmark return variance is zero because the formula divides by that variance.
- Constant return series can make both covariance and variance zero, yielding an undefined computational result.
- A zero beta does not establish that an asset is risk-free.
- Displaying zero is presented as a possible convention, but software behavior should reflect how the result will be used.
Tags
Full text
# How to Deal With Betas when variance is Zero?
# How to Deal With Betas when variance is Zero?
To calculate a beta, I was using the following formula(Considering $ra$ as returns of $a$ and $rb$ as returns of $b$):
$$ \beta = { cov(ra, rb) \over var(rb)} $$
As a software developer, I programmed a function that returns this value. When creating tests, I created some simulated data, thinking that it would have a beta of $0.5$:
$$ a = [0.1, 0.2, 0.4, 0.8, 1.6] $$
$$ b = [0.1, 0.4, 1.6, 6.4, 12.8] $$
That will result in:
$$ ra = [0.6931471805599453, 0.6931471805599453, 0.6931471805599453, 0.6931471805599453] $$
$$ rb = [1.3862943611198906, 1.3862943611198906, 1.3862943611198906, 1.3862943611198906] $$
So, when calculating $\beta$, both variance and covariance returned $0$, which resulted in a $NaN$ in Java. I know this is a very very rare case, but even so to me it raises two questions:
1) Is there any convention on which will be $\beta$ value when variance would be $0$?
2) Is the value of $\beta$ even relevant in cases like that?
EDIT: 3) In a software that could use this result to show the user and maybe use in other operations, would it be acceptable to display the data as 0? Or it would be misleading to say this?
## Answer by sen_saven (score 2, accepted)
https://quant.stackexchange.com/a/38005
just responding to your questions:
1) Is there any convention on which will be β value when variance would be 0? -> zero
2) Is the value of β even relevant in cases like that? -> well depends on what you want to use the beta for - if it's only for display, showing zero is OK.
3) In a software that could use this result to show the user and maybe use in other operations, would it be acceptable to display the data as 0? Or it would be misleading to say this? -> It should be OK, just copying from wikipedia:
Beta can be zero. Some zero-beta assets are risk-free, such as treasury bonds and cash. However, simply because a beta is zero does not mean that it is risk-free. A beta can be zero simply because the correlation between that item's returns and the market's returns is zero. An example would be betting on horse racing. The correlation with the market will be zero, but it is certainly not a risk-free endeavor.
The only case that I could think of that would match your example is actual cash sitting on an account and not even invested on the risk free rate (since this is not constant either). I guess that better you consult with the business of your app and see if this is actually expected? - if not, your example should just throw an error I guess..Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.