Variance
Variance is a basic statistical indicator in quantitative trading used to measure the degree of dispersion of data, and is the square of the standard deviation.
Calculation Principle
Variance is calculated using the following formula:
σ² = Σ(x - μ)² / n
Where:
- x: Data point
- μ: Mean value
- n: Number of data points
Parameter Description
- Input Parameters: One K-line data series
- timeperiod: Calculation period, default 5
- nbdev: Standard deviation multiplier, default 1.0
- Output: Variance value
Usage Recommendations
- Adjust calculation period according to actual needs
- Pay attention to data time span
- Consider data frequency
- Pay attention to data alignment
- Recalculate periodically
- Pay attention to result interpretation
Notes
- Ensure data quality
- Pay attention to data preprocessing
- Consider the impact of extreme values
- Pay attention to the impact of calculation period
- Consider data stationarity
- Pay attention to result stability
- Consider the impact of sample size
- Pay attention to the choice of standard deviation multiplier
- Pay attention to the relationship with standard deviation