Power
systemic:core-powMathInputs
| Name | Type | Description |
|---|---|---|
| Second Value | Number series | The exponent: the power the base is raised to. |
| First Value | Number series | The base: the number that is raised to a power. |
Outputs
| Name | Type | Description |
|---|---|---|
| Pow | Number series | The first input raised to the power of the second input, bar by bar (Base ^ Exponent). |
Cost
0.199 + 0.00592·n credits for n bars, rounded up. The marks are each plan's limit of bars.
Raises each value of the first input to the power of the matching value of the second, bar by bar. Useful for compound growth, volatility calculations, and non-linear scaling.
| Base (A) | Exponent (B) | Result |
|---|---|---|
| 2 | 3 | 8 |
| 4 | 0.5 | 2 |
| 10 | -1 | 0.1 |
| 5 | 0 | 1 |
Missing Data
If either input is empty (null) on a bar, for example a data gap or a closed-market day, the result on that bar is empty. A gap in your inputs stays a gap in the output. Two cases still give 1, because the result does not depend on the missing value: an exponent of 0, and a base of 1.
| Base | Exponent | Result |
|---|---|---|
| 2 | empty | empty |
| empty | 3 | empty |
| empty | empty | empty |
| empty | 0 | 1 |
| 1 | empty | 1 |
Special Cases
⚠️ Important: Apart from missing data, some results are not defined for real numbers:
| Scenario | Result | Notes |
|---|---|---|
| Negative base + fractional exponent | empty | Not defined in real numbers (would be complex) |
| 0 raised to a negative power | infinity | Division by zero |
| Very large result | infinity | Too large to store |
Example: → empty (would be in complex math)
Infinite results are returned as infinity. They are values, not gaps.
Common Exponents
| Exponent | Operation | Use Case |
|---|---|---|
| 2 | Square | Variance from std dev |
| 0.5 | Square root | Std dev from variance |
| -1 | Reciprocal | Inverse weighting |
| 0 | Any base → 1 | Reset to constant |
Input Alignment
Systemic matches the inputs by time before the calculation:
| Scenario | What Happens |
|---|---|
| Different lengths | The result starts at the first bar where both inputs have data |
| Different periods | The series with the longer period repeats its latest value on each bar of the other |
| One constant | The constant is used on every bar |
Practical Example: Compound Growth
Calculate the growth factor of compound interest:
| Annual Rate | Years | Growth Factor |
|---|---|---|
| 5% | 10 | |
| 7% | 20 | |
| 10% | 30 |
Connect a growth factor series (1 + return) to the base and the number of periods to the exponent.
Related Modules
- SQRT — Square root (equivalent to exponent 0.5)
- MUL — Repeated multiplication
- DIV — Reciprocal (equivalent to exponent -1)
Interpretation Tips
- Exponent > 1: Spreads values out: values above 1 grow, values between 0 and 1 shrink
- 0 < Exponent < 1: Compresses the spread: positive values move closer to 1
- Exponent < 0: Inverts the scale (reciprocal-like)
- Exponent = 0: Everything becomes 1
Advantages
- Non-linear transformations — Needed for many financial calculations
- Flexible — Squares, roots and reciprocals in one module
- Bar by bar — Works naturally with time series
Disadvantages
- Undefined cases — A negative base with a fractional exponent gives an empty result
- Overflow risk — Large exponents can give infinity
- Interpretation — Results are hard to read at extreme exponents