File: octave_26.html

package info (click to toggle)
octave2.1 1%3A2.1.73-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 37,028 kB
  • ctags: 20,874
  • sloc: cpp: 106,508; fortran: 46,978; ansic: 5,720; sh: 4,800; makefile: 3,186; yacc: 3,132; lex: 2,892; lisp: 1,715; perl: 778; awk: 174; exp: 134
file content (2807 lines) | stat: -rw-r--r-- 96,539 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html40/loose.dtd">
<HTML>
<!-- Created on May, 18 2005 by texi2html 1.66 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<HEAD>
<TITLE>GNU Octave: Statistics</TITLE>

<META NAME="description" CONTENT="GNU Octave: Statistics">
<META NAME="keywords" CONTENT="GNU Octave: Statistics">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.66">

</HEAD>

<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<A NAME="SEC176"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_25.html#SEC175"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC177"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_25.html#SEC171"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_27.html#SEC181"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 25. Statistics </H1>
<!--docid::SEC176::-->
<P>

I hope that someday Octave will include more statistics functions.  If
you would like to help improve Octave in this area, please contact
<A HREF="mailto:bug@octave.org">bug@octave.org</A>.
</P>
<P>

<TABLE BORDER="0" CELLSPACING="0">
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_26.html#SEC177">25.1 Basic Statistical Functions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_26.html#SEC178">25.2 Tests</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_26.html#SEC179">25.3 Models</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="octave_26.html#SEC180">25.4 Distributions</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
</TABLE>
<P>

<A NAME="Basic Statistical Functions"></A>
<HR SIZE="6">
<A NAME="SEC177"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC178"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_27.html#SEC181"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.1 Basic Statistical Functions </H2>
<!--docid::SEC177::-->
<P>

<A NAME="doc-mean"></A>
<A NAME="IDX775"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>mean</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>, <VAR>opt</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, compute the mean of the elements of <VAR>x</VAR>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>mean (x) = SUM_i x(i) / N
</pre></td></tr></table>If <VAR>x</VAR> is a matrix, compute the mean for each column and return them
in a row vector.
<P>

With the optional argument <VAR>opt</VAR>, the kind of mean computed can be
selected.  The following options are recognized:
</P>
<P>

</P>
<DL COMPACT>
<DT><CODE>&quot;a&quot;</CODE>
<DD>Compute the (ordinary) arithmetic mean.  This is the default.
<P>

</P>
<DT><CODE>&quot;g&quot;</CODE>
<DD>Computer the geometric mean.
<P>

</P>
<DT><CODE>&quot;h&quot;</CODE>
<DD>Compute the harmonic mean.
</DL>
<P>

If the optional argument <VAR>dim</VAR> is supplied, work along dimension
<VAR>dim</VAR>.
</P>
<P>

Both <VAR>dim</VAR> and <VAR>opt</VAR> are optional.  If both are supplied,
either may appear first.
</P>
</DL>
<P>

<A NAME="doc-median"></A>
<A NAME="IDX776"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>median</B> <I>(<VAR>x</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, compute the median value of the elements of
<VAR>x</VAR>.
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>            x(ceil(N/2)),             N odd
median(x) =
            (x(N/2) + x((N/2)+1))/2,  N even
</pre></td></tr></table>If <VAR>x</VAR> is a matrix, compute the median value for each
column and return them in a row vector.
</DL>
<P>

<A NAME="doc-std"></A>
<A NAME="IDX777"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>std</B> <I>(<VAR>x</VAR>)</I>
<DD><A NAME="IDX778"></A>
<DT><U>Function File:</U>  <B>std</B> <I>(<VAR>x</VAR>, <VAR>opt</VAR>)</I>
<DD><A NAME="IDX779"></A>
<DT><U>Function File:</U>  <B>std</B> <I>(<VAR>x</VAR>, <VAR>opt</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, compute the standard deviation of the elements
of <VAR>x</VAR>.
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>std (x) = sqrt (sumsq (x - mean (x)) / (n - 1))
</pre></td></tr></table>If <VAR>x</VAR> is a matrix, compute the standard deviation for
each column and return them in a row vector.
<P>

The argument <VAR>opt</VAR> determines the type of normalization to use. Valid values
are
</P>
<P>

</P>
<DL COMPACT>
<DT>0:
<DD>  normalizes with N-1, provides the square root of best unbiased estimator of 
  the variance [default]
<DT>1:
<DD>  normalizes with N, this provides the square root of the second moment around 
  the mean
</DL>
<P>

The third argument <VAR>dim</VAR> determines the dimension along which the standard
deviation is calculated.
</P>
</DL>
<P>

<A NAME="doc-cov"></A>
<A NAME="IDX780"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cov</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>If each row of <VAR>x</VAR> and <VAR>y</VAR> is an observation and each column is
a variable, the (<VAR>i</VAR>, <VAR>j</VAR>)-th entry of
<CODE>cov (<VAR>x</VAR>, <VAR>y</VAR>)</CODE> is the covariance between the <VAR>i</VAR>-th
variable in <VAR>x</VAR> and the <VAR>j</VAR>-th variable in <VAR>y</VAR>.  If called
with one argument, compute <CODE>cov (<VAR>x</VAR>, <VAR>x</VAR>)</CODE>.
</DL>
<P>

<A NAME="doc-corrcoef"></A>
<A NAME="IDX781"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>corrcoef</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>If each row of <VAR>x</VAR> and <VAR>y</VAR> is an observation and each column is
a variable, the (<VAR>i</VAR>, <VAR>j</VAR>)-th entry of
<CODE>corrcoef (<VAR>x</VAR>, <VAR>y</VAR>)</CODE> is the correlation between the
<VAR>i</VAR>-th variable in <VAR>x</VAR> and the <VAR>j</VAR>-th variable in <VAR>y</VAR>.
If called with one argument, compute <CODE>corrcoef (<VAR>x</VAR>, <VAR>x</VAR>)</CODE>.
</DL>
<P>

<A NAME="doc-kurtosis"></A>
<A NAME="IDX782"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>kurtosis</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector of length <EM></EM>, return the kurtosis
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>kurtosis (x) = N^(-1) std(x)^(-4) sum ((x - mean(x)).^4) - 3
</pre></td></tr></table><P>

of <VAR>x</VAR>.  If <VAR>x</VAR> is a matrix, return the kurtosis over the
first non-singleton dimension. The optional argument <VAR>dim</VAR>
can be given to force the kurtosis to be given over that 
dimension.
</P>
</DL>
<P>

<A NAME="doc-mahalanobis"></A>
<A NAME="IDX783"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>mahalanobis</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>Return the Mahalanobis' D-square distance between the multivariate
samples <VAR>x</VAR> and <VAR>y</VAR>, which must have the same number of
components (columns), but may have a different number of observations
(rows).
</DL>
<P>

<A NAME="doc-skewness"></A>
<A NAME="IDX784"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>skewness</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector of length <EM></EM>, return the skewness
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>skewness (x) = N^(-1) std(x)^(-3) sum ((x - mean(x)).^3)
</pre></td></tr></table><P>

of <VAR>x</VAR>.  If <VAR>x</VAR> is a matrix, return the skewness along the
first non-singleton dimension of the matrix. If the optional
<VAR>dim</VAR> argument is given, operate along this dimension.
</P>
</DL>
<P>

<A NAME="doc-values"></A>
<A NAME="IDX785"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>values</B> <I>(<VAR>x</VAR>)</I>
<DD>Return the different values in a column vector, arranged in ascending
order.
</DL>
<P>

<A NAME="doc-var"></A>
<A NAME="IDX786"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>var</B> <I>(<VAR>x</VAR>)</I>
<DD>For vector arguments, return the (real) variance of the values.
For matrix arguments, return a row vector contaning the variance for
each column.
<P>

The argument <VAR>opt</VAR> determines the type of normalization to use. Valid 
values are
</P>
<P>

</P>
<DL COMPACT>
<DT>0:
<DD>  normalizes with N-1, provides the square root of best unbiased estimator
  of the variance [default]
<DT>1:
<DD>  normalizes with N, this provides the square root of the second moment
  around the mean
</DL>
<P>

The third argument <VAR>dim</VAR> determines the dimension along which the 
variance is calculated.
</P>
</DL>
<P>

<A NAME="doc-table"></A>
<A NAME="IDX787"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>t</VAR>, <VAR>l_x</VAR>] = <B>table</B> <I>(<VAR>x</VAR>)</I>
<DD><A NAME="IDX788"></A>
<DT><U>Function File:</U> [<VAR>t</VAR>, <VAR>l_x</VAR>, <VAR>l_y</VAR>] = <B>table</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>Create a contingency table <VAR>t</VAR> from data vectors.  The <VAR>l</VAR>
vectors are the corresponding levels.
<P>

Currently, only 1- and 2-dimensional tables are supported.
</P>
</DL>
<P>

<A NAME="doc-studentize"></A>
<A NAME="IDX789"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>studentize</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, subtract its mean and divide by its standard
deviation.
<P>

If <VAR>x</VAR> is a matrix, do the above along the first non-singleton
dimension. If the optional argument <VAR>dim</VAR> is given then operate
along this dimension.
</P>
</DL>
<P>

<A NAME="doc-statistics"></A>
<A NAME="IDX790"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>statistics</B> <I>(<VAR>x</VAR>)</I>
<DD>If <VAR>x</VAR> is a matrix, return a matrix with the minimum, first
quartile, median, third quartile, maximum, mean, standard deviation,
skewness and kurtosis of the columns of <VAR>x</VAR> as its rows.
<P>

If <VAR>x</VAR> is a vector, treat it as a column vector.
</P>
</DL>
<P>

<A NAME="doc-spearman"></A>
<A NAME="IDX791"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>spearman</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>Compute Spearman's rank correlation coefficient <VAR>rho</VAR> for each of
the variables specified by the input arguments.
<P>

For matrices, each row is an observation and each column a variable;
vectors are always observations and may be row or column vectors.
</P>
<P>

<CODE>spearman (<VAR>x</VAR>)</CODE> is equivalent to <CODE>spearman (<VAR>x</VAR>,
<VAR>x</VAR>)</CODE>.
</P>
<P>

For two data vectors <VAR>x</VAR> and <VAR>y</VAR>, Spearman's <VAR>rho</VAR> is the
correlation of the ranks of <VAR>x</VAR> and <VAR>y</VAR>.
</P>
<P>

If <VAR>x</VAR> and <VAR>y</VAR> are drawn from independent distributions,
<VAR>rho</VAR> has zero mean and variance <CODE>1 / (n - 1)</CODE>, and is
asymptotically normally distributed.
</P>
</DL>
<P>

<A NAME="doc-run_count"></A>
<A NAME="IDX792"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>run_count</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>)</I>
<DD>Count the upward runs along the first non-singleton dimension of
<VAR>x</VAR> of length 1, 2, ..., <VAR>n</VAR>-1 and greater than or equal 
to <VAR>n</VAR>. If the optional argument <VAR>dim</VAR> is given operate
along this dimension
</DL>
<P>

