BETA
BETA
Summary
Beta: the slope of a least-squares linear regression of one series' percentage returns (y, from inReal1) against another's (x, from inReal0) over a rolling window. Measures how much a security moves relative to a market index. Beta = 1 moves with the index; < 1 less volatile, > 1 more volatile.
Formula
Per-bar returns: from inReal0, from inReal1. With =period over the window: , where .
Inputs
inReal0— Series whose returns are the regression x (market/index)inReal1— Series whose returns are the regression y (security)
Outputs
outReal— Beta: regression slope of inReal1-returns on inReal0-returns
Parameters
optInTimePeriod— Rolling window length (number of returns) for the regression sums
Implementation
TA-Lib Definition: beta.c · beta.yaml
| Native | File |
|---|---|
| C | ta_BETA.c |
| Rust | beta.rs |
| Java | Core_BETA.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Beta coefficient
See Also
CORREL · LINEARREG_SLOPE · VAR · STDDEV