Statistical Methods
Variance
Description
The term variance refers to a statistical measurement of the spread between numbers in a data set. More specifically, variance measures how far each number in the set is from the mean (average), and thus from every other number in the set. Variance is often depicted by this symbol: σ2. It is used by both analysts and traders to determine volatility and market security.
For more information, please visit Investopedia.
Params & Instance Methods
#initialze @param series [Array] An array of prices, typically closing prices #variance @return [Float] The variance of the price series #valid? @return [Boolean] Whether or not the object is valid
Example
require 'ruby-technical-analysis' series = [0, 1, 2, 3] statistical_methods = RubyTechnicalAnalysis::StatisticalMethods.new( series: series ) p statistical_methods.valid? # true p statistical_methods.variance # 1.25