<A NAME="doc-ranks"></A>
<A NAME="IDX793"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>ranks</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, return the (column) vector of ranks of
<VAR>x</VAR> adjusted for ties.
<P>

If <VAR>x</VAR> is a matrix, do the above for along the first 
non-singleton dimension. If the optional argument <VAR>dim</VAR> is
given, operate along this dimension.
</P>
</DL>
<P>

<A NAME="doc-range"></A>
<A NAME="IDX794"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>range</B> <I>(<VAR>x</VAR>)</I>
<DD><A NAME="IDX795"></A>
<DT><U>Function File:</U>  <B>range</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, return the range, i.e., the difference
between the maximum and the minimum, of the input data.
<P>

If <VAR>x</VAR> is a matrix, do the above for each column of <VAR>x</VAR>.
</P>
<P>

If the optional argument <VAR>dim</VAR> is supplied, work along dimension
<VAR>dim</VAR>.
</P>
</DL>
<P>

<A NAME="doc-qqplot"></A>
<A NAME="IDX796"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>q</VAR>, <VAR>s</VAR>] = <B>qqplot</B> <I>(<VAR>x</VAR>, <VAR>dist</VAR>, <VAR>params</VAR>)</I>
<DD>Perform a QQ-plot (quantile plot).
<P>

If F is the CDF of the distribution <VAR>dist</VAR> with parameters
<VAR>params</VAR> and G its inverse, and <VAR>x</VAR> a sample vector of length
<VAR>n</VAR>, the QQ-plot graphs ordinate <VAR>s</VAR>(<VAR>i</VAR>) = <VAR>i</VAR>-th
largest element of x versus abscissa <VAR>q</VAR>(<VAR>i</VAR>f) = G((<VAR>i</VAR> -
0.5)/<VAR>n</VAR>).
</P>
<P>

If the sample comes from F except for a transformation of location
and scale, the pairs will approximately follow a straight line.
</P>
<P>

The default for <VAR>dist</VAR> is the standard normal distribution.  The
optional argument <VAR>params</VAR> contains a list of parameters of
<VAR>dist</VAR>.  For example, for a quantile plot of the uniform
distribution on [2,4] and <VAR>x</VAR>, use
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>qqplot (x, &quot;uniform&quot;, 2, 4)
</pre></td></tr></table><P>

If no output arguments are given, the data are plotted directly.
</P>
</DL>
<P>

<A NAME="doc-probit"></A>
<A NAME="IDX797"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>probit</B> <I>(<VAR>p</VAR>)</I>
<DD>For each component of <VAR>p</VAR>, return the probit (the quantile of the
standard normal distribution) of <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-ppplot"></A>
<A NAME="IDX798"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>p</VAR>, <VAR>y</VAR>] = <B>ppplot</B> <I>(<VAR>x</VAR>, <VAR>dist</VAR>, <VAR>params</VAR>)</I>
<DD>Perform a PP-plot (probability plot).
<P>

If F is the CDF of the distribution <VAR>dist</VAR> with parameters
<VAR>params</VAR> and <VAR>x</VAR> a sample vector of length <VAR>n</VAR>, the
PP-plot graphs ordinate <VAR>y</VAR>(<VAR>i</VAR>) = F (<VAR>i</VAR>-th largest
element of <VAR>x</VAR>) versus abscissa <VAR>p</VAR>(<VAR>i</VAR>) = (<VAR>i</VAR> -
0.5)/<VAR>n</VAR>.  If the sample comes from F, the pairs will
approximately follow a straight line.
</P>
<P>

The default for <VAR>dist</VAR> is the standard normal distribution.  The
optional argument <VAR>params</VAR> contains a list of parameters of
<VAR>dist</VAR>.  For example, for a probability plot of the uniform
distribution on [2,4] and <VAR>x</VAR>, use
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>ppplot (x, &quot;uniform&quot;, 2, 4)
</pre></td></tr></table><P>

If no output arguments are given, the data are plotted directly.
</P>
</DL>
<P>

<A NAME="doc-moment"></A>
<A NAME="IDX799"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>moment</B> <I>(<VAR>x</VAR>, <VAR>p</VAR>, <VAR>opt</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, compute the <VAR>p</VAR>-th moment of <VAR>x</VAR>.
<P>

If <VAR>x</VAR> is a matrix, return the row vector containing the
<VAR>p</VAR>-th moment of each column.
</P>
<P>

With the optional string opt, the kind of moment to be computed can
be specified.  If opt contains <CODE>&quot;c&quot;</CODE> or <CODE>&quot;a&quot;</CODE>, central
and/or absolute moments are returned.  For example,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>moment (x, 3, &quot;ac&quot;)
</pre></td></tr></table><P>

computes the third central absolute moment of <VAR>x</VAR>.
</P>
<P>

If the optional argument <VAR>dim</VAR> is supplied, work along dimension
<VAR>dim</VAR>.
</P>
</DL>
<P>

<A NAME="doc-meansq"></A>
<A NAME="IDX800"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>meansq</B> <I>(<VAR>x</VAR>)</I>
<DD><A NAME="IDX801"></A>
<DT><U>Function File:</U>  <B>meansq</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>For vector arguments, return the mean square of the values.
For matrix arguments, return a row vector contaning the mean square
of each column. With the optional <VAR>dim</VAR> argument, returns the
mean squared of the values along this dimension
</DL>
<P>

<A NAME="doc-logit"></A>
<A NAME="IDX802"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>logit</B> <I>(<VAR>p</VAR>)</I>
<DD>For each component of <VAR>p</VAR>, return the logit <CODE>log (<VAR>p</VAR> /
(1-<VAR>p</VAR>))</CODE> of <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-kendall"></A>
<A NAME="IDX803"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>kendall</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>Compute Kendall's <VAR>tau</VAR> for each of the variables specified by
the input arguments.
<P>

For matrices, each row is an observation and each column a variable;
vectors are always observations and may be row or column vectors.
</P>
<P>

<CODE>kendall (<VAR>x</VAR>)</CODE> is equivalent to <CODE>kendall (<VAR>x</VAR>,
<VAR>x</VAR>)</CODE>.
</P>
<P>

For two data vectors <VAR>x</VAR>, <VAR>y</VAR> of common length <VAR>n</VAR>,
Kendall's <VAR>tau</VAR> is the correlation of the signs of all rank
differences of <VAR>x</VAR> and <VAR>y</VAR>;  i.e., if both <VAR>x</VAR> and
<VAR>y</VAR> have distinct entries, then
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>         1    
tau = -------   SUM sign (q(i) - q(j)) * sign (r(i) - r(j))
      n (n-1)   i,j
</pre></td></tr></table><P>

in which the
<VAR>q</VAR>(<VAR>i</VAR>) and <VAR>r</VAR>(<VAR>i</VAR>)
 are the ranks of
<VAR>x</VAR> and <VAR>y</VAR>, respectively.
</P>
<P>

If <VAR>x</VAR> and <VAR>y</VAR> are drawn from independent distributions,
Kendall's <VAR>tau</VAR> is asymptotically normal with mean 0 and variance
<CODE>(2 * (2<VAR>n</VAR>+5)) / (9 * <VAR>n</VAR> * (<VAR>n</VAR>-1))</CODE>.
</P>
</DL>
<P>

<A NAME="doc-iqr"></A>
<A NAME="IDX804"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>iqr</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, return the interquartile range, i.e., the
difference between the upper and lower quartile, of the input data.
<P>

If <VAR>x</VAR> is a matrix, do the above for first non singleton
dimension of <VAR>x</VAR>.. If the option <VAR>dim</VAR> argument is given,
then operate along this dimension.
</P>
</DL>
<P>

<A NAME="doc-cut"></A>
<A NAME="IDX805"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cut</B> <I>(<VAR>x</VAR>, <VAR>breaks</VAR>)</I>
<DD>Create categorical data out of numerical or continuous data by
cutting into intervals.
<P>

If <VAR>breaks</VAR> is a scalar, the data is cut into that many
equal-width intervals.  If <VAR>breaks</VAR> is a vector of break points,
the category has <CODE>length (<VAR>breaks</VAR>) - 1</CODE> groups.
</P>
<P>

The returned value is a vector of the same size as <VAR>x</VAR> telling
which group each point in <VAR>x</VAR> belongs to.  Groups are labelled
from 1 to the number of groups; points outside the range of
<VAR>breaks</VAR> are labelled by <CODE>NaN</CODE>.
</P>
</DL>
<P>

<A NAME="doc-cor"></A>
<A NAME="IDX806"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cor</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>The (<VAR>i</VAR>, <VAR>j</VAR>)-th entry of <CODE>cor (<VAR>x</VAR>, <VAR>y</VAR>)</CODE> is
the correlation between the <VAR>i</VAR>-th variable in <VAR>x</VAR> and the
<VAR>j</VAR>-th variable in <VAR>y</VAR>.
<P>

For matrices, each row is an observation and each column a variable;
vectors are always observations and may be row or column vectors.
</P>
<P>

<CODE>cor (<VAR>x</VAR>)</CODE> is equivalent to <CODE>cor (<VAR>x</VAR>, <VAR>x</VAR>)</CODE>.
</P>
</DL>
<P>

<A NAME="doc-cloglog"></A>
<A NAME="IDX807"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cloglog</B> <I>(<VAR>x</VAR>)</I>
<DD>Return the complementary log-log function of <VAR>x</VAR>, defined as
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>- log (- log (<VAR>x</VAR>))
</pre></td></tr></table></DL>
<P>

<A NAME="doc-center"></A>
<A NAME="IDX808"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>center</B> <I>(<VAR>x</VAR>)</I>
<DD><A NAME="IDX809"></A>
<DT><U>Function File:</U>  <B>center</B> <I>(<VAR>x</VAR>, <VAR>dim</VAR>)</I>
<DD>If <VAR>x</VAR> is a vector, subtract its mean.
If <VAR>x</VAR> is a matrix, do the above for each column.
If the optional argument <VAR>dim</VAR> is given, perform the above
operation along this dimension
</DL>
<P>

<A NAME="Tests"></A>
<HR SIZE="6">
<A NAME="SEC178"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC177"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC179"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_27.html#SEC181"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.2 Tests </H2>
<!--docid::SEC178::-->
<P>

<A NAME="doc-anova"></A>
<A NAME="IDX810"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>f</VAR>, <VAR>df_b</VAR>, <VAR>df_w</VAR>] = <B>anova</B> <I>(<VAR>y</VAR>, <VAR>g</VAR>)</I>
<DD>Perform a one-way analysis of variance (ANOVA).  The goal is to test
whether the population means of data taken from <VAR>k</VAR> different
groups are all equal.
<P>

