![]() |
| サイトマップ | |
|
関数 runavg
は、平均する範囲の個数をウィンドウのサイズで指定して、移動平均を範囲として生成します。結果として得られる範囲は、引数 range の大きさと同じになります。
runavg
(range, window)
引数 range には 1つの範囲 ({}
で指定) 、もしくは、ワークシートの1列を指定します。範囲内に欠損値や文字列が含まれている場合は 0 に置き換えられます。
もし引数 window が偶数であれば、それより1つ大きい奇数が使われます。移動平均の両端に対しては、次式で求められる値を最初と最後の範囲にそれぞれ付加して計算します。
runavg({1,2,3,4,5},3)
は、{1.33,2,3,4,4.67}
を返します。window には 3 が指定されているので、最初の結果は以下のようになります。
The runavg function produces a range of running averages, using a window of a specified size as the size of the range to be averaged. The resulting range is the same length as the argument range.
runavg(range,window)
The range argument must be a single range (indicated with the {} brackets) or a worksheet column. Any missing value or text string contained within a range is replaced with 0.
If the window argument is even, the next highest odd number is used. The tails of the running average are computed by appending
additional initial and final values to their respective ends of range.
The operation runavg({1,2,3,4,5},3) returns {1.33,2,3,4,4.67}. The value of the window argument is 3, so the first result value is calculated as:
The second value is calculated as: