Nightlybuild/nightlytest scripts: Add documentation.
[maxima.git] / doc / info / ja / descriptive.texi
blob384e6f1efbd418fe24c32a23128d44f5b5eb1fa6
1 @menu
2 * Introduction to descriptive::
3 * Functions and Variables for data manipulation::
4 * Functions and Variables for descriptive statistics::
5 * Functions and Variables for statistical graphs::
6 @end menu
8 @node Introduction to descriptive, Functions and Variables for data manipulation, descriptive, descriptive
9 @section Introduction to descriptive
11 パッケージ@code{descriptive}は記述統計計算とグラフ作成を行うための関数一式を含みます。
12 ソースコードと一緒にMaximaツリーに3つのデータセットがあります:
13 @code{pidigits.data}, @code{wind.data}, @code{biomed.data}
15 パッケージ@code{descriptive}の関数の参考文献として、
16 どんな統計マニュアルでも使うことができます。
18 コメント、バグ、提案は、
19 @var{'mario AT edu DOT xunta DOT es'}にコンタクトしてください。
21 以下は、
22 @code{descriptive}の中の記述関数が
23 引数やリスト、行列の性質に依存して如何に機能するかを示す
24 簡単な例です。
26 @c ===beg===
27 @c load ("descriptive")$
28 @c /* univariate sample */   mean ([a, b, c]);
29 @c matrix ([a, b], [c, d], [e, f]);
30 @c /* multivariate sample */ mean (%);
31 @c ===end===
32 @example
33 (%i1) load ("descriptive")$
34 @group
35 (%i2) /* univariate sample */   mean ([a, b, c]);
36                             c + b + a
37 (%o2)                       ---------
38                                 3
39 @end group
40 @group
41 (%i3) matrix ([a, b], [c, d], [e, f]);
42                             [ a  b ]
43                             [      ]
44 (%o3)                       [ c  d ]
45                             [      ]
46                             [ e  f ]
47 @end group
48 @group
49 (%i4) /* multivariate sample */ mean (%);
50                       e + c + a  f + d + b
51 (%o4)                [---------, ---------]
52                           3          3
53 @end group
54 @end example
56 多変数標本では、平均は列それぞれに関して計算されることに注意してください。
58 異なるサイズかもしれない複数の標本の場合、
59 Maxima関数@code{map}が標本それぞれに対して望みの結果を得るのに使うことができます。
61 @c ===beg===
62 @c load ("descriptive")$
63 @c map (mean, [[a, b, c], [d, e]]);
64 @c ===end===
65 @example
66 (%i1) load ("descriptive")$
67 @group
68 (%i2) map (mean, [[a, b, c], [d, e]]);
69                         c + b + a  e + d
70 (%o2)                  [---------, -----]
71                             3        2
72 @end group
73 @end example
75 この場合、サイズ3と2の2つの標本がリストに格納されました。
77 1変数標本は以下のようにリストに格納されなければいけません。
79 @c ===beg===
80 @c s1 : [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5];
81 @c ===end===
82 @example
83 @group
84 (%i1) s1 : [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5];
85 (%o1)           [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]
86 @end group
87 @end example
89 多変数標本は以下のように行列に格納されなければいけません。
91 @c ===beg===
92 @c s2 : matrix ([13.17, 9.29], [14.71, 16.88], [18.50, 16.88],
93 @c              [10.58, 6.63], [13.33, 13.25], [13.21,  8.12]);
94 @c ===end===
95 @example
96 @group
97 (%i1) s2 : matrix ([13.17, 9.29], [14.71, 16.88], [18.50, 16.88],
98              [10.58, 6.63], [13.33, 13.25], [13.21,  8.12]);
99                         [ 13.17  9.29  ]
100                         [              ]
101                         [ 14.71  16.88 ]
102                         [              ]
103                         [ 18.5   16.88 ]
104 (%o1)                   [              ]
105                         [ 10.58  6.63  ]
106                         [              ]
107                         [ 13.33  13.25 ]
108                         [              ]
109                         [ 13.21  8.12  ]
110 @end group
111 @end example
113 この場合、
114 列の数は確率変数次元に等しく、行の数はサプルのサイズです。
116 データは手で入力することができますが、
117 大きな標本は普通プレインテキストファイルの中に格納されています。
118 例えば、ファイル@code{pidigits.data}は
119 数@code{%pi}の最初の100桁を含みます:
120 @example
121 @group
122       3
123       1
124       4
125       1
126       5
127       9
128       2
129       6
130       5
131       3 ...
132 @end group
133 @end example
135 Maximaでこれらの桁をロードするためには、
137 @c ===beg===
138 @c s1 : read_list (file_search ("pidigits.data"))$
139 @c length (s1);
140 @c ===end===
141 @example
142 (%i1) s1 : read_list (file_search ("pidigits.data"))$
143 @group
144 (%i2) length (s1);
145 (%o2)                          100
146 @end group
147 @end example
149 他方、ファイル@code{wind.data}は
150 アイルランド共和国の5つの気象台の毎日の平均風速を含みます。
151 (これは12の気象台で取得されたデータセットの一部です。
152 元のファイルはStatLib Data Repositoryから無料でダウンロードでき、
153 その分析はHaslett, J., Raftery, A. E. (1989) @var{Space-time Modelling with Long-memory Dependence: Assessing Ireland's Wind Power Resource, with Discussion}. Applied Statistics 38, 1-50
154 で議論されてます。)
155 以下ではデータをロードします:
157 @c ===beg===
158 @c s2 : read_matrix (file_search ("wind.data"))$
159 @c length (s2);
160 @c s2 [%]; /* last record */
161 @c ===end===
162 @example
163 (%i1) s2 : read_matrix (file_search ("wind.data"))$
164 @group
165 (%i2) length (s2);
166 (%o2)                          100
167 @end group
168 @group
169 (%i3) s2 [%]; /* last record */
170 (%o3)            [3.58, 6.0, 4.58, 7.62, 11.25]
171 @end group
172 @end example
174 いくつかの標本は数値でないデータを含みます。
175 例えば、ファイル@code{biomed.data}
176 (StatLib Data Repositoryからダウンロードされた別のもっと大きなものの一部)は、
177 異なる年齢の、2つのグループ@code{A}と@code{B}の患者から測定された4つの血圧を含みます。
179 @c ===beg===
180 @c s3 : read_matrix (file_search ("biomed.data"))$
181 @c length (s3);
182 @c s3 [1]; /* first record */
183 @c ===end===
184 @example
185 (%i1) s3 : read_matrix (file_search ("biomed.data"))$
186 @group
187 (%i2) length (s3);
188 (%o2)                          100
189 @end group
190 @group
191 (%i3) s3 [1]; /* first record */
192 (%o3)            [A, 30, 167.0, 89.0, 25.6, 364]
193 @end group
194 @end example
196 最初の個人はグループ@code{A}に属し、30歳で、血圧は167.0, 89.0, 25.6 and 364でした。
198 カテゴリデータを扱う時には気をつけなければいけません。
199 次の例では、シンボル@code{a}が以前のある時点で値に割り当てられ、
200 その後、カテゴリ値@code{a}を持つ標本が取られます。
202 @c ===beg===
203 @c a : 1$
204 @c matrix ([a, 3], [b, 5]);
205 @c ===end===
206 @example
207 (%i1) a : 1$
208 @group
209 (%i2) matrix ([a, 3], [b, 5]);
210                             [ 1  3 ]
211 (%o2)                       [      ]
212                             [ b  5 ]
213 @end group
214 @end example
216 @opencatbox
217 @category{Descriptive statistics}
218 @category{Share packages}
219 @category{Package descriptive}
220 @closecatbox
222 @node Functions and Variables for data manipulation, Functions and Variables for descriptive statistics, Introduction to descriptive, descriptive
223 @section Functions and Variables for data manipulation
228 @deffn {関数} continuous_freq (@var{list})
229 @deffnx {関数} continuous_freq (@var{list}, @var{m})
230 @code{continuous_freq}の引数は数のリストでなければいけません。
231 範囲を区間に分割し、それらの中に値がいくつあるか数えます。
232 二番目の引数はオプションで、
233 欲しいクラス数(デフォルトが10)か、
234 クラス境界と欲しいクラスを含むリストか
235 境界だけ含むリストのいずれかです。
236 引数 @var{list}は(2個か3個の)実数のリストでなければいけません。
237 もしサンプル値がすべて等しいなら、この関数は振幅2の1クラスだけ返します。
239 例:
241 オプション引数は欲しいクラス数を示します。
242 出力の最初のリストは区間境界を含み、二番目は対応する個数を含みます:
243 区間@code{[0, 1.8]}すなわち0か1である桁が16あり、
244 @code{(1.8, 3.6]}すなわち2か3である桁が24あり、など。
246 @c ===beg===
247 @c load ("descriptive")$
248 @c s1 : read_list (file_search ("pidigits.data"))$
249 @c continuous_freq (s1, 5);
250 @c ===end===
251 @example
252 (%i1) load ("descriptive")$
253 (%i2) s1 : read_list (file_search ("pidigits.data"))$
254 (%i3) continuous_freq (s1, 5);
255 (%o3) [[0, 1.8, 3.6, 5.4, 7.2, 9.0], [16, 24, 18, 17, 25]]
256 @end example
258 オプション引数は、境界-2と12を持つクラスを7個欲しいことを示します。
260 @c ===beg===
261 @c load ("descriptive")$
262 @c s1 : read_list (file_search ("pidigits.data"))$
263 @c continuous_freq (s1, [-2,12,7]);
264 @c ===end===
265 @example
266 (%i1) load ("descriptive")$
267 (%i2) s1 : read_list (file_search ("pidigits.data"))$
268 (%i3) continuous_freq (s1, [-2,12,7]);
269 (%o3) [[- 2, 0, 2, 4, 6, 8, 10, 12], [8, 20, 22, 17, 20, 13, 0]]
270 @end example
272 オプション引数は、境界-2と12を持つクラスをデフォルト個欲しいことを示します:
274 @c ===beg===
275 @c load ("descriptive")$
276 @c s1 : read_list (file_search ("pidigits.data"))$
277 @c continuous_freq (s1, [-2,12]);
278 @c ===end===
279 @example
280 (%i1) load ("descriptive")$
281 (%i2) s1 : read_list (file_search ("pidigits.data"))$
282 (%i3) continuous_freq (s1, [-2,12]);
283                 3  4  11  18     32  39  46  53
284 (%o3)  [[- 2, - -, -, --, --, 5, --, --, --, --, 12], 
285                 5  5  5   5      5   5   5   5
286                [0, 8, 20, 12, 18, 9, 8, 25, 0, 0]]
287 @end example
289 @opencatbox
290 @category{Package descriptive}
291 @closecatbox
292 @end deffn
296 @deffn {関数} discrete_freq (@var{list})
297 数値的、記述的両方の離散標本の中の絶対頻度を数えます。
298 唯一の引数はリストです。
300 @c ===beg===
301 @c load ("descriptive")$
302 @c s1 : read_list (file_search ("pidigits.data"))$
303 @c discrete_freq (s1);
304 @c ===end===
305 @example
306 (%i1) load ("descriptive")$
307 (%i2) s1 : read_list (file_search ("pidigits.data"))$
308 @group
309 (%i3) discrete_freq (s1);
310 (%o3) [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 
311                              [8, 8, 12, 12, 10, 8, 9, 8, 12, 13]]
312 @end group
313 @end example
315 最初のリストは標本値を与え、二番目はそれらの絶対頻度を与えます。
316 コマンド@code{? col}と@code{? transpose}は最後の入力を理解するのを助けるはずです。
318 @opencatbox
319 @category{Package descriptive}
320 @closecatbox
321 @end deffn
325 @deffn {関数} subsample (@var{data_matrix}, @var{predicate_function})
326 @deffnx {関数} subsample (@var{data_matrix}, @var{predicate_function}, @var{col_num1}, @var{col_num2}, ...)
327 これはMaxima @code{submatrix}関数の変形の一種です。
328 最初の引数はデータ行列であり、二番目は述語関数であり、
329 オプションの付加引数は返す列の番号です。
330 その振る舞いは例を使ってよりよく理解されます。
332 以下は最初の測候所での風速が18より大きかった多変量レコードです。
333 ラムダ式の中で@var{i}番目の成分は@code{v[i]}として参照されることを参考にしてください。
334 @c ===beg===
335 @c load ("descriptive")$
336 @c s2 : read_matrix (file_search ("wind.data"))$
337 @c subsample (s2, lambda([v], v[1] > 18));
338 @c ===end===
339 @example
340 (%i1) load ("descriptive")$
341 (%i2) s2 : read_matrix (file_search ("wind.data"))$
342 @group
343 (%i3) subsample (s2, lambda([v], v[1] > 18));
344               [ 19.38  15.37  15.12  23.09  25.25 ]
345               [                                   ]
346               [ 18.29  18.66  19.08  26.08  27.63 ]
347 (%o3)         [                                   ]
348               [ 20.25  21.46  19.95  27.71  23.38 ]
349               [                                   ]
350               [ 18.79  18.96  14.46  26.38  21.84 ]
351 @end group
352 @end example
354 以下の例では、測候所番号1で16以上で、かつ、測候所番号4で25ノットより小さな風速
355 のレコードの一番目、二番目、五番目の成分だけをリクエストします。
356 標本は、測候所1, 2, 5からのデータだけを含みます。
357 この場合、述語関数は通常のMaxima関数として定義されます。
358 @c ===beg===
359 @c load ("descriptive")$
360 @c s2 : read_matrix (file_search ("wind.data"))$
361 @c g(x):= x[1] >= 16 and x[4] < 25$
362 @c subsample (s2, g, 1, 2, 5);
363 @c ===end===
364 @example
365 (%i1) load ("descriptive")$
366 (%i2) s2 : read_matrix (file_search ("wind.data"))$
367 (%i3) g(x):= x[1] >= 16 and x[4] < 25$
368 @group
369 (%i4) subsample (s2, g, 1, 2, 5);
370                      [ 19.38  15.37  25.25 ]
371                      [                     ]
372                      [ 17.33  14.67  19.58 ]
373 (%o4)                [                     ]
374                      [ 16.92  13.21  21.21 ]
375                      [                     ]
376                      [ 17.25  18.46  23.87 ]
377 @end group
378 @end example
380 以下は@code{biomed.data}のカテゴリ変数の例です。
381 38歳より年上のグループ@code{B}の患者に対応するレコードが欲しいです。
382 @c ===beg===
383 @c load ("descriptive")$
384 @c s3 : read_matrix (file_search ("biomed.data"))$
385 @c h(u):= u[1] = B and u[2] > 38 $
386 @c subsample (s3, h);
387 @c ===end===
388 @example
389 (%i1) load ("descriptive")$
390 (%i2) s3 : read_matrix (file_search ("biomed.data"))$
391 (%i3) h(u):= u[1] = B and u[2] > 38 $
392 @group
393 (%i4) subsample (s3, h);
394                 [ B  39  28.0  102.3  17.1  146 ]
395                 [                               ]
396                 [ B  39  21.0  92.4   10.3  197 ]
397                 [                               ]
398                 [ B  39  23.0  111.5  10.0  133 ]
399                 [                               ]
400                 [ B  39  26.0  92.6   12.3  196 ]
401 (%o4)           [                               ]
402                 [ B  39  25.0  98.7   10.0  174 ]
403                 [                               ]
404                 [ B  39  21.0  93.2   5.9   181 ]
405                 [                               ]
406                 [ B  39  18.0  95.0   11.3  66  ]
407                 [                               ]
408                 [ B  39  39.0  88.5   7.6   168 ]
409 @end group
410 @end example
412 統計解析には血圧だけを使うかもしれません。
413 @c ===beg===
414 @c load ("descriptive")$
415 @c s3 : read_matrix (file_search ("biomed.data"))$
416 @c subsample (s3, lambda([v], v[1] = B and v[2] > 38),
417 @c            3, 4, 5, 6);
418 @c ===end===
419 @example
420 (%i1) load ("descriptive")$
421 (%i2) s3 : read_matrix (file_search ("biomed.data"))$
422 @group
423 (%i3) subsample (s3, lambda([v], v[1] = B and v[2] > 38),
424                  3, 4, 5, 6);
425                    [ 28.0  102.3  17.1  146 ]
426                    [                        ]
427                    [ 21.0  92.4   10.3  197 ]
428                    [                        ]
429                    [ 23.0  111.5  10.0  133 ]
430                    [                        ]
431                    [ 26.0  92.6   12.3  196 ]
432 (%o3)              [                        ]
433                    [ 25.0  98.7   10.0  174 ]
434                    [                        ]
435                    [ 21.0  93.2   5.9   181 ]
436                    [                        ]
437                    [ 18.0  95.0   11.3  66  ]
438                    [                        ]
439                    [ 39.0  88.5   7.6   168 ]
440 @end group
441 @end example
443 いかは@code{s3}の多変量平均です。
444 @c ===beg===
445 @c load ("descriptive")$
446 @c s3 : read_matrix (file_search ("biomed.data"))$
447 @c mean (s3);
448 @c ===end===
449 @example
450 (%i1) load ("descriptive")$
451 (%i2) s3 : read_matrix (file_search ("biomed.data"))$
452 @group
453 (%i3) mean (s3);
454        65 B + 35 A  317          6 NA + 8144.999999999999
455 (%o3) [-----------, ---, 87.178, ------------------------, 
456            100      10                     100
457                                                     3 NA + 19587
458                                             18.123, ------------]
459                                                         100
460 @end group
461 @end example
463 ここで、一番目の成分は、@code{A}と@code{B}はカテゴリなので意味がなく、
464 二番目の成分は個々人の平均の歳の有理表現であり、
465 四番目と最後の値はある奇妙な振る舞いを示しています。
466 これは、
467 This is because symbol 
468 シンボル@code{NA}が@var{non available}データを示すようにここで使われているからで、
469 二つの平均は無意味です。
470 情報のある種の喪失を意味しますが、
471 可能な解は@code{NA}シンボルを持つ行を行列から取り除くことです。
472 @c ===beg===
473 @c load ("descriptive")$
474 @c s3 : read_matrix (file_search ("biomed.data"))$
475 @c g(v):= v[4] # NA and v[6] # NA $
476 @c mean (subsample (s3, g, 3, 4, 5, 6));
477 @c ===end===
478 @example
479 (%i1) load ("descriptive")$
480 (%i2) s3 : read_matrix (file_search ("biomed.data"))$
481 (%i3) g(v):= v[4] # NA and v[6] # NA $
482 @group
483 (%i4) mean (subsample (s3, g, 3, 4, 5, 6));
484 (%o4) [79.4923076923077, 86.2032967032967, 16.93186813186813, 
485                                                             2514
486                                                             ----]
487                                                              13
488 @end group
489 @end example
491 @opencatbox
492 @category{Package descriptive}
493 @closecatbox
494 @end deffn
497 @node Functions and Variables for descriptive statistics, Functions and Variables for statistical graphs, Functions and Variables for data manipulation, descriptive
498 @section Functions and Variables for descriptive statistics
502 @deffn {関数} mean (@var{list})
503 @deffnx {関数} mean (@var{matrix})
504 これは標本平均です。以下のように定義されます。
505 @ifnottex
506 @example
507                        n
508                      ====
509              _   1   \
510              x = -    >    x
511                  n   /      i
512                      ====
513                      i = 1
514 @end example
515 @end ifnottex
516 @tex
517 $${\bar{x}={1\over{n}}{\sum_{i=1}^{n}{x_{i}}}}$$
518 @end tex
520 例:
522 @c ===beg===
523 @c load ("descriptive")$
524 @c s1 : read_list (file_search ("pidigits.data"))$
525 @c mean (s1);
526 @c %, numer;
527 @c s2 : read_matrix (file_search ("wind.data"))$
528 @c mean (s2);
529 @c ===end===
530 @example
531 (%i1) load ("descriptive")$
532 (%i2) s1 : read_list (file_search ("pidigits.data"))$
533 @group
534 (%i3) mean (s1);
535                                471
536 (%o3)                          ---
537                                100
538 @end group
539 @group
540 (%i4) %, numer;
541 (%o4)                         4.71
542 @end group
543 (%i5) s2 : read_matrix (file_search ("wind.data"))$
544 @group
545 (%i6) mean (s2);
546 (%o6)     [9.9485, 10.1607, 10.8685, 15.7166, 14.8441]
547 @end group
548 @end example
550 @opencatbox
551 @category{Package descriptive}
552 @closecatbox
553 @end deffn
557 @deffn {関数} var (@var{list})
558 @deffnx {関数} var (@var{matrix})
559 これは標本分散です。以下のように定義されます。
560 @ifnottex
561 @example
562 @group
563                      n
564                    ====
565            2   1   \          _ 2
566           s  = -    >    (x - x)
567                n   /       i
568                    ====
569                    i = 1
570 @end group
571 @end example
572 @end ifnottex
573 @tex
574 $${{1}\over{n}}{\sum_{i=1}^{n}{(x_{i}-\bar{x})^2}}$$
575 @end tex
577 例:
579 @c ===beg===
580 @c load ("descriptive")$
581 @c s1 : read_list (file_search ("pidigits.data"))$
582 @c var (s1), numer;
583 @c ===end===
584 @example
585 (%i1) load ("descriptive")$
586 (%i2) s1 : read_list (file_search ("pidigits.data"))$
587 @group
588 (%i3) var (s1), numer;
589 (%o3)                   8.425899999999999
590 @end group
591 @end example
593 関数@code{var1}も参照してください。
595 @opencatbox
596 @category{Package descriptive}
597 @closecatbox
598 @end deffn
602 @deffn {関数} var1 (@var{list})
603 @deffnx {関数} var1 (@var{matrix})
604 これは標本分散です。以下のように定義されます。
605 @ifnottex
606 @example
607 @group
608                      n
609                    ====
610                1   \          _ 2
611               ---   >    (x - x)
612               n-1  /       i
613                    ====
614                    i = 1
615 @end group
616 @end example
617 @end ifnottex
618 @tex
619 $${{1\over{n-1}}{\sum_{i=1}^{n}{(x_{i}-\bar{x})^2}}}$$
620 @end tex
622 例:
624 @c ===beg===
625 @c load ("descriptive")$
626 @c s1 : read_list (file_search ("pidigits.data"))$
627 @c var1 (s1), numer;
628 @c s2 : read_matrix (file_search ("wind.data"))$
629 @c var1 (s2);
630 @c ===end===
631 @example
632 (%i1) load ("descriptive")$
633 (%i2) s1 : read_list (file_search ("pidigits.data"))$
634 @group
635 (%i3) var1 (s1), numer;
636 (%o3)                    8.5110101010101
637 @end group
638 (%i4) s2 : read_matrix (file_search ("wind.data"))$
639 @group
640 (%i5) var1 (s2);
641 (%o5) [17.39586540404041, 15.13912778787879, 15.63204924242424, 
642                             32.50152569696971, 24.66977392929294]
643 @end group
644 @end example
646 関数@code{var}も参照してください。
648 @opencatbox
649 @category{Package descriptive}
650 @closecatbox
651 @end deffn
655 @deffn {関数} std (@var{list})
656 @deffnx {関数} std (@var{matrix})
657 これは分母@math{n}の分散である関数@code{var}の平方根です。
659 例:
661 @c ===beg===
662 @c load ("descriptive")$
663 @c s1 : read_list (file_search ("pidigits.data"))$
664 @c std (s1), numer;
665 @c s2 : read_matrix (file_search ("wind.data"))$
666 @c std (s2);
667 @c ===end===
668 @example
669 (%i1) load ("descriptive")$
670 (%i2) s1 : read_list (file_search ("pidigits.data"))$
671 @group
672 (%i3) std (s1), numer;
673 (%o3)                   2.902740084816414
674 @end group
675 (%i4) s2 : read_matrix (file_search ("wind.data"))$
676 @group
677 (%i5) std (s2);
678 (%o5) [4.149928523480858, 3.871399812729241, 3.933920277534866, 
679                             5.672434260526957, 4.941970881136392]
680 @end group
681 @end example
683 関数@code{var}と@code{std1}も参照してください。
685 @opencatbox
686 @category{Package descriptive}
687 @closecatbox
688 @end deffn
692 @deffn {関数} std1 (@var{list})
693 @deffnx {関数} std1 (@var{matrix})
694 これは分母@math{n-1}の分散である関数@code{var1}の平方根です。
696 例:
698 @c ===beg===
699 @c load ("descriptive")$
700 @c s1 : read_list (file_search ("pidigits.data"))$
701 @c std1 (s1), numer;
702 @c s2 : read_matrix (file_search ("wind.data"))$
703 @c std1 (s2);
704 @c ===end===
705 @example
706 (%i1) load ("descriptive")$
707 (%i2) s1 : read_list (file_search ("pidigits.data"))$
708 @group
709 (%i3) std1 (s1), numer;
710 (%o3)                   2.917363553109228
711 @end group
712 (%i4) s2 : read_matrix (file_search ("wind.data"))$
713 @group
714 (%i5) std1 (s2);
715 (%o5) [4.170835096721089, 3.89090320978032, 3.953738641137555, 
716                             5.701010936401517, 4.966867617451963]
717 @end group
718 @end example
720 See also functions @code{var1} and @code{std}.
722 @opencatbox
723 @category{Package descriptive}
724 @closecatbox
725 @end deffn
729 @deffn {関数} noncentral_moment (@var{list}, @var{k})
730 @deffnx {関数} noncentral_moment (@var{matrix}, @var{k})
731 次数@math{k}の非中心モーメントです。以下のように定義されます。
732 @ifnottex
733 @example
734 @group
735                        n
736                      ====
737                  1   \      k
738                  -    >    x
739                  n   /      i
740                      ====
741                      i = 1
742 @end group
743 @end example
744 @end ifnottex
745 @tex
746 $${{1\over{n}}{\sum_{i=1}^{n}{x_{i}^k}}}$$
747 @end tex
749 例:
751 @c ===beg===
752 @c load ("descriptive")$
753 @c s1 : read_list (file_search ("pidigits.data"))$
754 @c noncentral_moment (s1, 1), numer; /* the mean */
755 @c s2 : read_matrix (file_search ("wind.data"))$
756 @c noncentral_moment (s2, 5);
757 @c ===end===
758 @example
759 (%i1) load ("descriptive")$
760 (%i2) s1 : read_list (file_search ("pidigits.data"))$
761 @group
762 (%i3) noncentral_moment (s1, 1), numer; /* the mean */
763 (%o3)                         4.71
764 @end group
765 @group
766 (%i5) s2 : read_matrix (file_search ("wind.data"))$
767 @end group
768 @group
769 (%i6) noncentral_moment (s2, 5);
770 (%o6) [319793.8724761505, 320532.1923892463,
771       391249.5621381556, 2502278.205988911, 1691881.797742255]
772 @end group
773 @end example
775 関数@code{central_moment}も参照してください。
777 @opencatbox
778 @category{Package descriptive}
779 @closecatbox
780 @end deffn
784 @deffn {関数} central_moment (@var{list}, @var{k})
785 @deffnx {関数} central_moment (@var{matrix}, @var{k})
786 次数@math{k}の中心モーメントです。以下のように定義されます。
787 @ifnottex
788 @example
789 @group
790                     n
791                   ====
792               1   \          _ k
793               -    >    (x - x)
794               n   /       i
795                   ====
796                   i = 1
797 @end group
798 @end example
799 @end ifnottex
800 @tex
801 $${{1\over{n}}{\sum_{i=1}^{n}{(x_{i}-\bar{x})^k}}}$$
802 @end tex
804 例:
806 @c ===beg===
807 @c load ("descriptive")$
808 @c s1 : read_list (file_search ("pidigits.data"))$
809 @c central_moment (s1, 2), numer; /* the variance */
810 @c s2 : read_matrix (file_search ("wind.data"))$
811 @c central_moment (s2, 3);
812 @c ===end===
813 @example
814 (%i1) load ("descriptive")$
815 (%i2) s1 : read_list (file_search ("pidigits.data"))$
816 @group
817 (%i3) central_moment (s1, 2), numer; /* the variance */
818 (%o3)                   8.425899999999999
819 @end group
820 (%i5) s2 : read_matrix (file_search ("wind.data"))$
821 @group
822 (%i6) central_moment (s2, 3);
823 (%o6) [11.29584771375004, 16.97988248298583, 5.626661952750102,
824                              37.5986572057918, 25.85981904394192]
825 @end group
826 @end example
828 関数@code{noncentral_moment}と@code{mean}も参照してください。
830 @opencatbox
831 @category{Package descriptive}
832 @closecatbox
833 @end deffn
837 @deffn {関数} cv (@var{list})
838 @deffnx {関数} cv (@var{matrix})
839 変動係数は標本標準偏差(@code{std})を平均@code{mean}で割った商です。
840 @c ===beg===
841 @c load ("descriptive")$
842 @c s1 : read_list (file_search ("pidigits.data"))$
843 @c cv (s1), numer;
844 @c s2 : read_matrix (file_search ("wind.data"))$
845 @c cv (s2);
846 @c ===end===
847 @example
848 (%i1) load ("descriptive")$
849 (%i2) s1 : read_list (file_search ("pidigits.data"))$
850 @group
851 (%i3) cv (s1), numer;
852 (%o3)                   .6193977819764815
853 @end group
854 (%i4) s2 : read_matrix (file_search ("wind.data"))$
855 @group
856 (%i5) cv (s2);
857 (%o5) [.4192426091090204, .3829365309260502, 0.363779605385983, 
858                             .3627381836021478, .3346021393989506]
859 @end group
860 @end example
862 関数@code{std}と@code{mean}も参照してください。
864 @opencatbox
865 @category{Package descriptive}
866 @closecatbox
867 @end deffn
871 @deffn {関数} smin (@var{list})
872 @deffnx {関数} smin (@var{matrix})
873 これは標本@var{list}の最小値です。
874 引数が行列の時、
875 @code{smin}は
876 統計変数に関連付けられた列の最小値を含むリストを返します。
878 @c ===beg===
879 @c load ("descriptive")$
880 @c s1 : read_list (file_search ("pidigits.data"))$
881 @c smin (s1);
882 @c s2 : read_matrix (file_search ("wind.data"))$
883 @c smin (s2);
884 @c ===end===
885 @example
886 (%i1) load ("descriptive")$
887 (%i2) s1 : read_list (file_search ("pidigits.data"))$
888 @group
889 (%i3) smin (s1);
890 (%o3)                           0
891 @end group
892 (%i4) s2 : read_matrix (file_search ("wind.data"))$
893 @group
894 (%i5) smin (s2);
895 (%o5)             [0.58, 0.5, 2.67, 5.25, 5.17]
896 @end group
897 @end example
899 See also function @code{smax}.
901 @opencatbox
902 @category{Package descriptive}
903 @closecatbox
904 @end deffn
908 @deffn {関数} smax (@var{list})
909 @deffnx {関数} smax (@var{matrix})
910 これは標本@var{list}の最大値です。
911 引数が行列の時、
912 @code{smax}は
913 統計変数に関連付けられた列の最大値を含むリストを返します。
915 @c ===beg===
916 @c load ("descriptive")$
917 @c s1 : read_list (file_search ("pidigits.data"))$
918 @c smax (s1);
919 @c s2 : read_matrix (file_search ("wind.data"))$
920 @c smax (s2);
921 @c ===end===
922 @example
923 (%i1) load ("descriptive")$
924 (%i2) s1 : read_list (file_search ("pidigits.data"))$
925 @group
926 (%i3) smax (s1);
927 (%o3)                           9
928 @end group
929 (%i4) s2 : read_matrix (file_search ("wind.data"))$
930 @group
931 (%i5) smax (s2);
932 (%o5)          [20.25, 21.46, 20.04, 29.63, 27.63]
933 @end group
934 @end example
936 関数@code{smin}も参照してください。
938 @opencatbox
939 @category{Package descriptive}
940 @closecatbox
941 @end deffn
945 @deffn {関数} range (@var{list})
946 @deffnx {関数} range (@var{matrix})
947 範囲は極値の差です。
949 例:
951 @c ===beg===
952 @c load ("descriptive")$
953 @c s1 : read_list (file_search ("pidigits.data"))$
954 @c range (s1);
955 @c s2 : read_matrix (file_search ("wind.data"))$
956 @c range (s2);
957 @c ===end===
958 @example
959 (%i1) load ("descriptive")$
960 (%i2) s1 : read_list (file_search ("pidigits.data"))$
961 @group
962 (%i3) range (s1);
963 (%o3)                           9
964 @end group
965 (%i4) s2 : read_matrix (file_search ("wind.data"))$
966 @group
967 (%i5) range (s2);
968 (%o5)          [19.67, 20.96, 17.37, 24.38, 22.46]
969 @end group
970 @end example
972 @opencatbox
973 @category{Package descriptive}
974 @closecatbox
975 @end deffn
979 @deffn {関数} quantile (@var{list}, @var{p})
980 @deffnx {関数} quantile (@var{matrix}, @var{p})
981 これは標本@var{list}の@var{p}分位数です。@var{p}は@math{[0, 1]}の範囲の数です。
982 標本分位数にはいくつかの定義がありますが
983 (Hyndman, R. J., Fan, Y. (1996) @var{Sample quantiles in statistical packages}. American Statistician, 50, 361-365)、
984 パッケージ@code{descriptive}では線形内挿に基づいたものが実装されています。
986 例:
988 @c ===beg===
989 @c load ("descriptive")$
990 @c s1 : read_list (file_search ("pidigits.data"))$
991 @c /* 1st and 3rd quartiles */ 
992 @c          [quantile (s1, 1/4), quantile (s1, 3/4)], numer;
993 @c s2 : read_matrix (file_search ("wind.data"))$
994 @c quantile (s2, 1/4);
995 @c ===end===
996 @example
997 (%i1) load ("descriptive")$
998 (%i2) s1 : read_list (file_search ("pidigits.data"))$
999 @group
1000 (%i3) /* 1st and 3rd quartiles */
1001          [quantile (s1, 1/4), quantile (s1, 3/4)], numer;
1002 (%o3)                      [2.0, 7.25]
1003 @end group
1004 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1005 @group
1006 (%i5) quantile (s2, 1/4);
1007 (%o5)    [7.2575, 7.477500000000001, 7.82, 11.28, 11.48]
1008 @end group
1009 @end example
1011 @opencatbox
1012 @category{Package descriptive}
1013 @closecatbox
1014 @end deffn
1018 @deffn {関数} median (@var{list})
1019 @deffnx {関数} median (@var{matrix})
1020 一旦標本が順に並べられると、
1021 もし標本サイズが奇数ならメジアンは中央値であり、
1022 そうでなければ2つの中央値の平均です。
1024 例:
1026 @c ===beg===
1027 @c load ("descriptive")$
1028 @c s1 : read_list (file_search ("pidigits.data"))$
1029 @c median (s1);
1030 @c s2 : read_matrix (file_search ("wind.data"))$
1031 @c median (s2);
1032 @c ===end===
1033 @example
1034 (%i1) load ("descriptive")$
1035 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1036 @group
1037 (%i3) median (s1);
1038                                 9
1039 (%o3)                           -
1040                                 2
1041 @end group
1042 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1043 @group
1044 (%i5) median (s2);
1045 (%o5)         [10.06, 9.855, 10.73, 15.48, 14.105]
1046 @end group
1047 @end example
1049 メジアンは1/2分位数です。
1051 関数@code{quantile}も参照してください。
1053 @opencatbox
1054 @category{Package descriptive}
1055 @closecatbox
1056 @end deffn
1060 @deffn {関数} qrange (@var{list})
1061 @deffnx {関数} qrange (@var{matrix})
1062 四分位範囲は
1063 三番目と一番目の分位数の差
1064 @code{quantile(@var{list},3/4) - quantile(@var{list},1/4)}
1065 です。
1067 @c ===beg===
1068 @c load ("descriptive")$
1069 @c s1 : read_list (file_search ("pidigits.data"))$
1070 @c qrange (s1);
1071 @c s2 : read_matrix (file_search ("wind.data"))$
1072 @c qrange (s2);
1073 @c ===end===
1074 @example
1075 (%i1) load ("descriptive")$
1076 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1077 @group
1078 (%i3) qrange (s1);
1079                                21
1080 (%o3)                          --
1081                                4
1082 @end group
1083 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1084 @group
1085 (%i5) qrange (s2);
1086 (%o5) [5.385, 5.572499999999998, 6.022500000000001, 
1087                             8.729999999999999, 6.649999999999999]
1088 @end group
1089 @end example
1091 関数@code{quantile}も参照してください。
1093 @opencatbox
1094 @category{Package descriptive}
1095 @closecatbox
1096 @end deffn
1100 @deffn {関数} mean_deviation (@var{list})
1101 @deffnx {関数} mean_deviation (@var{matrix})
1102 平均偏差です。以下のように定義されます。
1103 @ifnottex
1104 @example
1105 @group
1106                      n
1107                    ====
1108                1   \          _
1109                -    >    |x - x|
1110                n   /       i
1111                    ====
1112                    i = 1
1113 @end group
1114 @end example
1115 @end ifnottex
1116 @tex
1117 $${{1\over{n}}{\sum_{i=1}^{n}{|x_{i}-\bar{x}|}}}$$
1118 @end tex
1120 例:
1122 @c ===beg===
1123 @c load ("descriptive")$
1124 @c s1 : read_list (file_search ("pidigits.data"))$
1125 @c mean_deviation (s1);
1126 @c s2 : read_matrix (file_search ("wind.data"))$
1127 @c mean_deviation (s2);
1128 @c ===end===
1129 @example
1130 (%i1) load ("descriptive")$
1131 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1132 @group
1133 (%i3) mean_deviation (s1);
1134                                51
1135 (%o3)                          --
1136                                20
1137 @end group
1138 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1139 @group
1140 (%i5) mean_deviation (s2);
1141 (%o5) [3.287959999999999, 3.075342, 3.23907, 4.715664000000001, 
1142                                                4.028546000000002]
1143 @end group
1144 @end example
1146 関数@code{mean}も参照してください。
1148 @opencatbox
1149 @category{Package descriptive}
1150 @closecatbox
1151 @end deffn
1155 @deffn {関数} median_deviation (@var{list})
1156 @deffnx {関数} median_deviation (@var{matrix})
1157 メジアン偏差です。以下のように定義されます。
1158 @ifnottex
1159 @example
1160 @group
1161                  n
1162                ====
1163            1   \
1164            -    >    |x - med|
1165            n   /       i
1166                ====
1167                i = 1
1168 @end group
1169 @end example
1170 @end ifnottex
1171 @tex
1172 $${{1\over{n}}{\sum_{i=1}^{n}{|x_{i}-med|}}}$$
1173 @end tex
1174 ここで@code{med}は@var{list}のメジアンです。
1176 例:
1178 @c ===beg===
1179 @c load ("descriptive")$
1180 @c s1 : read_list (file_search ("pidigits.data"))$
1181 @c median_deviation (s1);
1182 @c s2 : read_matrix (file_search ("wind.data"))$
1183 @c median_deviation (s2);
1184 @c ===end===
1185 @example
1186 (%i1) load ("descriptive")$
1187 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1188 @group
1189 (%i3) median_deviation (s1);
1190                                 5
1191 (%o3)                           -
1192                                 2
1193 @end group
1194 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1195 @group
1196 (%i5) median_deviation (s2);
1197 (%o5)           [2.75, 2.755, 3.08, 4.315, 3.31]
1198 @end group
1199 @end example
1201 関数@code{mean}も参照してください。
1203 @opencatbox
1204 @category{Package descriptive}
1205 @closecatbox
1206 @end deffn
1210 @deffn {関数} harmonic_mean (@var{list})
1211 @deffnx {関数} harmonic_mean (@var{matrix})
1212 調和平均です。以下のように定義されます。
1213 @ifnottex
1214 @example
1215 @group
1216                   n
1217                --------
1218                 n
1219                ====
1220                \     1
1221                 >    --
1222                /     x
1223                ====   i
1224                i = 1
1225 @end group
1226 @end example
1227 @end ifnottex
1228 @tex
1229 $${{n}\over{\sum_{i=1}^{n}{{{1}\over{x_{i}}}}}}$$
1230 @end tex
1232 例:
1234 @c ===beg===
1235 @c load ("descriptive")$
1236 @c y : [5, 7, 2, 5, 9, 5, 6, 4, 9, 2, 4, 2, 5]$
1237 @c harmonic_mean (y), numer;
1238 @c s2 : read_matrix (file_search ("wind.data"))$
1239 @c harmonic_mean (s2);
1240 @c ===end===
1241 @example
1242 (%i1) load ("descriptive")$
1243 (%i2) y : [5, 7, 2, 5, 9, 5, 6, 4, 9, 2, 4, 2, 5]$
1244 @group
1245 (%i3) harmonic_mean (y), numer;
1246 (%o3)                   3.901858027632205
1247 @end group
1248 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1249 @group
1250 (%i5) harmonic_mean (s2);
1251 (%o5) [6.948015590052786, 7.391967752360356, 9.055658197151745, 
1252                             13.44199028193692, 13.01439145898509]
1253 @end group
1254 @end example
1256 関数@code{mean}と@code{geometric_mean}も参照してください。
1258 @opencatbox
1259 @category{Package descriptive}
1260 @closecatbox
1262 @end deffn
1266 @deffn {関数} geometric_mean (@var{list})
1267 @deffnx {関数} geometric_mean (@var{matrix})
1268 幾何平均です。以下のように定義されます。
1269 @ifnottex
1270 @example
1271 @group
1272                  /  n      \ 1/n
1273                  | /===\   |
1274                  |  ! !    |
1275                  |  ! !  x |
1276                  |  ! !   i|
1277                  | i = 1   |
1278                  \         /
1279 @end group
1280 @end example
1281 @end ifnottex
1282 @tex
1283 $$\left(\prod_{i=1}^{n}{x_{i}}\right)^{{{1}\over{n}}}$$
1284 @end tex
1286 例:
1288 @c ===beg===
1289 @c load ("descriptive")$
1290 @c y : [5, 7, 2, 5, 9, 5, 6, 4, 9, 2, 4, 2, 5]$
1291 @c geometric_mean (y), numer;
1292 @c s2 : read_matrix (file_search ("wind.data"))$
1293 @c geometric_mean (s2);
1294 @c ===end===
1295 @example
1296 (%i1) load ("descriptive")$
1297 (%i2) y : [5, 7, 2, 5, 9, 5, 6, 4, 9, 2, 4, 2, 5]$
1298 @group
1299 (%i3) geometric_mean (y), numer;
1300 (%o3)                   4.454845412337012
1301 @end group
1302 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1303 @group
1304 (%i5) geometric_mean (s2);
1305 (%o5) [8.82476274347979, 9.22652604739361, 10.0442675714889, 
1306                             14.61274126349021, 13.96184163444275]
1307 @end group
1308 @end example
1310 関数@code{mean}と@code{harmonic_mean}も参照してください。
1312 @opencatbox
1313 @category{Package descriptive}
1314 @closecatbox
1315 @end deffn
1319 @deffn {関数} kurtosis (@var{list})
1320 @deffnx {関数} kurtosis (@var{matrix})
1321 尖度係数です。以下のように定義されます。
1322 @ifnottex
1323 @example
1324 @group
1325                     n
1326                   ====
1327             1     \          _ 4
1328            ----    >    (x - x)  - 3
1329               4   /       i
1330            n s    ====
1331                   i = 1
1332 @end group
1333 @end example
1334 @end ifnottex
1335 @tex
1336 $${{1\over{n s^4}}{\sum_{i=1}^{n}{(x_{i}-\bar{x})^4}}-3}$$
1337 @end tex
1339 例:
1341 @c ===beg===
1342 @c load ("descriptive")$
1343 @c s1 : read_list (file_search ("pidigits.data"))$
1344 @c kurtosis (s1), numer;
1345 @c s2 : read_matrix (file_search ("wind.data"))$
1346 @c kurtosis (s2);
1347 @c ===end===
1348 @example
1349 (%i1) load ("descriptive")$
1350 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1351 @group
1352 (%i3) kurtosis (s1), numer;
1353 (%o3)                  - 1.273247946514421
1354 @end group
1355 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1356 @group
1357 (%i5) kurtosis (s2);
1358 (%o5) [- .2715445622195385, 0.119998784429451, 
1359      - .4275233490482861, - .6405361979019522, - .4952382132352935]
1360 @end group
1361 @end example
1363 関数@code{mean}, @code{var}, @code{skewness}も参照してください。
1365 @opencatbox
1366 @category{Package descriptive}
1367 @closecatbox
1368 @end deffn
1372 @deffn {関数} skewness (@var{list})
1373 @deffnx {関数} skewness (@var{matrix})
1374 歪度係数です。以下のように定義されます。
1375 @ifnottex
1376 @example
1377 @group
1378                     n
1379                   ====
1380             1     \          _ 3
1381            ----    >    (x - x)
1382               3   /       i
1383            n s    ====
1384                   i = 1
1385 @end group
1386 @end example
1387 @end ifnottex
1388 @tex
1389 $${{1\over{n s^3}}{\sum_{i=1}^{n}{(x_{i}-\bar{x})^3}}}$$
1390 @end tex
1392 例:
1394 @c ===beg===
1395 @c load ("descriptive")$
1396 @c s1 : read_list (file_search ("pidigits.data"))$
1397 @c skewness (s1), numer;
1398 @c s2 : read_matrix (file_search ("wind.data"))$
1399 @c skewness (s2);
1400 @c ===end===
1401 @example
1402 (%i1) load ("descriptive")$
1403 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1404 @group
1405 (%i3) skewness (s1), numer;
1406 (%o3)                  .009196180476450424
1407 @end group
1408 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1409 @group
1410 (%i5) skewness (s2);
1411 (%o5) [.1580509020000978, .2926379232061854, .09242174416107717, 
1412                             .2059984348148687, .2142520248890831]
1413 @end group
1414 @end example
1416 関数@code{mean}, @code{var}, @code{kurtosis}も参照してください。
1418 @opencatbox
1419 @category{Package descriptive}
1420 @closecatbox
1421 @end deffn
1425 @deffn {関数} pearson_skewness (@var{list})
1426 @deffnx {関数} pearson_skewness (@var{matrix})
1427 Pearsonの歪度係数です。以下のように定義されます。
1428 @ifnottex
1429 @example
1430 @group
1431                 _
1432              3 (x - med)
1433              -----------
1434                   s
1435 @end group
1436 @end example
1437 @end ifnottex
1438 @tex
1439 $${{3\,\left(\bar{x}-med\right)}\over{s}}$$
1440 @end tex
1441 ここで @var{med}は@var{list}のメジアンです。
1443 例:
1445 @c ===beg===
1446 @c load ("descriptive")$
1447 @c s1 : read_list (file_search ("pidigits.data"))$
1448 @c pearson_skewness (s1), numer;
1449 @c s2 : read_matrix (file_search ("wind.data"))$
1450 @c pearson_skewness (s2);
1451 @c ===end===
1452 @example
1453 (%i1) load ("descriptive")$
1454 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1455 @group
1456 (%i3) pearson_skewness (s1), numer;
1457 (%o3)                   .2159484029093895
1458 @end group
1459 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1460 @group
1461 (%i5) pearson_skewness (s2);
1462 (%o5) [- .08019976629211892, .2357036272952649, 
1463          .1050904062491204, .1245042340592368, .4464181795804519]
1464 @end group
1465 @end example
1467 関数@code{mean}, @code{var}, @code{median}も参照してください。
1469 @opencatbox
1470 @category{Package descriptive}
1471 @closecatbox
1472 @end deffn
1476 @deffn {関数} quartile_skewness (@var{list})
1477 @deffnx {関数} quartile_skewness (@var{matrix})
1478 分位歪度係数です。以下のように定義されます。
1479 @ifnottex
1480 @example
1481 @group
1482                c    - 2 c    + c
1483                 3/4      1/2    1/4
1484                --------------------
1485                    c    - c
1486                     3/4    1/4
1487 @end group
1488 @end example
1489 @end ifnottex
1490 @tex
1491 $${{c_{{{3}\over{4}}}-2\,c_{{{1}\over{2}}}+c_{{{1}\over{4}}}}\over{c
1492  _{{{3}\over{4}}}-c_{{{1}\over{4}}}}}$$
1493 @end tex
1494 ここで@math{c_p}は標本@var{list}の@var{p}分位数です。
1496 例:
1498 @c ===beg===
1499 @c load ("descriptive")$
1500 @c s1 : read_list (file_search ("pidigits.data"))$
1501 @c quartile_skewness (s1), numer;
1502 @c s2 : read_matrix (file_search ("wind.data"))$
1503 @c quartile_skewness (s2);
1504 @c ===end===
1505 @example
1506 (%i1) load ("descriptive")$
1507 (%i2) s1 : read_list (file_search ("pidigits.data"))$
1508 @group
1509 (%i3) quartile_skewness (s1), numer;
1510 (%o3)                  .04761904761904762
1511 @end group
1512 (%i4) s2 : read_matrix (file_search ("wind.data"))$
1513 @group
1514 (%i5) quartile_skewness (s2);
1515 (%o5) [- 0.0408542246982353, .1467025572005382, 
1516        0.0336239103362392, .03780068728522298, .2105263157894735]
1517 @end group
1518 @end example
1520 関数@code{quantile}も参照してください。
1522 @opencatbox
1523 @category{Package descriptive}
1524 @closecatbox
1525 @end deffn
1529 @deffn {関数} cov (@var{matrix})
1530 多変量標本の共分散行列です。以下のように定義されます。
1531 @ifnottex
1532 @example
1533 @group
1534               n
1535              ====
1536           1  \           _        _
1537       S = -   >    (X  - X) (X  - X)'
1538           n  /       j        j
1539              ====
1540              j = 1
1541 @end group
1542 @end example
1543 @end ifnottex
1544 @tex
1545 $${S={1\over{n}}{\sum_{j=1}^{n}{\left(X_{j}-\bar{X}\right)\,\left(X_{j}-\bar{X}\right)'}}}$$
1546 @end tex
1547 ここで@math{X_j}は標本行列の@math{j}番目の行です。
1549 例:
1551 @c ===beg===
1552 @c load ("descriptive")$
1553 @c s2 : read_matrix (file_search ("wind.data"))$
1554 @c fpprintprec : 7$  /* change precision for pretty output */
1555 @c cov (s2);
1556 @c ===end===
1557 @example
1558 (%i1) load ("descriptive")$
1559 (%i2) s2 : read_matrix (file_search ("wind.data"))$
1560 (%i3) fpprintprec : 7$  /* change precision for pretty output */
1561 @group
1562 (%i4) cov (s2);
1563       [ 17.22191  13.61811  14.37217  19.39624  15.42162 ]
1564       [                                                  ]
1565       [ 13.61811  14.98774  13.30448  15.15834  14.9711  ]
1566       [                                                  ]
1567 (%o4) [ 14.37217  13.30448  15.47573  17.32544  16.18171 ]
1568       [                                                  ]
1569       [ 19.39624  15.15834  17.32544  32.17651  20.44685 ]
1570       [                                                  ]
1571       [ 15.42162  14.9711   16.18171  20.44685  24.42308 ]
1572 @end group
1573 @end example
1575 関数@code{cov1}も参照してください。
1577 @opencatbox
1578 @category{Package descriptive}
1579 @closecatbox
1580 @end deffn
1584 @deffn {関数} cov1 (@var{matrix})
1585 多変量標本の共分散行列です。以下のように定義されます。
1586 @ifnottex
1587 @example
1588 @group
1589               n
1590              ====
1591          1   \           _        _
1592    S  = ---   >    (X  - X) (X  - X)'
1593     1   n-1  /       j        j
1594              ====
1595              j = 1
1596 @end group
1597 @end example
1598 @end ifnottex
1599 @tex
1600 $${{1\over{n-1}}{\sum_{j=1}^{n}{\left(X_{j}-\bar{X}\right)\,\left(X_{j}-\bar{X}\right)'}}}$$
1601 @end tex
1602 ここで@math{X_j}は標本行列の@math{j}番目の行です。
1604 例:
1606 @c ===beg===
1607 @c load ("descriptive")$
1608 @c s2 : read_matrix (file_search ("wind.data"))$
1609 @c fpprintprec : 7$ /* change precision for pretty output */
1610 @c cov1 (s2);
1611 @c ===end===
1612 @example
1613 (%i1) load ("descriptive")$
1614 (%i2) s2 : read_matrix (file_search ("wind.data"))$
1615 (%i3) fpprintprec : 7$ /* change precision for pretty output */
1616 @group
1617 (%i4) cov1 (s2);
1618       [ 17.39587  13.75567  14.51734  19.59216  15.5774  ]
1619       [                                                  ]
1620       [ 13.75567  15.13913  13.43887  15.31145  15.12232 ]
1621       [                                                  ]
1622 (%o4) [ 14.51734  13.43887  15.63205  17.50044  16.34516 ]
1623       [                                                  ]
1624       [ 19.59216  15.31145  17.50044  32.50153  20.65338 ]
1625       [                                                  ]
1626       [ 15.5774   15.12232  16.34516  20.65338  24.66977 ]
1627 @end group
1628 @end example
1630 関数@code{cov}も参照してください。
1632 @opencatbox
1633 @category{Package descriptive}
1634 @closecatbox
1635 @end deffn
1639 @deffn {関数} global_variances (@var{matrix})
1640 @deffnx {関数} global_variances (@var{matrix}, @var{logical_value})
1641 関数@code{global_variances}は大域分散尺度のリストを返します:
1643 @itemize @bullet
1644 @item
1645 @var{total variance}: @code{trace(S_1)},
1646 @item
1647 @var{mean variance}: @code{trace(S_1)/p},
1648 @item
1649 @var{generalized variance}: @code{determinant(S_1)},
1650 @item
1651 @var{generalized standard deviation}: @code{sqrt(determinant(S_1))},
1652 @item
1653 @var{efective variance} @code{determinant(S_1)^(1/p)}, (以下の文献で定義されています: Pe@~na, D. (2002) @var{An@'alisis de datos multivariantes}; McGraw-Hill, Madrid.)
1654 @item
1655 @var{efective standard deviation}: @code{determinant(S_1)^(1/(2*p))}.
1656 @end itemize
1657 ここで@var{p}は多変量確率変数の次元であり、
1658 @math{S_1}は@code{cov1}が返す共分散行列です。
1660 例:
1662 @c ===beg===
1663 @c load ("descriptive")$
1664 @c s2 : read_matrix (file_search ("wind.data"))$
1665 @c global_variances (s2);
1666 @c ===end===
1667 @example
1668 (%i1) load ("descriptive")$
1669 (%i2) s2 : read_matrix (file_search ("wind.data"))$
1670 @group
1671 (%i3) global_variances (s2);
1672 (%o3) [105.338342060606, 21.06766841212119, 12874.34690469686, 
1673          113.4651792608501, 6.636590811800795, 2.576158149609762]
1674 @end group
1675 @end example
1677 関数@code{global_variances}はオプションの論理引数を取ります:
1678 @code{global_variances(x,true)}は、
1679 Maximaに@code{x}がデータ行列であることを伝え、@code{global_variances(x)}と同様に作られます。
1680 一方、@code{global_variances(x,false)}は
1681 @code{x}がデータ行列ではなく、共分散行列であることを意味し、再計算は避けられます。
1683 @c ===beg===
1684 @c load ("descriptive")$
1685 @c s2 : read_matrix (file_search ("wind.data"))$
1686 @c s : cov1 (s2)$
1687 @c global_variances (s, false);
1688 @c ===end===
1689 @example
1690 (%i1) load ("descriptive")$
1691 (%i2) s2 : read_matrix (file_search ("wind.data"))$
1692 (%i3) s : cov1 (s2)$
1693 @group
1694 (%i4) global_variances (s, false);
1695 (%o4) [105.338342060606, 21.06766841212119, 12874.34690469686, 
1696          113.4651792608501, 6.636590811800795, 2.576158149609762]
1697 @end group
1698 @end example
1700 @code{cov}と@code{cov1}も参照してください。
1702 @opencatbox
1703 @category{Package descriptive}
1704 @closecatbox
1705 @end deffn
1709 @deffn {関数} cor (@var{matrix})
1710 @deffnx {関数} cor (@var{matrix}, @var{logical_value})
1711 多変量標本の相関行列です。
1713 例:
1715 @c ===beg===
1716 @c load ("descriptive")$
1717 @c fpprintprec : 7 $
1718 @c s2 : read_matrix (file_search ("wind.data"))$
1719 @c cor (s2);
1720 @c ===end===
1721 @example
1722 (%i1) load ("descriptive")$
1723 (%i2) fpprintprec : 7 $
1724 (%i3) s2 : read_matrix (file_search ("wind.data"))$
1725 @group
1726 (%i4) cor (s2);
1727       [   1.0     .8476339  .8803515  .8239624  .7519506 ]
1728       [                                                  ]
1729       [ .8476339    1.0     .8735834  .6902622  0.782502 ]
1730       [                                                  ]
1731 (%o4) [ .8803515  .8735834    1.0     .7764065  .8323358 ]
1732       [                                                  ]
1733       [ .8239624  .6902622  .7764065    1.0     .7293848 ]
1734       [                                                  ]
1735       [ .7519506  0.782502  .8323358  .7293848    1.0    ]
1736 @end group
1737 @end example
1739 関数@code{cor}はオプションの論理引数を取ります:
1740 @code{cor(x,true)}は、
1741 Maximaに@code{x}がデータ行列であることを伝え、@code{cor(x)}と同様に作られます。
1742 一方、@code{cor(x,false)}は
1743 @code{x}がデータ行列ではなく、共分散行列であることを意味し、再計算は避けられます。
1745 @c ===beg===
1746 @c load ("descriptive")$
1747 @c fpprintprec : 7 $
1748 @c s2 : read_matrix (file_search ("wind.data"))$
1749 @c s : cov1 (s2)$
1750 @c cor (s, false); /* this is faster */
1751 @c ===end===
1752 @example
1753 (%i1) load ("descriptive")$
1754 (%i2) fpprintprec : 7 $
1755 (%i3) s2 : read_matrix (file_search ("wind.data"))$
1756 (%i4) s : cov1 (s2)$
1757 @group
1758 (%i5) cor (s, false); /* this is faster */
1759       [   1.0     .8476339  .8803515  .8239624  .7519506 ]
1760       [                                                  ]
1761       [ .8476339    1.0     .8735834  .6902622  0.782502 ]
1762       [                                                  ]
1763 (%o5) [ .8803515  .8735834    1.0     .7764065  .8323358 ]
1764       [                                                  ]
1765       [ .8239624  .6902622  .7764065    1.0     .7293848 ]
1766       [                                                  ]
1767       [ .7519506  0.782502  .8323358  .7293848    1.0    ]
1768 @end group
1769 @end example
1771 @code{cov}と@code{cov1}も参照してください。
1773 @opencatbox
1774 @category{Package descriptive}
1775 @closecatbox
1776 @end deffn
1780 @deffn {関数} list_correlations (@var{matrix})
1781 @deffnx {関数} list_correlations (@var{matrix}, @var{logical_value})
1782 関数@code{list_correlations}は相関尺度のリストを返します:
1784 @itemize @bullet
1786 @item
1787 @var{precision matrix}: 共分散行列@math{S_1}の逆行列,
1788 @ifnottex
1789 @example
1790 @group
1791        -1     ij
1792       S   = (s  )             
1793        1         i,j = 1,2,...,p
1794 @end group
1795 @end example
1796 @end ifnottex
1797 @tex
1798 $${S_{1}^{-1}}={\left(s^{ij}\right)_{i,j=1,2,\ldots, p}}$$
1799 @end tex
1801 @item
1802 @var{multiple correlation vector}:  @math{(R_1^2, R_2^2, ..., R_p^2)},
1803 @ifnottex
1804 @example
1805 @group
1806        2          1
1807       R  = 1 - -------
1808        i        ii
1809                s   s
1810                     ii
1811 @end group
1812 @end example
1813 @end ifnottex
1814 @tex
1815 $${R_{i}^{2}}={1-{{1}\over{s^{ii}s_{ii}}}}$$
1816 @end tex
1817 変数の残りが独立変数として使われるとき
1818 これらは@math{X_i}上の線形多変量回帰モデルの適合度の指標です。
1820 @item
1821 @var{partial correlation matrix}: @math{(i, j)}成分が以下の行列
1822 @ifnottex
1823 @example
1824 @group
1825                          ij
1826                         s
1827       r        = - ------------
1828        ij.rest     / ii  jj\ 1/2
1829                    |s   s  |
1830                    \       /
1831 @end group
1832 @end example
1833 @end ifnottex
1834 @tex
1835 $${r_{ij.rest}}={-{{s^{ij}}\over \sqrt{s^{ii}s^{jj}}}}$$
1836 @end tex
1838 @end itemize
1840 例:
1842 @c ===beg===
1843 @c load ("descriptive")$
1844 @c s2 : read_matrix (file_search ("wind.data"))$
1845 @c z : list_correlations (s2)$
1846 @c fpprintprec : 5$ /* for pretty output */
1847 @c z[1];  /* precision matrix */
1848 @c z[2];  /* multiple correlation vector */
1849 @c z[3];  /* partial correlation matrix */
1850 @c ===end===
1851 @example
1852 (%i1) load ("descriptive")$
1853 (%i2) s2 : read_matrix (file_search ("wind.data"))$
1854 (%i3) z : list_correlations (s2)$
1855 (%i4) fpprintprec : 5$ /* for pretty output */
1856 @group
1857 (%i5) z[1];  /* precision matrix */
1858       [  .38486   - .13856   - .15626   - .10239    .031179  ]
1859       [                                                      ]
1860       [ - .13856   .34107    - .15233    .038447   - .052842 ]
1861       [                                                      ]
1862 (%o5) [ - .15626  - .15233    .47296    - .024816  - .10054  ]
1863       [                                                      ]
1864       [ - .10239   .038447   - .024816   .10937    - .034033 ]
1865       [                                                      ]
1866       [ .031179   - .052842  - .10054   - .034033   .14834   ]
1867 @end group
1868 @group
1869 (%i6) z[2];  /* multiple correlation vector */
1870 (%o6)      [.85063, .80634, .86474, .71867, .72675]
1871 @end group
1872 @group
1873 (%i7) z[3];  /* partial correlation matrix */
1874       [  - 1.0     .38244   .36627   .49908   - .13049 ]
1875       [                                                ]
1876       [  .38244    - 1.0    .37927  - .19907   .23492  ]
1877       [                                                ]
1878 (%o7) [  .36627    .37927   - 1.0    .10911    .37956  ]
1879       [                                                ]
1880       [  .49908   - .19907  .10911   - 1.0     .26719  ]
1881       [                                                ]
1882       [ - .13049   .23492   .37956   .26719    - 1.0   ]
1883 @end group
1884 @end example
1886 関数@code{list_correlations}もオプションの論理引数を取ります:
1887 @code{list_correlations(x,true)}は、
1888 Maximaに@code{x}がデータ行列であることを伝え、
1889 @code{list_correlations(x)}と同様に作られます。
1890 一方、@code{list_correlations(x,false)}は
1891 @code{x}がデータ行列ではなく、共分散行列であることを意味し、再計算は避けられます。
1893 @code{cov}と@code{cov1}も参照してください。
1895 @opencatbox
1896 @category{Package descriptive}
1897 @closecatbox
1898 @end deffn
1902 @node Functions and Variables for statistical graphs,  , Functions and Variables for descriptive statistics, descriptive
1903 @section Functions and Variables for statistical graphs
1907 @deffn  {関数} barsplot (@var{data1}, @var{data2}, @dots{}, @var{option_1}, @var{option_2}, @dots{})
1908 @deffnx {関数} barsplot_description (@dots{})
1910 1変量、多変量どちらの標本でも離散統計変数の棒グラフをプロットします
1912 @var{data}は1標本を意味する結果のリストかもしれませんし、
1913 それぞれサイズ@var{m}の@var{n}個の標本を意味する@var{m}行@var{n}列の行列かもしれません。
1915 利用可能なオプションは以下のものです:
1917 @itemize @bullet
1919 @item
1920 @code{draw}パッケージで定義されたもの。
1921 @item
1922 @var{box_width} (デフォルト, @code{3/4}): 長方形の相対幅。
1923 値は範囲@code{[0,1]}内でなければいけません。
1925 @item
1926 @var{grouping} (デフォルト, @code{clustered}):
1927 複数の標本をいかに表示するか示します。
1928 有効な値: @code{clustered}と @code{stacked}。
1930 @item
1931 @var{groups_gap} (デフォルト, @code{1}): 棒の2つの隣り合うグループの隙間を表す正の整数。
1933 @item
1934 @var{bars_colors} (デフォルト, @code{[]}): 複数の標本のための色のリスト。
1935 指定された色よりもたくさん標本がある時は、
1936 追加で必要な色はランダムに選ばれます。
1937 更に詳しくは@code{color}を参照してください。
1939 @item
1940 @var{frequency} (デフォルト, @code{absolute}): 縦座標のスケールを示します。
1941 可能な値: @code{absolute}, @code{relative}, @code{percent}。
1943 @item
1944 @var{ordering} (デフォルト, @code{orderlessp}): 可能な値は@code{orderlessp}か@code{ordergreatp}です。
1945 統計的結果がどちら向きに@var{x}軸に並んでいるかを示します。
1947 @item
1948 @var{sample_keys} (デフォルト, @code{[]}): 凡例に使われる文字列のリスト。
1949 リストの長さが0か標本の長さ以外なら、
1950 エラーメッセージを返します。
1952 @item
1953 @var{start_at} (デフォルト, @code{0}): x軸上のどこからプロットされるか示します。
1955 @item
1956 @code{barsplot}が内部で割り当てる
1957 @code{xtics}を除くすべてのグローバル @code{draw}オプション
1958 もしこのオプションに自分の値を設定し、複雑なシーンを構築したいなら、
1959 @code{barsplot_description}を使用してください。
1960 以下の例を参照してください。
1962 @item
1963 以下のローカル @code{draw}オプション: @code{key}, @code{color}, 
1964 @code{fill_color}, @code{fill_density}, @code{line_width}。
1965 @code{bars}も参照してください。
1967 @end itemize
1969 関数@code{barsplot_description}は
1970 他のグラフィックオブジェクトと一緒に複雑なシーンを生成するために
1971 グラフィックオブジェクトを生成します。
1972 wxMaximaとiMaximaインターフェイスで埋め込みヒストグラムを生成するための
1973 関数@code{wxbarsplot}もあります。
1975 例:
1977 行列形式での1変量標本。絶対頻度。
1979 @c ===beg===
1980 @c load ("descriptive")$
1981 @c m : read_matrix (file_search ("biomed.data"))$
1982 @c barsplot(
1983 @c   col(m,2),
1984 @c   title        = "Ages",
1985 @c   xlabel       = "years",
1986 @c   box_width    = 1/2,
1987 @c   fill_density = 3/4)$
1988 @c ===end===
1989 @example
1990 (%i1) load ("descriptive")$
1991 (%i2) m : read_matrix (file_search ("biomed.data"))$
1992 @group
1993 (%i3) barsplot(
1994         col(m,2),
1995         title        = "Ages",
1996         xlabel       = "years",
1997         box_width    = 1/2,
1998         fill_density = 3/4)$
1999 @end group
2000 @end example
2002 異なるサイズの2つの標本。
2003 相対頻度とユーザー宣言の色を使って。
2005 @c ===beg===
2006 @c load ("descriptive")$
2007 @c l1:makelist(random(10),k,1,50)$
2008 @c l2:makelist(random(10),k,1,100)$
2009 @c barsplot(
2010 @c    l1,l2,
2011 @c    box_width = 1,
2012 @c    fill_density = 1,
2013 @c    bars_colors = [black, grey],
2014 @c    frequencies = relative,
2015 @c    sample_keys = ["A", "B"])$
2016 @c ===end===
2017 @example
2018 (%i1) load ("descriptive")$
2019 (%i2) l1:makelist(random(10),k,1,50)$
2020 (%i3) l2:makelist(random(10),k,1,100)$
2021 @group
2022 (%i4) barsplot(
2023         l1,l2,
2024         box_width    = 1,
2025         fill_density = 1,
2026         bars_colors  = [black, grey],
2027         frequencies = relative,
2028         sample_keys = ["A", "B"])$
2029 @end group
2030 @end example
2032 サイズが等しい4つの非数標本。
2034 @c ===beg===
2035 @c load ("descriptive")$
2036 @c barsplot(
2037 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2038 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2039 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2040 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2041 @c   title      = "Asking for something to four groups",
2042 @c   ylabel     = "# of individuals",
2043 @c   groups_gap = 3,
2044 @c   fill_density = 0.5,
2045 @c   ordering = ordergreatp)$
2046 @c ===end===
2047 @example
2048 (%i1) load ("descriptive")$
2049 @group
2050 (%i2) barsplot(
2051         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2052         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2053         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2054         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2055         title  = "Asking for something to four groups",
2056         ylabel = "# of individuals",
2057         groups_gap   = 3,
2058         fill_density = 0.5,
2059         ordering     = ordergreatp)$
2060 @end group
2061 @end example
2063 スタックバー。
2065 @c ===beg===
2066 @c load ("descriptive")$
2067 @c barsplot(
2068 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2069 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2070 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2071 @c   makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2072 @c   title      = "Asking for something to four groups",
2073 @c   ylabel     = "# of individuals",
2074 @c   grouping   = stacked,
2075 @c   fill_density = 0.5,
2076 @c   ordering = ordergreatp)$
2077 @c ===end===
2078 @example
2079 (%i1) load ("descriptive")$
2080 @group
2081 (%i2) barsplot(
2082         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2083         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2084         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2085         makelist([Yes, No, Maybe][random(3)+1],k,1,50),
2086         title  = "Asking for something to four groups",
2087         ylabel = "# of individuals",
2088         grouping     = stacked,
2089         fill_density = 0.5,
2090         ordering     = ordergreatp)$
2091 @end group
2092 @end example
2094 複数プロット文脈での@code{barsplot}。
2096 @example
2097 (%i1) load ("descriptive")$
2098 (%i2) l1:makelist(random(10),k,1,50)$
2099 (%i3) l2:makelist(random(10),k,1,100)$
2100 (%i4) bp1 : 
2101         barsplot_description(
2102          l1,
2103          box_width = 1,
2104          fill_density = 0.5,
2105          bars_colors = [blue],
2106          frequency = relative)$
2107 (%i5) bp2 : 
2108         barsplot_description(
2109          l2,
2110          box_width = 1,
2111          fill_density = 0.5,
2112          bars_colors = [red],
2113          frequency = relative)$
2114 (%i6) draw(gr2d(bp1), gr2d(bp2))$
2115 @end example
2117 棒グラフ関連オプションについては、パッケージ@code{draw}の@code{bars}を参照してください。
2118 関数@code{histogram}と@code{piechart}も参照してください。
2120 @opencatbox
2121 @category{Package descriptive}
2122 @category{Plotting}
2123 @closecatbox
2124 @end deffn
2126 @deffn  {関数} boxplot (@var{data})
2127 @deffnx {関数} boxplot (@var{data}, @var{option_1}, @var{option_2}, @dots{})
2128 @deffnx {関数} boxplot_description ( @dots{})
2130 この関数は箱ひげ図をプロットします。
2131 引数@var{data}はリストだったり行列だったりします。
2132 箱ひげ図は主に異なる標本の比較に使われるので、リストはあまり興味深くありません。
2133 行列の場合には多変量統計変数の複数成分おw比較することが可能です。
2134 しかし、できる限り異なる標本サイズの標本のリストも許すようにしています。
2135 実際、これは、パッケージ@code{descriptive}の中で
2136 この種のデータ構造を許容する唯一の関数です
2138 利用可能なオプションは以下のものです:
2140 @itemize @bullet
2142 @item
2143 @var{box_width} (デフォルト, @code{3/4}): 箱の相対幅。
2144 この値は範囲@code{[0,1]}内でなければいけません。
2146 @item
2147 @var{box_orientation} (デフォルト, @code{vertical}): 可能な値: @code{vertical}
2148 と @code{horizontal}。
2150 @item
2151 @code{boxplot}が内部で割り当てる
2152 @code{points_joined}, @code{point_size}, @code{point_type},
2153 @code{xtics}, @code{ytics}, @code{xrange}, @code{yrange}を除く
2154 すべての @code{draw}オプション。
2155 もしこのオプションに自分の値を設定し、複雑なシーンを構築したいなら、
2156 @code{boxplot_description}を使用してください。
2158 @item
2159 以下のローカル @code{draw}オプション: @code{key}, @code{color},  @code{line_width}。
2161 @end itemize
2163 関数@code{boxplot_description}は
2164 他のグラフィックオブジェクトと一緒に複雑なシーンを生成するために
2165 グラフィックオブジェクトを生成します。
2166 wxMaximaとiMaximaインターフェイスで埋め込みヒストグラムを生成するための
2167 関数@code{wxbarsplot}もあります。
2169 例:
2171 多変量標本の箱ひげ図。
2173 @c ===beg===
2174 @c load ("descriptive")$
2175 @c s2 : read_matrix(file_search("wind.data"))$
2176 @c boxplot(s2,
2177 @c   box_width  = 0.2,
2178 @c   title      = "Windspeed in knots",
2179 @c   xlabel     = "Stations",
2180 @c   color      = red,
2181 @c   line_width = 2)$
2182 @c ===end===
2183 @example
2184 (%i1) load ("descriptive")$
2185 (%i2) s2 : read_matrix(file_search("wind.data"))$
2186 @group
2187 (%i3) boxplot(s2,
2188         box_width  = 0.2,
2189         title      = "Windspeed in knots",
2190         xlabel     = "Stations",
2191         color      = red,
2192         line_width = 2)$
2193 @end group
2194 @end example
2196 異なるサイズの3つの標本の箱ひげ図。
2198 @c ===beg===
2199 @c load ("descriptive")$
2200 @c A :
2201 @c  [[6, 4, 6, 2, 4, 8, 6, 4, 6, 4, 3, 2],
2202 @c   [8, 10, 7, 9, 12, 8, 10],
2203 @c   [16, 13, 17, 12, 11, 18, 13, 18, 14, 12]]$
2204 @c boxplot (A, box_orientation = horizontal)$
2205 @c ===end===
2206 @example
2207 (%i1) load ("descriptive")$
2208 @group
2209 (%i2) A :
2210        [[6, 4, 6, 2, 4, 8, 6, 4, 6, 4, 3, 2],
2211         [8, 10, 7, 9, 12, 8, 10],
2212         [16, 13, 17, 12, 11, 18, 13, 18, 14, 12]]$
2213 @end group
2214 (%i3) boxplot (A, box_orientation = horizontal)$
2215 @end example
2217 @opencatbox
2218 @category{Package descriptive}
2219 @category{Plotting}
2220 @closecatbox
2221 @end deffn
2225 @deffn  {関数} histogram (@var{list})
2226 @deffnx {関数} histogram (@var{list}, @var{option_1}, @var{option_2}, @dots{})
2227 @deffnx {関数} histogram (@var{one_column_matrix})
2228 @deffnx {関数} histogram (@var{one_column_matrix}, @var{option_1}, @var{option_2}, @dots{})
2229 @deffnx {関数} histogram (@var{one_row_matrix})
2230 @deffnx {関数} histogram (@var{one_row_matrix}, @var{option_1}, @var{option_2}, @dots{})
2231 @deffnx {関数} histogram_description (@dots{})
2232 この関数は一連の標本からヒストグラムをプロットします。
2233 標本データは数のリストか一次元行列に保存しなければいけません。
2235 利用可能なオプションは以下のものです:
2237 @itemize @bullet
2239 @item
2240 @var{nclasses} (デフォルト, @code{10}): ヒストグラムのクラス数、もしくは
2241 クラスの境界と数か境界だけを含むリスト。
2243 @item
2244 @var{frequency} (デフォルト, @code{absolute}): 縦座標のスケールを示します。
2245 可能な値: @code{absolute}, @code{relative}, @code{percent}。
2247 @item
2248 @var{htics} (デフォルト, @code{auto}): ヒストグラムチックのフォーマット。
2249 可能な値: @code{auto}, @code{endpoints}, @code{intervals}, かラベルのリスト。
2251 @item
2252 @code{histogram}が内部で割り当てる@code{xrange}, @code{yrange}, @code{xtics}を除く
2253 すべてのグローバル @code{draw}オプション。
2254 もしこれらのオプションに自分の値を設定したいなら、
2255 @code{histogram_description}を利用してください。
2256 以下の例を参照してください。
2258 @item
2259 以下のローカル @code{draw}オプション: @code{key}, @code{color}, 
2260 @code{fill_color}, @code{fill_density}と @code{line_width}.
2261 @code{bars}も参照してください。
2263 @end itemize
2265 関数 @code{histogram_description}は他のグラフィックオブジェクトと一緒に
2266 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。
2267 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する
2268 関数@code{wxhistogram}もあります。
2270 例:
2272 8クラスを持つ簡単なヒストグラム。
2274 @c ===beg===
2275 @c load ("descriptive")$
2276 @c s1 : read_list (file_search ("pidigits.data"))$
2277 @c histogram (
2278 @c      s1,
2279 @c      nclasses     = 8,
2280 @c      title        = "pi digits",
2281 @c      xlabel       = "digits",
2282 @c      ylabel       = "Absolute frequency",
2283 @c      fill_color   = grey,
2284 @c      fill_density = 0.6)$
2285 @c ===end===
2286 @example
2287 (%i1) load ("descriptive")$
2288 (%i2) s1 : read_list (file_search ("pidigits.data"))$
2289 (%i3) histogram (
2290            s1,
2291            nclasses     = 8,
2292            title        = "pi digits",
2293            xlabel       = "digits",
2294            ylabel       = "Absolute frequency",
2295            fill_color   = grey,
2296            fill_density = 0.6)$
2297 @end example
2300 ヒストグラムの境界を-2と12に、クラス数を3に設定します。
2301 また予め定義されたチックを導入します:
2303 @example
2304 (%i1) load ("descriptive")$
2305 (%i2) s1 : read_list (file_search ("pidigits.data"))$
2306 (%i3) histogram (
2307            s1,
2308            nclasses     = [-2,12,3],
2309            htics        = ["A", "B", "C"],
2310            terminal     = png,
2311            fill_color   = "#23afa0",
2312            fill_density = 0.6)$
2313 @end example
2315 @code{xrange}を設定しシーンの中に明示的な曲線を足すのに
2316 @code{histogram_description}を利用します:
2318 @example
2319 (%i1) load ("descriptive")$
2320 (%i2) ( load("distrib"),
2321         m: 14, s: 2,
2322         s2: random_normal(m, s, 1000) ) $
2323 (%i3) draw2d(
2324         grid   = true,
2325         xrange = [5, 25],
2326         histogram_description(
2327           s2,
2328           nclasses     = 9,
2329           frequency    = relative,
2330           fill_density = 0.5),
2331         explicit(pdf_normal(x,m,s), x, m - 3*s, m + 3* s))$
2332 @end example
2334 @opencatbox
2335 @category{Package descriptive}
2336 @category{Plotting}
2337 @closecatbox
2338 @end deffn
2343 @deffn {関数} piechart (@var{list})
2344 @deffnx {関数} piechart (@var{list}, @var{option_1}, @var{option_2}, @dots{})
2345 @deffnx {関数} piechart (@var{one_column_matrix})
2346 @deffnx {関数} piechart (@var{one_column_matrix}, @var{option_1}, @var{option_2}, @dots{})
2347 @deffnx {関数} piechart (@var{one_row_matrix})
2348 @deffnx {関数} piechart (@var{one_row_matrix}, @var{option_1}, @var{option_2}, @dots{})
2349 @deffnx {関数} piechart_description (@dots{})
2351 @code{barsplot}に似ていますが、長方形の代わりに扇をプロットします。
2353 利用可能なオプションは以下のものです:
2355 @itemize @bullet
2357 @item
2358 @var{sector_colors} (デフォルト, @code{[]}): セクタの色のリスト。
2359 指定した色よりも多くセクタがあるときは、必要な色の超過分がランダムに選ばれます。
2360 それらについて更に知るには @code{color}を参照してください。
2362 @item
2363 @var{pie_center} (デフォルト, @code{[0,0]}): 円グラフの中心。
2365 @item
2366 @var{pie_radius} (デフォルト, @code{1}): 円グラフの半径。
2368 @item
2369 @code{piechart}が内部で割り当てる@code{key}を除いたすべてのグローバル @code{draw}オプション。
2370 もしこのオプションに自分の値を設定し、複雑なシーンを構築したいなら、
2371 @code{piechart_description}を利用してください。
2373 @item
2374 以下のローカル @code{draw}オプション: @code{key}, @code{color},
2375 @code{fill_display}, @code{line_width}。
2376 @code{ellipse}も参照してください。
2378 @end itemize
2380 関数 @code{piechart_description}は他のグラフィックオブジェクトと一緒に
2381 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。
2382 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する
2383 関数@code{wxhistogram}もあります。
2385 例:
2387 @c ===beg===
2388 @c load ("descriptive")$
2389 @c s1 : read_list (file_search ("pidigits.data"))$
2390 @c piechart(
2391 @c   s1,
2392 @c   xrange = [-1.1, 1.3],
2393 @c   yrange = [-1.1, 1.1],
2394 @c   title  = "Digit frequencies in pi")$
2395 @c ===end===
2396 @example
2397 (%i1) load ("descriptive")$
2398 (%i2) s1 : read_list (file_search ("pidigits.data"))$
2399 (%i3) piechart(
2400         s1,
2401         xrange = [-1.1, 1.3],
2402         yrange = [-1.1, 1.1],
2403         title  = "Digit frequencies in pi")$
2404 @end example
2406 関数@code{barsplot}も参照してください。
2408 @opencatbox
2409 @category{Package descriptive}
2410 @category{Plotting}
2411 @closecatbox
2412 @end deffn
2416 @deffn  {関数} scatterplot (@var{list})
2417 @deffnx {関数} scatterplot (@var{list}, @var{option_1}, @var{option_2}, @dots{})
2418 @deffnx {関数} scatterplot (@var{matrix})
2419 @deffnx {関数} scatterplot (@var{matrix}, @var{option_1}, @var{option_2}, @dots{})
2420 @deffnx {関数} scatterplot_description (@dots{})
2422 1変量(@var{list})や多変量(@var{matrix})の標本の散布図をプロットします。
2424 利用可能なオプションは @code{histogram}が許すものと同じです。
2426 関数 @code{scatterplot_description}は他のグラフィックオブジェクトと一緒に
2427 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。
2428 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する
2429 関数@code{wxscatterplot}もあります。
2431 例:
2433 シミュレーティッドGauss標本の1変量散布図。
2435 @c ===beg===
2436 @c load ("descriptive")$
2437 @c load ("distrib")$
2438 @c scatterplot(
2439 @c   random_normal(0,1,200),
2440 @c   xaxis      = true,
2441 @c   point_size = 2,
2442 @c   dimensions = [600,150]$
2443 @c ===end===
2444 @example
2445 (%i1) load ("descriptive")$
2446 (%i2) load ("distrib")$
2447 @group
2448 (%i3) scatterplot(
2449         random_normal(0,1,200),
2450         xaxis      = true,
2451         point_size = 2,
2452         dimensions = [600,150])$
2453 @end group
2454 @end example
2456 二次元散布図。
2458 @c ===beg===
2459 @c load ("descriptive")$
2460 @c s2 : read_matrix (file_search ("wind.data"))$
2461 @c scatterplot(
2462 @c  submatrix(s2, 1,2,3),
2463 @c  title      = "Data from stations #4 and #5",
2464 @c  point_type = diamant,
2465 @c  point_size = 2,
2466 @c  color      = blue)$
2467 @c ===end===
2468 @example
2469 (%i1) load ("descriptive")$
2470 (%i2) s2 : read_matrix (file_search ("wind.data"))$
2471 @group
2472 (%i3) scatterplot(
2473        submatrix(s2, 1,2,3),
2474        title      = "Data from stations #4 and #5",
2475        point_type = diamant,
2476        point_size = 2,
2477        color      = blue)$
2478 @end group
2479 @end example
2481 3次元散布図。
2483 @c ===beg===
2484 @c load ("descriptive")$
2485 @c s2 : read_matrix (file_search ("wind.data"))$
2486 @c scatterplot(submatrix (s2, 1,2), nclasses=4)$
2487 @c ===end===
2488 @example
2489 (%i1) load ("descriptive")$
2490 (%i2) s2 : read_matrix (file_search ("wind.data"))$
2491 (%i3) scatterplot(submatrix (s2, 1,2), nclasses=4)$
2492 @end example
2494 5つのクラスのヒストグラムと5次元散布図。
2496 @c ===beg===
2497 @c load ("descriptive")$
2498 @c s2 : read_matrix (file_search ("wind.data"))$
2499 @c scatterplot(
2500 @c   s2,
2501 @c   nclasses     = 5,
2502 @c   frequency    = relative,
2503 @c   fill_color   = blue,
2504 @c   fill_density = 0.3,
2505 @c   xtics        = 5)$
2506 @c ===end===
2507 @example
2508 (%i1) load ("descriptive")$
2509 (%i2) s2 : read_matrix (file_search ("wind.data"))$
2510 @group
2511 (%i3) scatterplot(
2512         s2,
2513         nclasses     = 5,
2514         frequency    = relative,
2515         fill_color   = blue,
2516         fill_density = 0.3,
2517         xtics        = 5)$
2518 @end group
2519 @end example
2521 2次元か3次元で孤立点か線で結んだ点をプロットすることについては、
2522 @code{points}を参照してください。
2523 @code{histogram}も参照してください。
2525 @opencatbox
2526 @category{Package descriptive}
2527 @category{Plotting}
2528 @closecatbox
2529 @end deffn
2531 @deffn {関数} starplot (@var{data1}, @var{data2}, @dots{}, @var{option_1}, @var{option_2}, @dots{})
2532 @deffnx {関数} starplot_description (@dots{})
2534 1変量、多変量どちらの標本でも離散統計変数のスターダイアグラムをプロットします
2536 @var{data}は1標本を意味する結果のリストかもしれませんし、
2537 それぞれサイズ@var{m}の@var{n}個の標本を意味する@var{m}行@var{n}列の行列かもしれません。
2539 利用可能なオプションは以下のものです:
2541 @itemize @bullet
2543 @item
2544 @var{stars_colors} (デフォルト, @code{[]}): 多変量標本の色のリスト。
2545 指定した色よりも多くセクタがあるときは、必要な色の超過分がランダムに選ばれます。
2546 それらについて更に知るには @code{color}を参照してください。
2548 @item
2549 @var{frequency} (デフォルト, @code{absolute}): 半径のスケールを示します。
2550 可能な値: @code{absolute}, @code{relative}, @code{percent}。
2552 @item
2553 @var{ordering} (デフォルト, @code{orderlessp}): 可能な値は@code{orderlessp}か@code{ordergreatp}です。
2554 統計的結果がどちら向きに@var{x}軸に並んでいるかを示します。
2556 @item
2557 @var{sample_keys} (デフォルト, @code{[]}): 凡例に使われる文字列のリスト。
2558 リストの長さが0か標本の長さ以外なら、
2559 エラーメッセージを返します。
2561 @item
2562 @var{star_center} (デフォルト, @code{[0,0]}): ダイアグラムの中心。
2564 @item
2565 @var{star_radius} (デフォルト, @code{1}): ダイアグラムの半径。
2567 @item
2568 @code{starplot}が内部で割り当てる@code{points_joined}, @code{point_type}, @code{key}を除いたすべてのグローバル @code{draw}オプション。
2569 もしこのオプションに自分の値を設定し、複雑なシーンを構築したいなら、
2570 @code{starplot_description}を利用してください。
2572 @item
2573 以下のローカル @code{draw}オプション: @code{line_width}。
2575 @end itemize
2577 関数 @code{starplot_description}は他のグラフィックオブジェクトと一緒に
2578 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。
2579 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する
2580 関数@code{wxstarplot}もあります。
2582 例:
2584 絶対頻度に基づいたプロット。
2585 ユーザーが定義した位置と半径。
2587 @example
2588 (%i1) load ("descriptive")$
2589 (%i2) l1: makelist(random(10),k,1,50)$
2590 (%i3) l2: makelist(random(10),k,1,200)$
2591 @group
2592 (%i4) starplot(
2593         l1, l2,
2594         stars_colors = [blue,red],
2595         sample_keys = ["1st sample", "2nd sample"],
2596         star_center = [1,2],
2597         star_radius = 4,
2598         proportional_axes = xy,
2599         line_width = 2 ) $ 
2600 @end group
2601 @end example
2604 @opencatbox
2605 @category{Package descriptive}
2606 @category{Plotting}
2607 @closecatbox
2608 @end deffn
2611 @deffn {関数} stemplot (@var{data})
2612 @deffnx {関数} stemplot (@var{data}, @var{option})
2614 幹葉図をプロットします。
2616 固有の利用可能なオプションは:
2618 @itemize @bullet
2620 @item
2621 @var{leaf_unit} (デフォルト, @code{1}): 葉の単位を示します;
2622 10のべきでなければいけません。
2624 @end itemize
2626 例:
2628 @example
2629 (%i1) load ("descriptive")$
2630 (%i2) load("distrib")$
2631 @group
2632 (%i3) stemplot(
2633         random_normal(15, 6, 100),
2634         leaf_unit = 0.1);
2635 -5|4
2636  0|37
2637  1|7
2638  3|6
2639  4|4
2640  5|4
2641  6|57
2642  7|0149
2643  8|3
2644  9|1334588
2645 10|07888
2646 11|01144467789
2647 12|12566889
2648 13|24778
2649 14|047
2650 15|223458
2651 16|4
2652 17|11557
2653 18|000247
2654 19|4467799
2655 20|00
2656 21|1
2657 22|2335
2658 23|01457
2659 24|12356
2660 25|455
2661 27|79
2662 key: 6|3 =  6.3
2663 (%o3)                  done
2664 @end group
2665 @end example
2667 @opencatbox
2668 @category{Package descriptive}
2669 @category{Plotting}
2670 @closecatbox
2671 @end deffn