seq.value[n], seq.sizeとおく。
この ()
の分散を計算すれば良く、
定義式は以下の通りである。
()式を用いると()式は
以下のように変形できる。
このは関数imsequence_average (sequence/statistics.h)によって計算でき、
は関数imsequence_power2_average (sequence/statistics.h)によって計算できる。
したがって、関数imsequence_averageの戻り値を、
imsequence_power2_averageの戻り値をとおけば、
分散は
によって計算できる。
この関数ではこの方法により分散を計算する。
Let us introduce notations seq.value[n]
and seq.size.
Then the quantity required is the dispersion
for this (),
which is defined by eqs. ()
and ().
Using eq. (),
eq. () can be arranged as ().
The value of and the quantity defined by eq. ()
can be computed by functions imsequence_average
and imsequence_power2_average
(both in sequence/statistics.h), respectively.
Then the dispersion can be computed by eq. (),
where and are the return values of functions
imsequence_average and imsequence_power2_average, respectively.
This function calculates the dispersion by this approach.