Data may be given in a single vector <VAR>y</VAR> with groups specified by
a corresponding vector of group labels <VAR>g</VAR> (e.g., numbers from 1
to <VAR>k</VAR>). This is the general form which does not impose any
restriction on the number of data in each group or the group labels.
</P>
<P>

If <VAR>y</VAR> is a matrix and <VAR>g</VAR> is omitted, each column of <VAR>y</VAR>
is treated as a group.  This form is only appropriate for balanced
ANOVA in which the numbers of samples from each group are all equal.
</P>
<P>

Under the null of constant means, the statistic <VAR>f</VAR> follows an F
distribution with <VAR>df_b</VAR> and <VAR>df_w</VAR> degrees of freedom.
</P>
<P>

The p-value (1 minus the CDF of this distribution at <VAR>f</VAR>) is
returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the standard one-way ANOVA table is
printed.
</P>
</DL>
<P>

<A NAME="doc-bartlett_test"></A>
<A NAME="IDX811"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>chisq</VAR>, <VAR>df</VAR>] = <B>bartlett_test</B> <I>(<VAR>x1</VAR>, <small>...</small>)</I>
<DD>Perform a Bartlett test for the homogeneity of variances in the data
vectors <VAR>x1</VAR>, <VAR>x2</VAR>, <small>...</small>, <VAR>xk</VAR>, where <VAR>k</VAR> &gt; 1.
<P>

Under the null of equal variances, the test statistic <VAR>chisq</VAR>
approximately ollows a chi-square distribution with <VAR>df</VAR> degrees of
freedom.
</P>
<P>

The p-value (1 minus the CDF of this distribution at <VAR>chisq</VAR>) is
returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-chisquare_test_homogeneity"></A>
<A NAME="IDX812"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>chisq</VAR>, <VAR>df</VAR>] = <B>chisquare_test_homogeneity</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>c</VAR>)</I>
<DD>Given two samples <VAR>x</VAR> and <VAR>y</VAR>, perform a chisquare test for
homogeneity of the null hypothesis that <VAR>x</VAR> and <VAR>y</VAR> come from
the same distribution, based on the partition induced by the
(strictly increasing) entries of <VAR>c</VAR>.
<P>

For large samples, the test statistic <VAR>chisq</VAR> approximately follows a
chisquare distribution with <VAR>df</VAR> = <CODE>length (<VAR>c</VAR>)</CODE>
degrees of freedom.
</P>
<P>

The p-value (1 minus the CDF of this distribution at <VAR>chisq</VAR>) is
returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-chisquare_test_independence"></A>
<A NAME="IDX813"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>chisq</VAR>, <VAR>df</VAR>] = <B>chisquare_test_independence</B> <I>(<VAR>x</VAR>)</I>
<DD>Perform a chi-square test for indepence based on the contingency
table <VAR>x</VAR>.  Under the null hypothesis of independence,
<VAR>chisq</VAR> approximately has a chi-square distribution with
<VAR>df</VAR> degrees of freedom.
<P>

The p-value (1 minus the CDF of this distribution at chisq) of the
test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-cor_test"></A>
<A NAME="IDX814"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cor_test</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>, <VAR>method</VAR>)</I>
<DD>Test whether two samples <VAR>x</VAR> and <VAR>y</VAR> come from uncorrelated
populations.
<P>

The optional argument string <VAR>alt</VAR> describes the alternative
hypothesis, and can be <CODE>&quot;!=&quot;</CODE> or <CODE>&quot;&lt;&gt;&quot;</CODE> (non-zero),
<CODE>&quot;&gt;&quot;</CODE> (greater than 0), or <CODE>&quot;&lt;&quot;</CODE> (less than 0).  The
default is the two-sided case.
</P>
<P>

The optional argument string <VAR>method</VAR> specifies on which
correlation coefficient the test should be based.  If <VAR>method</VAR> is
<CODE>&quot;pearson&quot;</CODE> (default), the (usual) Pearson's product moment
correlation coefficient is used.  In this case, the data should come
from a bivariate normal distribution.  Otherwise, the other two
methods offer nonparametric alternatives. If <VAR>method</VAR> is
<CODE>&quot;kendall&quot;</CODE>, then Kendall's rank correlation tau is used.  If
<VAR>method</VAR> is <CODE>&quot;spearman&quot;</CODE>, then Spearman's rank correlation
rho is used.  Only the first character is necessary.
</P>
<P>

The output is a structure with the following elements:
</P>
<P>

</P>
<DL COMPACT>
<DT><VAR>pval</VAR>
<DD>The p-value of the test.
<DT><VAR>stat</VAR>
<DD>The value of the test statistic.
<DT><VAR>dist</VAR>
<DD>The distribution of the test statistic.
<DT><VAR>params</VAR>
<DD>The parameters of the null distribution of the test statistic.
<DT><VAR>alternative</VAR>
<DD>The alternative hypothesis.
<DT><VAR>method</VAR>
<DD>The method used for testing.
</DL>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-f_test_regression"></A>
<A NAME="IDX815"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>f</VAR>, <VAR>df_num</VAR>, <VAR>df_den</VAR>] = <B>f_test_regression</B> <I>(<VAR>y</VAR>, <VAR>x</VAR>, <VAR>rr</VAR>, <VAR>r</VAR>)</I>
<DD>Perform an F test for the null hypothesis rr * b = r in a classical
normal regression model y = X * b + e.
<P>

Under the null, the test statistic <VAR>f</VAR> follows an F distribution
with <VAR>df_num</VAR> and <VAR>df_den</VAR> degrees of freedom.
</P>
<P>

The p-value (1 minus the CDF of this distribution at <VAR>f</VAR>) is
returned in <VAR>pval</VAR>.
</P>
<P>

If not given explicitly, <VAR>r</VAR> = 0.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-hotelling_test"></A>
<A NAME="IDX816"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>tsq</VAR>] = <B>hotelling_test</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>)</I>
<DD>For a sample <VAR>x</VAR> from a multivariate normal distribution with unknown
mean and covariance matrix, test the null hypothesis that <CODE>mean
(<VAR>x</VAR>) == <VAR>m</VAR></CODE>.
<P>

Hotelling's T^2 is returned in <VAR>tsq</VAR>.  Under the null,
<EM></EM> has an F distribution with <EM></EM> and
<EM></EM> degrees of freedom, where <EM></EM> and <EM></EM> are the
numbers of samples and variables, respectively.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-hotelling_test_2"></A>
<A NAME="IDX817"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>tsq</VAR>] = <B>hotelling_test_2</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>)</I>
<DD>For two samples <VAR>x</VAR> from multivariate normal distributions with
the same number of variables (columns), unknown means and unknown
equal covariance matrices, test the null hypothesis <CODE>mean
(<VAR>x</VAR>) == mean (<VAR>y</VAR>)</CODE>.
<P>

Hotelling's two-sample T^2 is returned in <VAR>tsq</VAR>.  Under the null,
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>(n_x+n_y-p-1) T^2 / (p(n_x+n_y-2))
</pre></td></tr></table><P>

has an F distribution with <EM></EM> and <EM></EM> degrees of
freedom, where <EM></EM> and <EM></EM> are the sample sizes and
<EM></EM> is the number of variables.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-kolmogorov_smirnov_test"></A>
<A NAME="IDX818"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>ks</VAR>] = <B>kolmogorov_smirnov_test</B> <I>(<VAR>x</VAR>, <VAR>dist</VAR>, <VAR>params</VAR>, <VAR>alt</VAR>)</I>
<DD>Perform a Kolmogorov-Smirnov test of the null hypothesis that the
sample <VAR>x</VAR> comes from the (continuous) distribution dist. I.e.,
if F and G are the CDFs corresponding to the sample and dist,
respectively, then the null is that F == G.
<P>

The optional argument <VAR>params</VAR> contains a list of parameters of
<VAR>dist</VAR>.  For example, to test whether a sample <VAR>x</VAR> comes from
a uniform distribution on [2,4], use
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>kolmogorov_smirnov_test(x, &quot;uniform&quot;, 2, 4)
</pre></td></tr></table><P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative F
!= G.  In this case, the test statistic <VAR>ks</VAR> follows a two-sided
Kolmogorov-Smirnov distribution.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative F &gt; G is considered.  Similarly for <CODE>&quot;&lt;&quot;</CODE>,
the one-sided alternative F &gt; G is considered.  In this case, the
test statistic <VAR>ks</VAR> has a one-sided Kolmogorov-Smirnov
distribution.  The default is the two-sided case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-kolmogorov_smirnov_test_2"></A>
<A NAME="IDX819"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>ks</VAR>, <VAR>d</VAR>] = <B>kolmogorov_smirnov_test_2</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>)</I>
<DD>Perform a 2-sample Kolmogorov-Smirnov test of the null hypothesis
that the samples <VAR>x</VAR> and <VAR>y</VAR> come from the same (continuous)
distribution.  I.e., if F and G are the CDFs corresponding to the
<VAR>x</VAR> and <VAR>y</VAR> samples, respectively, then the null is that F ==
G.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative F
!= G.  In this case, the test statistic <VAR>ks</VAR> follows a two-sided
Kolmogorov-Smirnov distribution.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative F &gt; G is considered.  Similarly for <CODE>&quot;&lt;&quot;</CODE>,
the one-sided alternative F &lt; G is considered.  In this case, the
test statistic <VAR>ks</VAR> has a one-sided Kolmogorov-Smirnov
distribution.  The default is the two-sided case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

The third returned value, <VAR>d</VAR>, is the test statistic, the maximum
vertical distance between the two cumulative distribution functions.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-kruskal_wallis_test"></A>
<A NAME="IDX820"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>k</VAR>, <VAR>df</VAR>] = <B>kruskal_wallis_test</B> <I>(<VAR>x1</VAR>, <small>...</small>)</I>
<DD>Perform a Kruskal-Wallis one-factor &quot;analysis of variance&quot;.
<P>

Suppose a variable is observed for <VAR>k</VAR> &gt; 1 different groups, and
let <VAR>x1</VAR>, <small>...</small>, <VAR>xk</VAR> be the corresponding data vectors.
</P>
<P>

