(The documentation of function calculate_weighted_average)
Last Update: 2025/8/7
◆機能・用途(Purpose)
実数値配列の要素\(d_1,\cdots,d_N\)の重み付き平均
\[\begin{equation}
\bar{d}=\frac{\sum_{i=1}^Nw_id_i}{\sum_{i=1}^Nw_i}
\label{eq.average}
\end{equation}\]
を計算する。ここで\(w_i\)は\(i\)番目のデータの重みを表す。
Calculate the weighted average (eq. \ref{eq.average})
of the components of an array of real numbers \(d_1,\cdots,d_N\),
where \(w_i\) is the weight of \(i\)th data.