Systemicbeta

ArcCosine

systemic:core-arccosMath

Inputs

NameTypeDescription
DataNumber seriesThe numeric series to take the arccosine of.

Outputs

NameTypeDescription
ArcCosNumber seriesThe arccosine of each input value, in **radians**.

Cost

7
credits per run
1,000
bars

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.

y=arccos⁡(x)wherecos⁡(y)=xy = \arccos(x) \quad \text{where} \quad \cos(y) = x

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
PropertyValue
Domainx∈[−1,1]x \in [-1, 1]
Rangey∈[0,π]y \in [0, \pi] 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 xxOutput (radians)Output (degrees)Interpretation
100°Perfect positive correlation
0.51.04760°Moderate positive
01.57190°Orthogonal / uncorrelated
-0.52.094120°Moderate negative
-13.142180°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

CorrelationAngleDiversification Benefit
1.00°None — assets move identically
0.7≈ 46°Moderate — some diversification
0.090°Strong — assets are uncorrelated
-1.0180°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:

RegionBehavior
Near x=1x = 1Steep — small changes in correlation → large angle changes
Near x=0x = 0Moderate — roughly linear response
Near x=−1x = -1Steep — symmetric to x=1x = 1

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 [−1,1][-1, 1] 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 [−1,1][-1, 1].


Converting Radians to Degrees

The output is in radians. To convert to degrees:

degrees=radians×180π≈radians×57.2958\text{degrees} = \text{radians} \times \frac{180}{\pi} \approx \text{radians} \times 57.2958

Use a Multiply module with a constant of 57.2958 to convert.


Further Reading

Rendering diagrams...
© 2026 WanoLabs. All rights reservedBeta v0.1.5