ArcCosine
systemic:core-arccosMathInputs
| Name | Type | Description |
|---|---|---|
| Data | Number series | The numeric series to take the arccosine of. |
Outputs
| Name | Type | Description |
|---|---|---|
| ArcCos | Number series | The arccosine of each input value, in **radians**. |
Cost
0.198 + 0.00585·n credits for n bars, rounded up. The marks are each plan's limit of bars.
The Arccosine module computes the inverse cosine of each value in a series. It returns the angle, in radians, whose cosine equals that value. In finance it is used to turn correlations into angles and to build angle-based momentum indicators.
Mathematical Foundation
Domain and Range
flowchart LR
subgraph Domain["Input Domain"]
D["-1 ≤ x ≤ 1"]
end
subgraph Transform["ARCCOS"]
F["arccos(x)"]
end
subgraph Range["Output Range"]
R["0 to π radians<br/>(0° to 180°)"]
end
D --> F --> R
| Property | Value |
|---|---|
| Domain | |
| Range | radians (0° to 180°) |
Important: Input values must be between -1 and 1 (inclusive). Values outside this range have no arccosine, so the output is empty on those bars. No substitute value is used.
Key Values Reference
| Input | Output (radians) | Output (degrees) | Interpretation |
|---|---|---|---|
| 1 | 0 | 0° | Perfect positive correlation |
| 0.5 | 1.047 | 60° | Moderate positive |
| 0 | 1.571 | 90° | Orthogonal / uncorrelated |
| -0.5 | 2.094 | 120° | Moderate negative |
| -1 | 3.142 | 180° | Perfect negative correlation |
Financial Application: Correlation Angle
A common use of arccosine in finance is to convert correlation coefficients to angular distances. The angle shows how far apart two assets are in a geometric sense.
Why Convert Correlation to Angle?
Correlation coefficients are bounded and non-linear:
- The difference between 0.9 and 0.95 correlation matters much more than the difference between 0.1 and 0.15
- Arccos "stretches" the extremes, so small changes at high correlation become visible
flowchart TD
subgraph Input["Correlation Coefficient"]
CORR["Asset A vs Asset B<br/>ρ = 0.85"]
end
subgraph Transform["ARCCOS Module"]
ARC["arccos(0.85)"]
end
subgraph Output["Angular Distance"]
ANGLE["θ = 31.8°<br/>Assets are 31.8° apart"]
end
CORR --> ARC --> ANGLE
Portfolio Diversification Insight
| Correlation | Angle | Diversification Benefit |
|---|---|---|
| 1.0 | 0° | None — assets move identically |
| 0.7 | ≈ 46° | Moderate — some diversification |
| 0.0 | 90° | Strong — assets are uncorrelated |
| -1.0 | 180° | Perfect hedge |
Angle-based distances like this are used in advanced portfolio methods such as hierarchical risk parity.
Creative Use Case: Correlation Breakdown Detector
Find the bars where the correlation between assets changes quickly by tracking the rate of change of the angular distance:
flowchart LR
subgraph System["Correlation Regime Detector"]
CORR["Rolling Correlation<br/>(20-bar)"] --> ARCCOS["ARCCOS"]
ARCCOS --> ROC["Rate of Change"]
ROC --> Signal{"ROC > threshold?"}
Signal -->|Yes| Alert["⚠️ Regime Shift"]
Signal -->|No| Normal["Normal"]
end
Use case: During market stress, correlations jump toward 1.0 (angle → 0°). The rate of change of the angle can show a regime shift before it is fully visible in price.
The Transformation Curve
How arccos reshapes data:
| Region | Behavior |
|---|---|
| Near | Steep — small changes in correlation → large angle changes |
| Near | Moderate — roughly linear response |
| Near | Steep — symmetric to |
This makes arccos useful for amplifying signals near the correlation extremes, where small differences matter most.
Missing Data
When an input value is missing (empty) — for example, a stock series has no value on a weekend or holiday — the output on that bar is empty. Gaps are never filled in: every output value is the arccosine of a real input value.
Handling Invalid Inputs
A value outside is a real value that has no arccosine. This is different from missing data, where there is no value at all. Both give an empty output, but they mean different things:
- Missing input → empty: there was no value to compute from
- Out-of-range input → empty: there was a value, but the math is undefined for it
If you expect out-of-range values in your data, first pass them through the CLAMP module to keep inputs inside .
Converting Radians to Degrees
The output is in radians. To convert to degrees:
Use a Multiply module with a constant of 57.2958 to convert.