Under the null hypothesis that the ranks in the pooled sample are not
affected by the group memberships, the test statistic <VAR>k</VAR> is
approximately chi-square with <VAR>df</VAR> = <VAR>k</VAR> - 1 degrees of
freedom.
</P>
<P>

The p-value (1 minus the CDF of this distribution at <VAR>k</VAR>) is
returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-manova"></A>
<A NAME="IDX821"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>manova</B> <I>(<VAR>y</VAR>, <VAR>g</VAR>)</I>
<DD>Perform a one-way multivariate analysis of variance (MANOVA). The
goal is to test whether the p-dimensional population means of data
taken from <VAR>k</VAR> different groups are all equal.  All data are
assumed drawn independently from p-dimensional normal distributions
with the same covariance matrix.
<P>

The data matrix is given by <VAR>y</VAR>.  As usual, rows are observations
and columns are variables.  The vector <VAR>g</VAR> specifies the
corresponding group labels (e.g., numbers from 1 to <VAR>k</VAR>).
</P>
<P>

The LR test statistic (Wilks' Lambda) and approximate p-values are
computed and displayed.
</P>
</DL>
<P>

<A NAME="doc-mcnemar_test"></A>
<A NAME="IDX822"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>chisq</VAR>, <VAR>df</VAR>] = <B>mcnemar_test</B> <I>(<VAR>x</VAR>)</I>
<DD>For a square contingency table <VAR>x</VAR> of data cross-classified on
the row and column variables, McNemar's test can be used for testing
the null hypothesis of symmetry of the classification probabilities.
<P>

Under the null, <VAR>chisq</VAR> is approximately distributed as chisquare
with <VAR>df</VAR> degrees of freedom.
</P>
<P>

The p-value (1 minus the CDF of this distribution at <VAR>chisq</VAR>) is
returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-prop_test_2"></A>
<A NAME="IDX823"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>z</VAR>] = <B>prop_test_2</B> <I>(<VAR>x1</VAR>, <VAR>n1</VAR>, <VAR>x2</VAR>, <VAR>n2</VAR>, <VAR>alt</VAR>)</I>
<DD>If <VAR>x1</VAR> and <VAR>n1</VAR> are the counts of successes and trials in
one sample, and <VAR>x2</VAR> and <VAR>n2</VAR> those in a second one, test the
null hypothesis that the success probabilities <VAR>p1</VAR> and <VAR>p2</VAR>
are the same.  Under the null, the test statistic <VAR>z</VAR>
approximately follows a standard normal distribution.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<VAR>p1</VAR> != <VAR>p2</VAR>.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the one-sided
alternative <VAR>p1</VAR> &gt; <VAR>p2</VAR> is used.  Similarly for <CODE>&quot;&lt;&quot;</CODE>,
the one-sided alternative <VAR>p1</VAR> &lt; <VAR>p2</VAR> is used.
The default is the two-sided case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-run_test"></A>
<A NAME="IDX824"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>chisq</VAR>] = <B>run_test</B> <I>(<VAR>x</VAR>)</I>
<DD>Perform a chi-square test with 6 degrees of freedom based on the
upward runs in the columns of <VAR>x</VAR>.  Can be used to test whether
<VAR>x</VAR> contains independent data.
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value is displayed.
</P>
</DL>
<P>

<A NAME="doc-sign_test"></A>
<A NAME="IDX825"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>b</VAR>, <VAR>n</VAR>] = <B>sign_test</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>)</I>
<DD>For two matched-pair samples <VAR>x</VAR> and <VAR>y</VAR>, perform a sign test
of the null hypothesis PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) == PROB (<VAR>x</VAR> &lt;
<VAR>y</VAR>) == 1/2.  Under the null, the test statistic <VAR>b</VAR> roughly
follows a binomial distribution with parameters <CODE><VAR>n</VAR> = sum
(<VAR>x</VAR> != <VAR>y</VAR>)</CODE> and <VAR>p</VAR> = 1/2.
<P>

With the optional argument <CODE>alt</CODE>, the alternative of interest
can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or <CODE>&quot;&lt;&gt;&quot;</CODE>, the
null hypothesis is tested against the two-sided alternative PROB
(<VAR>x</VAR> &lt; <VAR>y</VAR>) != 1/2.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) &gt; 1/2 (&quot;x is
stochastically greater than y&quot;) is considered.  Similarly for
<CODE>&quot;&lt;&quot;</CODE>, the one-sided alternative PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) &lt; 1/2
(&quot;x is stochastically less than y&quot;) is considered.  The default is
the two-sided case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-t_test"></A>
<A NAME="IDX826"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>t</VAR>, <VAR>df</VAR>] = <B>t_test</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>alt</VAR>)</I>
<DD>For a sample <VAR>x</VAR> from a normal distribution with unknown mean and
variance, perform a t-test of the null hypothesis <CODE>mean
(<VAR>x</VAR>) == <VAR>m</VAR></CODE>.  Under the null, the test statistic <VAR>t</VAR>
follows a Student distribution with <CODE><VAR>df</VAR> = length (<VAR>x</VAR>)
- 1</CODE> degrees of freedom.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<CODE>mean (<VAR>x</VAR>) != <VAR>m</VAR></CODE>.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative <CODE>mean (<VAR>x</VAR>) &gt; <VAR>m</VAR></CODE> is considered.
Similarly for <VAR>&quot;&lt;&quot;</VAR>, the one-sided alternative <CODE>mean
(<VAR>x</VAR>) &lt; <VAR>m</VAR></CODE> is considered,  The default is the two-sided
case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-t_test_2"></A>
<A NAME="IDX827"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>t</VAR>, <VAR>df</VAR>] = <B>t_test_2</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>)</I>
<DD>For two samples x and y from normal distributions with unknown means
and unknown equal variances, perform a two-sample t-test of the null
hypothesis of equal means.  Under the null, the test statistic
<VAR>t</VAR> follows a Student distribution with <VAR>df</VAR> degrees of
freedom.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<CODE>mean (<VAR>x</VAR>) != mean (<VAR>y</VAR>)</CODE>.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>,
the one-sided alternative <CODE>mean (<VAR>x</VAR>) &gt; mean (<VAR>y</VAR>)</CODE> is
used.  Similarly for <CODE>&quot;&lt;&quot;</CODE>, the one-sided alternative <CODE>mean
(<VAR>x</VAR>) &lt; mean (<VAR>y</VAR>)</CODE> is used.  The default is the two-sided
case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-t_test_regression"></A>
<A NAME="IDX828"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>t</VAR>, <VAR>df</VAR>] = <B>t_test_regression</B> <I>(<VAR>y</VAR>, <VAR>x</VAR>, <VAR>rr</VAR>, <VAR>r</VAR>, <VAR>alt</VAR>)</I>
<DD>Perform an t test for the null hypothesis <CODE><VAR>rr</VAR> * <VAR>b</VAR> =
<VAR>r</VAR></CODE> in a classical normal regression model <CODE><VAR>y</VAR> =
<VAR>x</VAR> * <VAR>b</VAR> + <VAR>e</VAR></CODE>.  Under the null, the test statistic <VAR>t</VAR>
follows a <VAR>t</VAR> distribution with <VAR>df</VAR> degrees of freedom.
<P>

If <VAR>r</VAR> is omitted, a value of 0 is assumed.
</P>
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<CODE><VAR>rr</VAR> * <VAR>b</VAR> != <VAR>r</VAR></CODE>.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative <CODE><VAR>rr</VAR> * <VAR>b</VAR> &gt; <VAR>r</VAR></CODE> is used.
Similarly for <VAR>&quot;&lt;&quot;</VAR>, the one-sided alternative <CODE><VAR>rr</VAR> *
<VAR>b</VAR> &lt; <VAR>r</VAR></CODE> is used.  The default is the two-sided case. 
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-u_test"></A>
<A NAME="IDX829"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>z</VAR>] = <B>u_test</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>)</I>
<DD>For two samples <VAR>x</VAR> and <VAR>y</VAR>, perform a Mann-Whitney U-test of
the null hypothesis PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) == 1/2 == PROB (<VAR>x</VAR>
&lt; <VAR>y</VAR>).  Under the null, the test statistic <VAR>z</VAR> approximately
follows a standard normal distribution.  Note that this test is
equivalent to the Wilcoxon rank-sum test.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) != 1/2.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) &gt; 1/2 is considered.
Similarly for <CODE>&quot;&lt;&quot;</CODE>, the one-sided alternative PROB (<VAR>x</VAR> &gt;
<VAR>y</VAR>) &lt; 1/2 is considered,  The default is the two-sided case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-var_test"></A>
<A NAME="IDX830"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>f</VAR>, <VAR>df_num</VAR>, <VAR>df_den</VAR>] = <B>var_test</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>)</I>
<DD>For two samples <VAR>x</VAR> and <VAR>y</VAR> from normal distributions with
unknown means and unknown variances, perform an F-test of the null
hypothesis of equal variances.  Under the null, the test statistic f
follows an F-distribution with df_num and df_den degrees of freedom.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<CODE>var (<VAR>x</VAR>) != var (<VAR>y</VAR>)</CODE>.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>,
the one-sided alternative <CODE>var (<VAR>x</VAR>) &gt; var (<VAR>y</VAR>)</CODE> is
used.  Similarly for &quot;&lt;&quot;, the one-sided alternative <CODE>var
(<VAR>x</VAR>) &gt; var (<VAR>y</VAR>)</CODE> is used.  The default is the two-sided
case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-welch_test"></A>
<A NAME="IDX831"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>t</VAR>, <VAR>df</VAR>] = <B>welch_test</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>)</I>
<DD>For two samples <VAR>x</VAR> and <VAR>y</VAR> from normal distributions with
unknown means and unknown and not necessarily equal variances,
perform a Welch test of the null hypothesis of equal means.
Under the null, the test statistic t approximately follows a Student
distribution with df degrees of freedom.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<CODE>mean (<VAR>x</VAR>) != <VAR>m</VAR></CODE>.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative mean(x) &gt; <VAR>m</VAR> is considered.  Similarly for
<CODE>&quot;&lt;&quot;</CODE>, the one-sided alternative mean(x) &lt; <VAR>m</VAR> is
considered.  The default is the two-sided case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-wilcoxon_test"></A>
<A NAME="IDX832"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>z</VAR>] = <B>wilcoxon_test</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>alt</VAR>)</I>
<DD>For two matched-pair sample vectors <VAR>x</VAR> and <VAR>y</VAR>, perform a
Wilcoxon signed-rank test of the null hypothesis PROB (<VAR>x</VAR> &gt;
<VAR>y</VAR>) == 1/2.  Under the null, the test statistic <VAR>z</VAR>
approximately follows a standard normal distribution.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) != 1/2.  If alt is <CODE>&quot;&gt;&quot;</CODE>, the one-sided
alternative PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) &gt; 1/2 is considered.  Similarly
for <CODE>&quot;&lt;&quot;</CODE>, the one-sided alternative PROB (<VAR>x</VAR> &gt; <VAR>y</VAR>) &lt;
1/2 is considered.  The default is the two-sided case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed.
</P>
</DL>
<P>

