Image:Weighted moving average weights N=15.png
维基百科,自由的百科全书
[edit] Summary
This graph was created by me using the following bit of gnuplot
set terminal png size 1300, 975 # set xlabel "Days ago (0 today, 1 yesterday, etc)" 0, -2 # # something evil happens with "xtics axis", need dummy xlabel set xlabel " " 0, -2 set xrange [-0.5:20.5] set xtics axis 5 set mxtics 5 # set ylabel "Weight (frac)" # set yrange [0:0.15] set format y "%.2f" unset key set style fill solid 1.0 set boxwidth 0.6 relative plot "wma.data" with boxes
and wma.data file generated by the following bit of perl
$N = 15; $div = $N * ($N + 1) / 2; $total = 0; foreach $i (0..20) { $value = ($i <= $N ? $N - $i : 0) / $div; print "$i $value\n"; $total += $value; } print "# total $total (should approach 1)\n";
You may, at your option, choose to consider these two bits of program code as published under the terms of the GPLv2, instead of the GFDL.
[edit] Licensing
|
图像链接
以下页面链接到本图像: