Skip to content

VAR

Summary

Rolling population variance of a real series over a given period. Measures dispersion of values around their mean. Higher values indicate greater dispersion; 0 means constant input.

Formula

\(\mathrm{VAR} = \frac{1}{n}\sum x_i^2 - \left(\frac{1}{n}\sum x_i\right)^2\), over the last \(n\) = optInTimePeriod values (population, divides by \(n\)).

Notes

  • Computes population variance (divides by the period), not the sample variance (n-1) used by some definitions.
  • The deviation-count parameter is accepted but has no effect on the result.

Inputs

  • inReal — Source series

Outputs

  • outReal — Rolling population variance

Parameters

  • optInTimePeriod — Window length for the variance
  • optInNbDev — Deviation count accepted by the API but never used in the computation

Implementation

TA-Lib Definition: var.c · var.yaml

Native File
C ta_VAR.c
Rust var.rs
Java Core.java

TA-Lib is also available for Python, R and more using a wrapper.

Aliases

Variance

See Also

STDDEV