<A NAME="doc-z_test"></A>
<A NAME="IDX833"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>z</VAR>] = <B>z_test</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>v</VAR>, <VAR>alt</VAR>)</I>
<DD>Perform a Z-test of the null hypothesis <CODE>mean (<VAR>x</VAR>) ==
<VAR>m</VAR></CODE> for a sample <VAR>x</VAR> from a normal distribution with unknown
mean and known variance <VAR>v</VAR>.  Under the null, the test statistic
<VAR>z</VAR> follows a standard normal distribution.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<CODE>mean (<VAR>x</VAR>) != <VAR>m</VAR></CODE>.  If <VAR>alt</VAR> is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative <CODE>mean (<VAR>x</VAR>) &gt; <VAR>m</VAR></CODE> is considered.
Similarly for <CODE>&quot;&lt;&quot;</CODE>, the one-sided alternative <CODE>mean
(<VAR>x</VAR>) &lt; <VAR>m</VAR></CODE> is considered.  The default is the two-sided
case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed
along with some information.
</P>
</DL>
<P>

<A NAME="doc-z_test_2"></A>
<A NAME="IDX834"></A>
</P>
<DL>
<DT><U>Function File:</U> [<VAR>pval</VAR>, <VAR>z</VAR>] = <B>z_test_2</B> <I>(<VAR>x</VAR>, <VAR>y</VAR>, <VAR>v_x</VAR>, <VAR>v_y</VAR>, <VAR>alt</VAR>)</I>
<DD>For two samples <VAR>x</VAR> and <VAR>y</VAR> from normal distributions with
unknown means and known variances <VAR>v_x</VAR> and <VAR>v_y</VAR>, perform a
Z-test of the hypothesis of equal means.  Under the null, the test
statistic <VAR>z</VAR> follows a standard normal distribution.
<P>

With the optional argument string <VAR>alt</VAR>, the alternative of
interest can be selected.  If <VAR>alt</VAR> is <CODE>&quot;!=&quot;</CODE> or
<CODE>&quot;&lt;&gt;&quot;</CODE>, the null is tested against the two-sided alternative
<CODE>mean (<VAR>x</VAR>) != mean (<VAR>y</VAR>)</CODE>.  If alt is <CODE>&quot;&gt;&quot;</CODE>, the
one-sided alternative <CODE>mean (<VAR>x</VAR>) &gt; mean (<VAR>y</VAR>)</CODE> is used.
Similarly for <CODE>&quot;&lt;&quot;</CODE>, the one-sided alternative <CODE>mean
(<VAR>x</VAR>) &lt; mean (<VAR>y</VAR>)</CODE> is used.  The default is the two-sided
case.
</P>
<P>

The p-value of the test is returned in <VAR>pval</VAR>.
</P>
<P>

If no output argument is given, the p-value of the test is displayed
along with some information.
</P>
</DL>
<P>

<A NAME="Models"></A>
<HR SIZE="6">
<A NAME="SEC179"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC178"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC180"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_27.html#SEC181"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.3 Models </H2>
<!--docid::SEC179::-->
<P>

<A NAME="doc-logistic_regression"></A>
<A NAME="IDX835"></A>
</P>
<DL>
<DT><U>Functio File:</U> [<VAR>theta</VAR>, <VAR>beta</VAR>, <VAR>dev</VAR>, <VAR>dl</VAR>, <VAR>d2l</VAR>, <VAR>p</VAR>] = <B>logistic_regression</B> <I>(<VAR>y</VAR>, <VAR>x</VAR>, <VAR>print</VAR>, <VAR>theta</VAR>, <VAR>beta</VAR>)</I>
<DD>Perform ordinal logistic regression.
<P>

Suppose <VAR>y</VAR> takes values in <VAR>k</VAR> ordered categories, and let
<CODE>gamma_i (<VAR>x</VAR>)</CODE> be the cumulative probability that <VAR>y</VAR>
falls in one of the first <VAR>i</VAR> categories given the covariate
<VAR>x</VAR>.  Then
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>[theta, beta] = logistic_regression (y, x)
</pre></td></tr></table><P>

fits the model
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>logit (gamma_i (x)) = theta_i - beta' * x,   i = 1, ..., k-1
</pre></td></tr></table><P>

The number of ordinal categories, <VAR>k</VAR>, is taken to be the number
of distinct values of <CODE>round (<VAR>y</VAR>)</CODE>.  If <VAR>k</VAR> equals 2,
<VAR>y</VAR> is binary and the model is ordinary logistic regression.  The
matrix <VAR>x</VAR> is assumed to have full column rank.
</P>
<P>

Given <VAR>y</VAR> only, <CODE>theta = logistic_regression (y)</CODE>
fits the model with baseline logit odds only.
</P>
<P>

The full form is
</P>
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>[theta, beta, dev, dl, d2l, gamma]
   = logistic_regression (y, x, print, theta, beta)
</pre></td></tr></table><P>

in which all output arguments and all input arguments except <VAR>y</VAR>
are optional.
</P>
<P>

Stting <VAR>print</VAR> to 1 requests summary information about the fitted
model to be displayed.  Setting <VAR>print</VAR> to 2 requests information
about convergence at each iteration.  Other values request no
information to be displayed.  The input arguments <VAR>theta</VAR> and
<VAR>beta</VAR> give initial estimates for <VAR>theta</VAR> and <VAR>beta</VAR>.
</P>
<P>

The returned value <VAR>dev</VAR> holds minus twice the log-likelihood.
</P>
<P>

The returned values <VAR>dl</VAR> and <VAR>d2l</VAR> are the vector of first
and the matrix of second derivatives of the log-likelihood with
respect to <VAR>theta</VAR> and <VAR>beta</VAR>.
</P>
<P>

<VAR>p</VAR> holds estimates for the conditional distribution of <VAR>y</VAR>
given <VAR>x</VAR>.
</P>
</DL>
<P>

<A NAME="Distributions"></A>
<HR SIZE="6">
<A NAME="SEC180"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC179"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_27.html#SEC181"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_27.html#SEC181"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.4 Distributions </H2>
<!--docid::SEC180::-->
<P>

<A NAME="doc-beta_cdf"></A>
<A NAME="IDX836"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>beta_cdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, returns the CDF at <VAR>x</VAR> of the beta
distribution with parameters <VAR>a</VAR> and <VAR>b</VAR>, i.e.,
PROB (beta (<VAR>a</VAR>, <VAR>b</VAR>) &lt;= <VAR>x</VAR>).
</DL>
<P>

<A NAME="doc-beta_inv"></A>
<A NAME="IDX837"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>beta_inv</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the quantile (the inverse of
the CDF) at <VAR>x</VAR> of the Beta distribution with parameters <VAR>a</VAR>
and <VAR>b</VAR>.
</DL>
<P>

<A NAME="doc-beta_pdf"></A>
<A NAME="IDX838"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>beta_pdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, returns the PDF at <VAR>x</VAR> of the beta
distribution with parameters <VAR>a</VAR> and <VAR>b</VAR>.
</DL>
<P>

<A NAME="doc-beta_rnd"></A>
<A NAME="IDX839"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>beta_rnd</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX840"></A>
<DT><U>Function File:</U>  <B>beta_rnd</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> or <CODE>size (<VAR>sz</VAR>)</CODE> matrix of 
random samples from the Beta distribution with parameters <VAR>a</VAR> and
<VAR>b</VAR>.  Both <VAR>a</VAR> and <VAR>b</VAR> must be scalar or of size <VAR>r</VAR>
 by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>a</VAR> and <VAR>b</VAR>.
</P>
</DL>
<P>

