関数imsequence_dispersion マニュアル

(The documentation of function imsequence_dispersion)

Last Update: 2021/12/8


◆機能・用途(Purpose)

フーリエスペクトルのサンプルの値の分散を計算する。
Calculate the dispersion of the sample values of a Fourier spectral data.


◆形式(Format)

#include <sequence/statistics.h>
inline double imsequence_dispersion(struct imsequence seq)


◆引数(Arguments)

seq 計算に用いるフーリエスペクトルを表す構造体。
A structure to represent the Fourier spectral data used for the computation.


◆戻り値(Return value)

seq.valueの配列要素の分散。
The dispersion of the array components of seq.value.


◆使用例(Example)

struct imsequence seq;
double sigma2=imsequence_dispersion(seq);


◆計算式とアルゴリズム (Formula and algorithm)

an=seq.value[n], N=seq.sizeとおく。 このan (n=0,1,2,,N1) の分散σ2を計算すれば良く、 定義式は以下の通りである。
(1)σ2=1Nn=0N1|anμ|2 (2)μ=1Nn=0N1an (2)式を用いると(1)式は 以下のように変形できる。 σ2=1Nn=0N1(anμ)(anμ)=1Nn=0N1(ananμanμan+μμ)=1Nn=0N1ananμ1Nn=0N1anμ1Nn=0N1an+μμ1Nn=0N11=1Nn=0N1ananμμμμ+μμ(3)=1Nn=0N1|an|2|μ|2 このμは関数imsequence_average (sequence/statistics.h)によって計算でき、 (4)1Nn=0N1|an|2 は関数imsequence_power2_average (sequence/statistics.h)によって計算できる。 したがって、関数imsequence_averageの戻り値をa、 imsequence_power2_averageの戻り値をa2とおけば、 分散は (5)σ2=a2|a|2 によって計算できる。 この関数ではこの方法により分散を計算する。
Let us introduce notations an=seq.value[n] and N=seq.size. Then the quantity required is the dispersion σ2 for this an (n=0,1,2,,N1), which is defined by eqs. (1) and (2). Using eq. (2), eq. (1) can be arranged as (3). The value of μ and the quantity defined by eq. (4) 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. (5), where a and a2 are the return values of functions imsequence_average and imsequence_power2_average, respectively. This function calculates the dispersion by this approach.