<A NAME="doc-binomial_cdf"></A>
<A NAME="IDX841"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>binomial_cdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the CDF at <VAR>x</VAR> of the
binomial distribution with parameters <VAR>n</VAR> and <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-binomial_inv"></A>
<A NAME="IDX842"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>binomial_inv</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile at <VAR>x</VAR> of the
binomial distribution with parameters <VAR>n</VAR> and <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-binomial_pdf"></A>
<A NAME="IDX843"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>binomial_pdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the binomial distribution with parameters <VAR>n</VAR>
and <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-binomial_rnd"></A>
<A NAME="IDX844"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>binomial_rnd</B> <I>(<VAR>n</VAR>, <VAR>p</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX845"></A>
<DT><U>Function File:</U>  <B>binomial_rnd</B> <I>(<VAR>n</VAR>, <VAR>p</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR>  or a <CODE>size (<VAR>sz</VAR>)</CODE> matrix of 
random samples from the binomial distribution with parameters <VAR>n</VAR>
and <VAR>p</VAR>.  Both <VAR>n</VAR> and <VAR>p</VAR> must be scalar or of size
<VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>n</VAR> and <VAR>p</VAR>.
</P>
</DL>
<P>

<A NAME="doc-cauchy_cdf"></A>
<A NAME="IDX846"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cauchy_cdf</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>, <VAR>sigma</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the Cauchy distribution with location
parameter <VAR>lambda</VAR> and scale parameter <VAR>sigma</VAR>.  Default
values are <VAR>lambda</VAR> = 0, <VAR>sigma</VAR> = 1. 
</DL>
<P>

<A NAME="doc-cauchy_inv"></A>
<A NAME="IDX847"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cauchy_inv</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>, <VAR>sigma</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the Cauchy distribution with location parameter
<VAR>lambda</VAR> and scale parameter <VAR>sigma</VAR>.  Default values are
<VAR>lambda</VAR> = 0, <VAR>sigma</VAR> = 1. 
</DL>
<P>

<A NAME="doc-cauchy_pdf"></A>
<A NAME="IDX848"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cauchy_pdf</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>, <VAR>sigma</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the Cauchy distribution with location parameter
<VAR>lambda</VAR> and scale parameter <VAR>sigma</VAR> &gt; 0.  Default values are
<VAR>lambda</VAR> = 0, <VAR>sigma</VAR> = 1. 
</DL>
<P>

<A NAME="doc-cauchy_rnd"></A>
<A NAME="IDX849"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>cauchy_rnd</B> <I>(<VAR>lambda</VAR>, <VAR>sigma</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX850"></A>
<DT><U>Function File:</U>  <B>cauchy_rnd</B> <I>(<VAR>lambda</VAR>, <VAR>sigma</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> or a <CODE>size (<VAR>sz</VAR>)</CODE> matrix of 
random samples from the Cauchy distribution with parameters <VAR>lambda</VAR> 
and <VAR>sigma</VAR> which must both be scalar or of size <VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>lambda</VAR> and <VAR>sigma</VAR>.
</P>
</DL>
<P>

<A NAME="doc-chisquare_cdf"></A>
<A NAME="IDX851"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>chisquare_cdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the chisquare distribution with <VAR>n</VAR>
degrees of freedom.
</DL>
<P>

<A NAME="doc-chisquare_inv"></A>
<A NAME="IDX852"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>chisquare_inv</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the chisquare distribution with <VAR>n</VAR> degrees of
freedom.
</DL>
<P>

<A NAME="doc-chisquare_pdf"></A>
<A NAME="IDX853"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>chisquare_pdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the chisquare distribution with <VAR>k</VAR> degrees
of freedom.
</DL>
<P>

<A NAME="doc-chisquare_rnd"></A>
<A NAME="IDX854"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>chisquare_rnd</B> <I>(<VAR>n</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX855"></A>
<DT><U>Function File:</U>  <B>chisquare_rnd</B> <I>(<VAR>n</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR>  or a <CODE>size (<VAR>sz</VAR>)</CODE> matrix of 
random samples from the chisquare distribution with <VAR>n</VAR> degrees 
of freedom.  <VAR>n</VAR> must be a scalar or of size <VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the size of <VAR>n</VAR>.
</P>
</DL>
<P>

<A NAME="doc-discrete_cdf"></A>
<A NAME="IDX856"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>discrete_cdf</B> <I>(<VAR>x</VAR>, <VAR>v</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of a univariate discrete distribution which
assumes the values in v with probabilities <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-discrete_inv"></A>
<A NAME="IDX857"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>discrete_inv</B> <I>(<VAR>x</VAR>, <VAR>v</VAR>, <VAR>p</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the quantile (the inverse of
the CDF) at <VAR>x</VAR> of the univariate distribution which assumes the
values in <VAR>v</VAR> with probabilities <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-discrete_pdf"></A>
<A NAME="IDX858"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>discrete_pdf</B> <I>(<VAR>x</VAR>, <VAR>v</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(pDF) at <VAR>x</VAR> of a univariate discrete distribution which assumes
the values in <VAR>v</VAR> with probabilities <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-discrete_rnd"></A>
<A NAME="IDX859"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>discrete_rnd</B> <I>(<VAR>n</VAR>, <VAR>v</VAR>, <VAR>p</VAR>)</I>
<DD><A NAME="IDX860"></A>
<DT><U>Function File:</U>  <B>discrete_rnd</B> <I>(<VAR>v</VAR>, <VAR>p</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX861"></A>
<DT><U>Function File:</U>  <B>discrete_rnd</B> <I>(<VAR>v</VAR>, <VAR>p</VAR>, <VAR>sz</VAR>)</I>
<DD>Generate a row vector containing a random sample of size <VAR>n</VAR> from
the univariate distribution which assumes the values in <VAR>v</VAR> with
probabilities <VAR>p</VAR>. <VAR>n</VAR> must be a scalar.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are given create a matrix with <VAR>r</VAR> rows and
<VAR>c</VAR> columns. Or if <VAR>sz</VAR> is a vector, create a matrix of size
<VAR>sz</VAR>.
</P>
</DL>
<P>

<A NAME="doc-empirical_cdf"></A>
<A NAME="IDX862"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>empirical_cdf</B> <I>(<VAR>x</VAR>, <VAR>data</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the empirical distribution obtained from
the univariate sample <VAR>data</VAR>.
</DL>
<P>

<A NAME="doc-empirical_inv"></A>
<A NAME="IDX863"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>empirical_inv</B> <I>(<VAR>x</VAR>, <VAR>data</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the empirical distribution obtained from the
univariate sample <VAR>data</VAR>.
</DL>
<P>

<A NAME="doc-empirical_pdf"></A>
<A NAME="IDX864"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>empirical_pdf</B> <I>(<VAR>x</VAR>, <VAR>data</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the empirical distribution obtained from the
univariate sample <VAR>data</VAR>.
</DL>
<P>

<A NAME="doc-empirical_rnd"></A>
<A NAME="IDX865"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>empirical_rnd</B> <I>(<VAR>n</VAR>, <VAR>data</VAR>)</I>
<DD><A NAME="IDX866"></A>
<DT><U>Function File:</U>  <B>empirical_rnd</B> <I>(<VAR>data</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX867"></A>
<DT><U>Function File:</U>  <B>empirical_rnd</B> <I>(<VAR>data</VAR>, <VAR>sz</VAR>)</I>
<DD>Generate a bootstrap sample of size <VAR>n</VAR> from the empirical
distribution obtained from the univariate sample <VAR>data</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are given create a matrix with <VAR>r</VAR> rows and
<VAR>c</VAR> columns. Or if <VAR>sz</VAR> is a vector, create a matrix of size
<VAR>sz</VAR>.
</P>
</DL>
<P>

<A NAME="doc-exponential_cdf"></A>
<A NAME="IDX868"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>exponential_cdf</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the exponential distribution with
parameter <VAR>lambda</VAR>.
<P>

The arguments can be of common size or scalar.
</P>
</DL>
<P>

<A NAME="doc-exponential_inv"></A>
<A NAME="IDX869"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>exponential_inv</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the exponential distribution with parameter
<VAR>lambda</VAR>.
</DL>
<P>

<A NAME="doc-exponential_pdf"></A>
<A NAME="IDX870"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>exponential_pdf</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) of the exponential distribution with parameter <VAR>lambda</VAR>.
</DL>
<P>

<A NAME="doc-exponential_rnd"></A>
<A NAME="IDX871"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>exponential_rnd</B> <I>(<VAR>lambda</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX872"></A>
<DT><U>Function File:</U>  <B>exponential_rnd</B> <I>(<VAR>lambda</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the
exponential distribution with parameter <VAR>lambda</VAR>, which must be a
scalar or of size <VAR>r</VAR> by <VAR>c</VAR>. Or if <VAR>sz</VAR> is a vector, 
create a matrix of size <VAR>sz</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the size of <VAR>lambda</VAR>.
</P>
</DL>
<P>

<A NAME="doc-f_cdf"></A>
<A NAME="IDX873"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>f_cdf</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the CDF at <VAR>x</VAR> of the F
distribution with <VAR>m</VAR> and <VAR>n</VAR> degrees of freedom, i.e.,
PROB (F (<VAR>m</VAR>, <VAR>n</VAR>) &lt;= <VAR>x</VAR>). 
</DL>
<P>

<A NAME="doc-f_inv"></A>
<A NAME="IDX874"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>f_inv</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>n</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the quantile (the inverse of
the CDF) at <VAR>x</VAR> of the F distribution with parameters <VAR>m</VAR> and
<VAR>n</VAR>.
</DL>
<P>

<A NAME="doc-f_pdf"></A>
<A NAME="IDX875"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>f_pdf</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the F distribution with <VAR>m</VAR> and <VAR>n</VAR>
degrees of freedom.
</DL>
<P>

<A NAME="doc-f_rnd"></A>
<A NAME="IDX876"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>f_rnd</B> <I>(<VAR>m</VAR>, <VAR>n</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX877"></A>
<DT><U>Function File:</U>  <B>f_rnd</B> <I>(<VAR>m</VAR>, <VAR>n</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the F
distribution with <VAR>m</VAR> and <VAR>n</VAR> degrees of freedom.  Both
<VAR>m</VAR> and <VAR>n</VAR> must be scalar or of size <VAR>r</VAR> by <VAR>c</VAR>.
If <VAR>sz</VAR> is a vector the random samples are in a matrix of 
size <VAR>sz</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>m</VAR> and <VAR>n</VAR>.
</P>
</DL>
<P>

<A NAME="doc-gamma_cdf"></A>
<A NAME="IDX878"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>gamma_cdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the Gamma distribution with parameters
<VAR>a</VAR> and <VAR>b</VAR>.
</DL>
<P>

<A NAME="doc-gamma_inv"></A>
<A NAME="IDX879"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>gamma_inv</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the quantile (the inverse of
the CDF) at <VAR>x</VAR> of the Gamma distribution with parameters <VAR>a</VAR>
and <VAR>b</VAR>. 
</DL>
<P>

<A NAME="doc-gamma_pdf"></A>
<A NAME="IDX880"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>gamma_pdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, return the probability density function
(PDF) at <VAR>x</VAR> of the Gamma distribution with parameters <VAR>a</VAR>
and <VAR>b</VAR>.
</DL>
<P>

<A NAME="doc-gamma_rnd"></A>
<A NAME="IDX881"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>gamma_rnd</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX882"></A>
<DT><U>Function File:</U>  <B>gamma_rnd</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> or a <CODE>size (<VAR>sz</VAR>)</CODE> matrix of 
random samples from the Gamma distribution with parameters <VAR>a</VAR>
and <VAR>b</VAR>.  Both <VAR>a</VAR> and <VAR>b</VAR> must be scalar or of size 
<VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>a</VAR> and <VAR>b</VAR>.
</P>
</DL>
<P>

<A NAME="doc-geometric_cdf"></A>
<A NAME="IDX883"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>geometric_cdf</B> <I>(<VAR>x</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the CDF at <VAR>x</VAR> of the
geometric distribution with parameter <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-geometric_inv"></A>
<A NAME="IDX884"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>geometric_inv</B> <I>(<VAR>x</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile at <VAR>x</VAR> of the
geometric distribution with parameter <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-geometric_pdf"></A>
<A NAME="IDX885"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>geometric_pdf</B> <I>(<VAR>x</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the geometric distribution with parameter <VAR>p</VAR>.
</DL>
<P>

<A NAME="doc-geometric_rnd"></A>
<A NAME="IDX886"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>geometric_rnd</B> <I>(<VAR>p</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX887"></A>
<DT><U>Function File:</U>  <B>geometric_rnd</B> <I>(<VAR>p</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the
geometric distribution with parameter <VAR>p</VAR>, which must be a scalar
or of size <VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are given create a matrix with <VAR>r</VAR> rows and
<VAR>c</VAR> columns. Or if <VAR>sz</VAR> is a vector, create a matrix of size
<VAR>sz</VAR>.
</P>
</DL>
<P>

<A NAME="doc-hypergeometric_cdf"></A>
<A NAME="IDX888"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>hypergeometric_cdf</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>t</VAR>, <VAR>n</VAR>)</I>
<DD>Compute the cumulative distribution function (CDF) at <VAR>x</VAR> of the
hypergeometric distribution with parameters <VAR>m</VAR>, <VAR>t</VAR>, and
<VAR>n</VAR>.  This is the probability of obtaining not more than <VAR>x</VAR>
marked items when randomly drawing a sample of size <VAR>n</VAR> without
replacement from a population of total size <VAR>t</VAR> containing
<VAR>m</VAR> marked items.
<P>

The parameters <VAR>m</VAR>, <VAR>t</VAR>, and <VAR>n</VAR> must positive integers
with <VAR>m</VAR> and <VAR>n</VAR> not greater than <VAR>t</VAR>.
</P>
</DL>
<P>

<A NAME="doc-hypergeometric_inv"></A>
<A NAME="IDX889"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>hypergeometric_inv</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>t</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile at <VAR>x</VAR> of the
hypergeometric distribution with parameters <VAR>m</VAR>, <VAR>t</VAR>, and
<VAR>n</VAR>.
<P>

The parameters <VAR>m</VAR>, <VAR>t</VAR>, and <VAR>n</VAR> must positive integers
with <VAR>m</VAR> and <VAR>n</VAR> not greater than <VAR>t</VAR>.
</P>
</DL>
<P>

<A NAME="doc-hypergeometric_pdf"></A>
<A NAME="IDX890"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>hypergeometric_pdf</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>t</VAR>, <VAR>n</VAR>)</I>
<DD>Compute the probability density function (PDF) at <VAR>x</VAR> of the
hypergeometric distribution with parameters <VAR>m</VAR>, <VAR>t</VAR>, and
<VAR>n</VAR>. This is the probability of obtaining <VAR>x</VAR> marked items
when randomly drawing a sample of size <VAR>n</VAR> without replacement
from a population of total size <VAR>t</VAR> containing <VAR>m</VAR> marked items.
<P>

The arguments must be of common size or scalar.
</P>
</DL>
<P>

<A NAME="doc-hypergeometric_rnd"></A>
<A NAME="IDX891"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>hypergeometric_rnd</B> <I>(<VAR>n_size</VAR>, <VAR>m</VAR>, <VAR>t</VAR>, <VAR>n</VAR>)</I>
<DD><A NAME="IDX892"></A>
<DT><U>Function File:</U>  <B>hypergeometric_rnd</B> <I>(<VAR>m</VAR>, <VAR>t</VAR>, <VAR>n</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX893"></A>
<DT><U>Function File:</U>  <B>hypergeometric_rnd</B> <I>(<VAR>m</VAR>, <VAR>t</VAR>, <VAR>n</VAR>, <VAR>sz</VAR>)</I>
<DD>Generate a row vector containing a random sample of size <VAR>n_size</VAR>
from the hypergeometric distribution with parameters <VAR>m</VAR>, <VAR>t</VAR>,
and <VAR>n</VAR>.
<P>

If  <VAR>r</VAR> and <VAR>c</VAR> are given create a matrix with <VAR>r</VAR> rows and
<VAR>c</VAR> columns. Or if <VAR>sz</VAR> is a vector, create a matrix of size
<VAR>sz</VAR>.
</P>
<P>

The parameters <VAR>m</VAR>, <VAR>t</VAR>, and <VAR>n</VAR> must positive integers
with <VAR>m</VAR> and <VAR>n</VAR> not greater than <VAR>t</VAR>.
</P>
</DL>
<P>

<A NAME="doc-kolmogorov_smirnov_cdf"></A>
<A NAME="IDX894"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>kolmogorov_smirnov_cdf</B> <I>(<VAR>x</VAR>, <VAR>tol</VAR>)</I>
<DD>Return the CDF at <VAR>x</VAR> of the Kolmogorov-Smirnov distribution,
<TABLE><tr><td>&nbsp;</td><td class=example><pre>         Inf
Q(x) =   SUM    (-1)^k exp(-2 k^2 x^2)
       k = -Inf
</pre></td></tr></table><P>

for <VAR>x</VAR> &gt; 0.
</P>
<P>

The optional parameter <VAR>tol</VAR> specifies the precision up to which
the series should be evaluated;  the default is <VAR>tol</VAR> = <CODE>eps</CODE>.
</P>
</DL>
<P>

<A NAME="doc-laplace_cdf"></A>
<A NAME="IDX895"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>laplace_cdf</B> <I>(<VAR>x</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the Laplace distribution.
</DL>
<P>

<A NAME="doc-laplace_inv"></A>
<A NAME="IDX896"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>laplace_inv</B> <I>(<VAR>x</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the Laplace distribution.
</DL>
<P>

<A NAME="doc-laplace_pdf"></A>
<A NAME="IDX897"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>laplace_pdf</B> <I>(<VAR>x</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the Laplace distribution.
</DL>
<P>

<A NAME="doc-laplace_rnd"></A>
<A NAME="IDX898"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>laplace_rnd</B> <I>(<VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX899"></A>
<DT><U>Function File:</U>  <B>laplace_rnd</B> <I>(<VAR>sz</VAR>);</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random numbers from the
Laplace distribution. Or is <VAR>sz</VAR> is a vector, create a matrix of
<VAR>sz</VAR>.
</DL>
<P>

<A NAME="doc-logistic_cdf"></A>
<A NAME="IDX900"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>logistic_cdf</B> <I>(<VAR>x</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the CDF at <VAR>x</VAR> of the
logistic distribution.
</DL>
<P>

<A NAME="doc-logistic_inv"></A>
<A NAME="IDX901"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>logistic_inv</B> <I>(<VAR>x</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the quantile (the inverse of
the CDF) at <VAR>x</VAR> of the logistic distribution.
</DL>
<P>

<A NAME="doc-logistic_pdf"></A>
<A NAME="IDX902"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>logistic_pdf</B> <I>(<VAR>x</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the PDF at <VAR>x</VAR> of the
logistic distribution.
</DL>
<P>

<A NAME="doc-logistic_rnd"></A>
<A NAME="IDX903"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>logistic_rnd</B> <I>(<VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX904"></A>
<DT><U>Function File:</U>  <B>logistic_rnd</B> <I>(<VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random numbers from the
logistic distribution. Or is <VAR>sz</VAR> is a vector, create a matrix of
<VAR>sz</VAR>.
</DL>
<P>

<A NAME="doc-lognormal_cdf"></A>
<A NAME="IDX905"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>lognormal_cdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>v</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the lognormal distribution with
parameters <VAR>a</VAR> and <VAR>v</VAR>.  If a random variable follows this
distribution, its logarithm is normally distributed with mean
<CODE>log (<VAR>a</VAR>)</CODE> and variance <VAR>v</VAR>.
<P>

Default values are <VAR>a</VAR> = 1, <VAR>v</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-lognormal_inv"></A>
<A NAME="IDX906"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>lognormal_inv</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>v</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the lognormal distribution with parameters <VAR>a</VAR>
and <VAR>v</VAR>.  If a random variable follows this distribution, its
logarithm is normally distributed with mean <CODE>log (<VAR>a</VAR>)</CODE> and
variance <VAR>v</VAR>.
<P>

Default values are <VAR>a</VAR> = 1, <VAR>v</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-lognormal_pdf"></A>
<A NAME="IDX907"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>lognormal_pdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>v</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the lognormal distribution with parameters
<VAR>a</VAR> and <VAR>v</VAR>.  If a random variable follows this distribution,
its logarithm is normally distributed with mean <CODE>log (<VAR>a</VAR>)</CODE>
and variance <VAR>v</VAR>.
<P>

Default values are <VAR>a</VAR> = 1, <VAR>v</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-lognormal_rnd"></A>
<A NAME="IDX908"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>lognormal_rnd</B> <I>(<VAR>a</VAR>, <VAR>v</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX909"></A>
<DT><U>Function File:</U>  <B>lognormal_rnd</B> <I>(<VAR>a</VAR>, <VAR>v</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the
lognormal distribution with parameters <VAR>a</VAR> and <VAR>v</VAR>. Both
<VAR>a</VAR> and <VAR>v</VAR> must be scalar or of size <VAR>r</VAR> by <VAR>c</VAR>.
Or if <VAR>sz</VAR> is a vector, create a matrix of size <VAR>sz</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>a</VAR> and <VAR>v</VAR>.
</P>
</DL>
<P>

<A NAME="doc-normal_cdf"></A>
<A NAME="IDX910"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>normal_cdf</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>v</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the normal distribution with mean
<VAR>m</VAR> and variance <VAR>v</VAR>.
<P>

Default values are <VAR>m</VAR> = 0, <VAR>v</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-normal_inv"></A>
<A NAME="IDX911"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>normal_inv</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>v</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the normal distribution with mean <VAR>m</VAR> and
variance <VAR>v</VAR>.
<P>

Default values are <VAR>m</VAR> = 0, <VAR>v</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-normal_pdf"></A>
<A NAME="IDX912"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>normal_pdf</B> <I>(<VAR>x</VAR>, <VAR>m</VAR>, <VAR>v</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the normal distribution with mean <VAR>m</VAR> and
variance <VAR>v</VAR>.
<P>

Default values are <VAR>m</VAR> = 0, <VAR>v</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-normal_rnd"></A>
<A NAME="IDX913"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>normal_rnd</B> <I>(<VAR>m</VAR>, <VAR>v</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX914"></A>
<DT><U>Function File:</U>  <B>normal_rnd</B> <I>(<VAR>m</VAR>, <VAR>v</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR>  or <CODE>size (<VAR>sz</VAR>)</CODE> matrix of
random samples from the normal distribution with parameters <VAR>m</VAR> 
and <VAR>v</VAR>.  Both <VAR>m</VAR> and <VAR>v</VAR> must be scalar or of size 
<VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>m</VAR> and <VAR>v</VAR>.
</P>
</DL>
<P>

<A NAME="doc-pascal_cdf"></A>
<A NAME="IDX915"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>pascal_cdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the CDF at x of the Pascal
(negative binomial) distribution with parameters <VAR>n</VAR> and <VAR>p</VAR>.
<P>

The number of failures in a Bernoulli experiment with success
probability <VAR>p</VAR> before the <VAR>n</VAR>-th success follows this
distribution.
</P>
</DL>
<P>

<A NAME="doc-pascal_inv"></A>
<A NAME="IDX916"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>pascal_inv</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile at <VAR>x</VAR> of the
Pascal (negative binomial) distribution with parameters <VAR>n</VAR> and
<VAR>p</VAR>.
<P>

The number of failures in a Bernoulli experiment with success
probability <VAR>p</VAR> before the <VAR>n</VAR>-th success follows this
distribution.
</P>
</DL>
<P>

<A NAME="doc-pascal_pdf"></A>
<A NAME="IDX917"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>pascal_pdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>, <VAR>p</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the Pascal (negative binomial) distribution with
parameters <VAR>n</VAR> and <VAR>p</VAR>.
<P>

The number of failures in a Bernoulli experiment with success
probability <VAR>p</VAR> before the <VAR>n</VAR>-th success follows this
distribution. 
</P>
</DL>
<P>

<A NAME="doc-pascal_rnd"></A>
<A NAME="IDX918"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>pascal_rnd</B> <I>(<VAR>n</VAR>, <VAR>p</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX919"></A>
<DT><U>Function File:</U>  <B>pascal_rnd</B> <I>(<VAR>n</VAR>, <VAR>p</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the Pascal
(negative binomial) distribution with parameters <VAR>n</VAR> and <VAR>p</VAR>.
Both <VAR>n</VAR> and <VAR>p</VAR> must be scalar or of size <VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>n</VAR> and <VAR>p</VAR>. Or if <VAR>sz</VAR> is a vector, 
create a matrix of size <VAR>sz</VAR>.
</P>
</DL>
<P>

<A NAME="doc-poisson_cdf"></A>
<A NAME="IDX920"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>poisson_cdf</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the cumulative distribution
function (CDF) at <VAR>x</VAR> of the Poisson distribution with parameter
lambda.
</DL>
<P>

<A NAME="doc-poisson_inv"></A>
<A NAME="IDX921"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>poisson_inv</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the quantile (the inverse of
the CDF) at <VAR>x</VAR> of the Poisson distribution with parameter
<VAR>lambda</VAR>.
</DL>
<P>

<A NAME="doc-poisson_pdf"></A>
<A NAME="IDX922"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>poisson_pdf</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the poisson distribution with parameter <VAR>lambda</VAR>.
</DL>
<P>

<A NAME="doc-poisson_rnd"></A>
<A NAME="IDX923"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>poisson_rnd</B> <I>(<VAR>lambda</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the
Poisson distribution with parameter <VAR>lambda</VAR>, which must be a 
scalar or of size <VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the size of <VAR>lambda</VAR>.
</P>
</DL>
<P>

<A NAME="doc-stdnormal_cdf"></A>
<A NAME="IDX924"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>stdnormal_cdf</B> <I>(<VAR>x</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the CDF of the standard normal
distribution at <VAR>x</VAR>.
</DL>
<P>

<A NAME="doc-stdnormal_inv"></A>
<A NAME="IDX925"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>stdnormal_inv</B> <I>(<VAR>x</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute compute the quantile (the
inverse of the CDF) at <VAR>x</VAR> of the standard normal distribution.
</DL>
<P>

<A NAME="doc-stdnormal_pdf"></A>
<A NAME="IDX926"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>stdnormal_pdf</B> <I>(<VAR>x</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) of the standard normal distribution at <VAR>x</VAR>.
</DL>
<P>

<A NAME="doc-stdnormal_rnd"></A>
<A NAME="IDX927"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>stdnormal_rnd</B> <I>(<VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX928"></A>
<DT><U>Function File:</U>  <B>stdnormal_rnd</B> <I>(<VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> or <CODE>size (<VAR>sz</VAR>)</CODE> matrix of 
random numbers from the standard normal distribution.
</DL>
<P>

<A NAME="doc-t_cdf"></A>
<A NAME="IDX929"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>t_cdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the CDF at <VAR>x</VAR> of the
t (Student) distribution with <VAR>n</VAR> degrees of freedom, i.e.,
PROB (t(<VAR>n</VAR>) &lt;= <VAR>x</VAR>).
</DL>
<P>

<A NAME="doc-t_inv"></A>
<A NAME="IDX930"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>t_inv</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>)</I>
<DD>For each component of <VAR>x</VAR>, compute the quantile (the inverse of
the CDF) at <VAR>x</VAR> of the t (Student) distribution with parameter
<VAR>n</VAR>.
</DL>
<P>

<A NAME="doc-t_pdf"></A>
<A NAME="IDX931"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>t_pdf</B> <I>(<VAR>x</VAR>, <VAR>n</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the probability density function
(PDF) at <VAR>x</VAR> of the <VAR>t</VAR> (Student) distribution with <VAR>n</VAR>
degrees of freedom. 
</DL>
<P>

<A NAME="doc-t_rnd"></A>
<A NAME="IDX932"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>t_rnd</B> <I>(<VAR>n</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX933"></A>
<DT><U>Function File:</U>  <B>t_rnd</B> <I>(<VAR>n</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the t
(Student) distribution with <VAR>n</VAR> degrees of freedom.  <VAR>n</VAR> must
be a scalar or of size <VAR>r</VAR> by <VAR>c</VAR>. Or if <VAR>sz</VAR> is a
vector create a matrix of size <VAR>sz</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the size of <VAR>n</VAR>.
</P>
</DL>
<P>

<A NAME="doc-uniform_cdf"></A>
<A NAME="IDX934"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>uniform_cdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>Return the CDF at <VAR>x</VAR> of the uniform distribution on [<VAR>a</VAR>,
<VAR>b</VAR>], i.e., PROB (uniform (<VAR>a</VAR>, <VAR>b</VAR>) &lt;= x).
<P>

Default values are <VAR>a</VAR> = 0, <VAR>b</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-uniform_inv"></A>
<A NAME="IDX935"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>uniform_inv</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the quantile (the inverse of the
CDF) at <VAR>x</VAR> of the uniform distribution on [<VAR>a</VAR>, <VAR>b</VAR>].
<P>

Default values are <VAR>a</VAR> = 0, <VAR>b</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-uniform_pdf"></A>
<A NAME="IDX936"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>uniform_pdf</B> <I>(<VAR>x</VAR>, <VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD>For each element of <VAR>x</VAR>, compute the PDF at <VAR>x</VAR> of the uniform
distribution on [<VAR>a</VAR>, <VAR>b</VAR>].
<P>

Default values are <VAR>a</VAR> = 0, <VAR>b</VAR> = 1.
</P>
</DL>
<P>

<A NAME="doc-uniform_rnd"></A>
<A NAME="IDX937"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>uniform_rnd</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX938"></A>
<DT><U>Function File:</U>  <B>uniform_rnd</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> or a <CODE>size (<VAR>sz</VAR>)</CODE> matrix of 
random samples from the uniform distribution on [<VAR>a</VAR>, <VAR>b</VAR>]. 
Both <VAR>a</VAR> and <VAR>b</VAR> must be scalar or of size <VAR>r</VAR> by <VAR>c</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>a</VAR> and <VAR>b</VAR>.
</P>
</DL>
<P>

<A NAME="doc-weibull_cdf"></A>
<A NAME="IDX939"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>weibull_cdf</B> <I>(<VAR>x</VAR>, <VAR>alpha</VAR>, <VAR>sigma</VAR>)</I>
<DD>Compute the cumulative distribution function (CDF) at <VAR>x</VAR> of the
Weibull distribution with shape parameter <VAR>alpha</VAR> and scale
parameter <VAR>sigma</VAR>, which is
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>1 - exp(-(x/sigma)^alpha)
</pre></td></tr></table><P>

for <VAR>x</VAR> &gt;= 0.
</P>
</DL>
<P>

<A NAME="doc-weibull_inv"></A>
<A NAME="IDX940"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>weibull_inv</B> <I>(<VAR>x</VAR>, <VAR>lambda</VAR>, <VAR>alpha</VAR>)</I>
<DD>Compute the quantile (the inverse of the CDF) at <VAR>x</VAR> of the
Weibull distribution with shape parameter <VAR>alpha</VAR> and scale
parameter <VAR>sigma</VAR>.
</DL>
<P>

<A NAME="doc-weibull_pdf"></A>
<A NAME="IDX941"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>weibull_pdf</B> <I>(<VAR>x</VAR>, <VAR>alpha</VAR>, <VAR>sigma</VAR>)</I>
<DD>Compute the probability density function (PDF) at <VAR>x</VAR> of the
Weibull distribution with shape parameter <VAR>alpha</VAR> and scale
parameter <VAR>sigma</VAR> which is given by
<P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>   alpha * sigma^(-alpha) * x^(alpha-1) * exp(-(x/sigma)^alpha)
</pre></td></tr></table><P>

for <VAR>x</VAR> &gt; 0.
</P>
</DL>
<P>

<A NAME="doc-weibull_rnd"></A>
<A NAME="IDX942"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>weibull_rnd</B> <I>(<VAR>alpha</VAR>, <VAR>sigma</VAR>, <VAR>r</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX943"></A>
<DT><U>Function File:</U>  <B>weibull_rnd</B> <I>(<VAR>alpha</VAR>, <VAR>sigma</VAR>, <VAR>sz</VAR>)</I>
<DD>Return an <VAR>r</VAR> by <VAR>c</VAR> matrix of random samples from the
Weibull distribution with parameters <VAR>alpha</VAR> and <VAR>sigma</VAR>
which must be scalar or of size <VAR>r</VAR> by <VAR>c</VAR>. Or if <VAR>sz</VAR>
is a vector return a matrix of size <VAR>sz</VAR>.
<P>

If <VAR>r</VAR> and <VAR>c</VAR> are omitted, the size of the result matrix is
the common size of <VAR>alpha</VAR> and <VAR>sigma</VAR>.
</P>
</DL>
<P>

<A NAME="doc-wiener_rnd"></A>
<A NAME="IDX944"></A>
</P>
<DL>
<DT><U>Function File:</U>  <B>wiener_rnd</B> <I>(<VAR>t</VAR>, <VAR>d</VAR>, <VAR>n</VAR>)</I>
<DD>Return a simulated realization of the <VAR>d</VAR>-dimensional Wiener Process
on the interval [0, <VAR>t</VAR>].  If <VAR>d</VAR> is omitted, <VAR>d</VAR> = 1 is
used. The first column of the return matrix contains time, the
remaining columns contain the Wiener process.
<P>

The optional parameter <VAR>n</VAR> gives the number of summands used for
simulating the process over an interval of length 1.  If <VAR>n</VAR> is
omitted, <VAR>n</VAR> = 1000 is used.
</P>
</DL>
<P>

<A NAME="Financial Functions"></A>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_26.html#SEC176"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_27.html#SEC181"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_42.html#SEC245">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="octave_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>
<FONT SIZE="-1">
This document was generated
by <I>John W. Eaton</I> on <I>May, 18 2005</I>
using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
</FONT>

</BODY>
</HTML>