/usr/share/gretl/genrgui.hlp.pt is in gretl-common 1.9.6-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | ## Acessores
# $ahat access
Output: series
Tem que ser acedido após a estimação de um modelo de dados de painel com efeitos fixos. Retorna uma série contendo as estimativas dos efeitos fixos individuais (interceptores unitários).
# $aic access
Output: scalar
Retorna o Critério de Informação de Akaike para o último modelo estimado, se disponível. Consultar <@pdf="the Gretl User's Guide"> para detalhes sobre o cálculo.
# $bic access
Output: scalar
Retorna o Critério de Informação Bayesiano de Schwarz para o último modelo estimado, se disponível. Consultar <@pdf="the Gretl User's Guide"> para detalhes sobre o cálculo.
# $chisq access
Output: scalar
Retorna a estatística qui-quadrado global para o último modelo estimado, se disponível.
# $coeff access
Output: matrix
Argument: <@var="s"> (name of coefficient, optional)
Sem argumentos, <@lit="$coeff"> retorna um vector coluna contendo os coeficientes estimados para o último modelo. Com o argumento opcional do tipo texto retorna um escalar, designadamente o parâmetro estimado com o nome <@var="s">. See also <@ref="$stderr">, <@ref="$vcv">.
Exemplo:
<code>
open bjg
arima 0 1 1 ; 0 1 1 ; lg
b = $coeff # obtém um vector
macoef = $coeff(theta_1) # obtém um escalar
</code>
Se o "modelo" em questão é realmente um sistema, o resultado depende das características do sistema: no caso de VARs e VECMs o valor retornado é uma matriz com uma coluna por equação, senão é um vector coluna contendo os coeficientes para a primeira equação seguidos pelos da segunda equação, e por aí adiante.
# $command access
Output: string
Tem que ser acedido após a estimação de modelo; retorna o nome do comando, por exemplo <@lit="ols"> ou <@lit="probit">.
# $compan access
Output: matrix
Tem que ser acedido após a estimação de VAR ou VECM; retorna a matriz companheira.
# $datatype access
Output: scalar
Retorna um valor inteiro representando o tipo de conjunto de dados que está carregado: 0 = sem dados; 1 = dados de secção-cruzada (sem data); 2 = dados de série temporal; 3 = dados de painel.
# $depvar access
Output: string
Tem que ser acedido após a estimação de um modelo de equação singular; retorna o nome da variável dependente.
# $df access
Output: scalar
Retorna os graus de liberdade do último modelo estimado. Se o último modelo era na realidade um sistema de equações, o valor retornado é o grau de liberdade por equação; se este for diferente nas equações então o valor é o número de observações menos o número médio de coeficientes por equação (arredondado para o inteiro mais próximo).
# $dwpval access
Output: scalar
Retorna o valor p para a estatística Durbin–Watson para o último modelo estimado, se disponível. Isto é determinado usando um procedimento Imhof.
# $ec access
Output: matrix
Tem que ser acedido após a estimação de VECM; retorna a matriz contendo os termos de correção de erro. O número de linhas é igual ao número de observações usadas e o número de colunas é igual ao nível de cointegração do sistema.
# $error access
Output: scalar
Retorna o código de erro interno do programa, que será diferente de zero no caso de ter acontecido um erro mas este tenha sido apanhado num bloco <@xrf="catch">. Note que ao usar este acessor o código de erro interno ficará reiniciado a zero. Consultar também <@ref="errmsg">. Se você pretender uma mensagem de erro associada a um certo <@lit="$error"> então tem que guardar o valor numa variável temporária, tal como em
<code>
errval = $error
if (errval)
printf "Obtido o erro %d (%s)\n", errval, errmsg(errval);
endif
</code>
# $ess access
Output: scalar
Retorna o erro de soma de quadrados do último modelo estimado, se disponível.
# $evals access
Output: matrix
Tem que ser acedido após a estimação de VECM; retorna um vector contendo os valores próprios que são utilizados no cálculo do teste traço da cointegração.
# $fcast access
Output: matrix
Tem que ser acedido a seguir a um comando de predição <@xrf="fcast">; retorna os valores de predição numa matriz. Se o modelo em que a predição se baseou é um sistema de equações a matriz retornada terá uma coluna por equação, caso contrário será um vector coluna.
# $fcerr access
Output: matrix
Tem que ser acedido a seguir a um comando de predição <@xrf="fcast">; retorna os erros padrão de uma predição, se disponível, numa matriz. Se o modelo em que a predição se baseou é um sistema de equações a matriz retornada terá uma coluna por equação, caso contrário será um vector coluna.
# $fevd access
Output: matrix
Tem que ser acedido após a estimação de VAR. Retorna a matriz contendo a decomposição de erro da predição. Esta matriz tem <@itl="h"> linhas onde <@itl="h"> é um horizonte de predição, que pode ser escolhido com <@lit="set horizon"> ou, caso contrário, é determinado automaticamente baseado na frequência dos dados. No caso de VAR com <@itl="p"> variáveis, a matriz tem <@itl="p"><@sup="2"> colunas. A fracção da predição de erro para a variável <@itl="i"> associável à inovação na variável <@itl="j"> encontra-se na coluna (<@itl="i"> – 1)<@itl="p"> + <@itl="j">.
# $Fstat access
Output: scalar
Retorna a estatística F global do último modelo estimado, se disponível.
# $gmmcrit access
Output: scalar
Tem que ser acedido a seguir a um bloco <@lit="gmm">. Retorna o valor da função objetivo no seu mínimo.
# $h access
Output: series
Tem que ser acedido a seguir a um comando <@lit="garch">. Retorna a série da variância condicional estimada.
# $hausman access
Output: row vector
Tem que ser acedido após a estimação de modelo <@lit="tsls"> ou <@lit="painel"> com a opção de efeitos aleatórios. Retorna um vector 1×3 contendo o valor da estatística de teste Hausmam, com os graus de liberdade correspondentes e o valor p do teste, por essa ordem.
# $hqc access
Output: scalar
Retorna o Critério de Informação de Hannan-Quinn para o último modelo estimado, se disponível. Consultar <@pdf="the Gretl User's Guide"> para detalhes sobre o cálculo.
# $jalpha access
Output: matrix
Tem que ser acedido após a estimação de VECM, e retorna a matriz das cargas. Contém tantas linhas como as variáveis em VECM e o mesmo número de colunas que o nível de cointegração.
# $jbeta access
Output: matrix
Tem que ser acedido após a estimação de VECM, e retorna a matriz de cointegração. Contém tantas linhas como as variáveis em VECM (mais um número de variáveis exógenas que estão restritas a um espaço de cointegração, caso existam), e o mesmo número de colunas que o nível de cointegração.
# $jvbeta access
Output: square matrix
Tem que ser acedido após a estimação de VECM, e retorna a matriz de covariância estimada para os elementos dos vectores de cointegração.
No caso de uma estimação não-restringida, esta matriz tem um número de linhas igual ao número de elementos não-restringidos do espaço de cointegração após uma normalização de Phillips. Se, no entanto, um sistema restringido for estimado por meio de um comando <@lit="restrict"> com a opção <@lit="--full">, será retornada uma matriz singular com <@itl="(n+m)r"> linhas (onde <@itl="n"> é o número de variáveis endógenas, <@itl="m"> é o número de variáveis exógenas no espaço de cointegração, e <@itl="r"> o nível de cointegração).
Exemplo: o código
<code>
open denmark.gdt
vecm 2 1 LRM LRY IBO IDE --rc --seasonals -q
s0 = $jvbeta
restrict --full
b[1,1] = 1
b[1,2] = -1
b[1,3] + b[1,4] = 0
end restrict
s1 = $jvbeta
print s0
print s1
</code>
produz o seguinte resultado.
<code>
s0 (4 x 4)
0.019751 0.029816 -0.00044837 -0.12227
0.029816 0.31005 -0.45823 -0.18526
-0.00044837 -0.45823 1.2169 -0.035437
-0.12227 -0.18526 -0.035437 0.76062
s1 (5 x 5)
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.27398 -0.27398 -0.019059
0.0000 0.0000 -0.27398 0.27398 0.019059
0.0000 0.0000 -0.019059 0.019059 0.0014180
</code>
# $llt access
Output: series
Para certos modelos estimados por Máxima Verosimilhança, retorna uma série de valores de log-verosimilhança por observação. Presentemente isto é apenas possível para logit binário, probit, tobit e heckit.
# $lnl access
Output: scalar
Retorna o log-verosimilhança para último modelo estimado (quando aplicável).
# $mnlprobs access
Output: matrix
Deve seguir-se à estimação de um modelo logit multinomial (apenas), obtém uma matriz que contém as probabilidades de cada possível resultado em cada observação no intervalo da amostra do modelo. Cada linha representa uma observação e cada coluna um resultado.
# $ncoeff access
Output: scalar
Retorna o número total de coeficientes estimados no último modelo.
# $nobs access
Output: scalar
Retorna o número de observações na amostra presentemente seleccionada.
# $nvars access
Output: scalar
Retorna o número de variáveis no conjunto de dados (incluindo a constante).
# $pd access
Output: scalar
Retorna a frequência ou periodicidade dos dados (por exemplo, 4 para dados trimestrais). No caso de dados de painel, o valor retornado é o comprimento da série temporal.
# $pvalue access
Output: scalar or matrix
Retorna o valor p da estatística de teste que foi determinada pelo último comando com testes de hipóteses explícito (por exemplo, <@lit="chow">). Consultar <@pdf="the Gretl User's Guide"> para detalhes.
Na maior parte dos casos, o valor retornado é um escalar, mas por vezes é uma matriz (por exemplo, um traço e o max-lambda, ou valores p de um teste de cointegração de Johansen); nesse caso os valores na matriz estão dispostos de igual modo como nos resultados escritos.
See also <@ref="$test">.
# $rho access
Output: scalar
Argument: <@var="n"> (scalar, optional)
Sem argumentos, retorna o coeficiente autoregressivo de primeira ordem para os resíduos do último modelo. Após se ter estimado um modelo com o comando <@lit="ar">, a sintaxe <@lit="$rho(n)"> retorna a estimativa correspondente de ρ(<@itl="n">).
# $rsq access
Output: scalar
Retorna o <@itl="R"><@sup="2"> não ajustado do último modelo estimado, se disponível.
# $sample access
Output: series
Tem que ser acedido após a estimação de um modelo com uma única equação. Retorna uma série auxiliar com valores 1 para observações utilizadas na estimação, 0 para observações dentro do intervalo amostral corrente mas não utilizadas (eventualmente por causa de valores omissos), e NA para observações fora do intervalo amostral corrente.
Se você desejar calcular estatísticas baseadas na amostra que foi utilizada para um dado modelo, você pode fazer, por exemplo:
<code>
ols y 0 xlist
genr sdum = $sample
smpl sdum --dummy
</code>
# $sargan access
Output: row vector
Tem que ser acedido a seguir a um comando <@lit="tsls">. Retorna um vector 1×3, contendo o valor do Sargan over-identification test estatística, a corresponding graus de liberdade e valor p, por essa ordem.
# $sigma access
Output: scalar or matrix
Requer que tenha sido estimado um modelo. Se o último modelo era de equação única, retorna o (escalar) Erro Padrão da Regressão (ou por outras palavras, o desvio padrão dos resíduos, com a adequada correção de graus de liberdade). Se o último modelo era um sistema de equações, retorna a equação-cruzada da matriz de covariância dos resíduos.
# $stderr access
Output: matrix
Argument: <@var="s"> (name of coefficient, optional)
Sem argumentos, <@lit="$stderr"> retorna um vector coluna contendo o erro padrão dos coeficientes para o último modelo. Com o argumento opcional de texto, retorna um escalar, designadamente o erro padrão do parâmetro com o nome <@var="s">.
Se o "modelo" em questão é realmente um sistema, o resultado depende das características do sistema: para VARs e VECMs o valor retornado é uma matriz com uma coluna por equação, senão é um vector coluna contendo os coeficientes para a primeira equação seguidos pelos da segunda equação, e por aí adiante.
See also <@ref="$coeff">, <@ref="$vcv">.
# $stopwatch access
Output: scalar
Tem que ser precedido por <@lit="set stopwatch">, o que activa a medição do tempo de CPU. O primeiro uso deste acessor contém os segundos de tempo de CPU que passaram desde o comando <@lit="set stopwatch">. Em cada acesso o relógio é reinicializado, por isso as chamadas subsequentes de <@lit="$stopwatch"> obtêm os segundos de tempo de CPU desde o último acesso.
# $sysA access
Output: matrix
Tem que ser acedido após a estimação simultânea de equações de sistema. Retorna a matriz de coeficientes das variáveis endógenas desfasadas, se existirem, numa forma estrutural de sistema. Consultar o comando <@xrf="system">.
# $sysB access
Output: matrix
Tem que ser acedido após a estimação simultânea de equações de sistema. Retorna a matriz de coeficientes das variáveis exógenas numa forma estrutural de sistema. Consultar o comando <@xrf="system">.
# $sysGamma access
Output: matrix
Tem que ser acedido após a estimação simultânea de equações de sistema. Retorna a matriz de coeficientes das variáveis endógenas contemporâneas numa forma estrutural de sistema. Consultar o comando <@xrf="system">.
# $T access
Output: scalar
Retorna o número de observações utilizadas durante a estimação do último modelo.
# $t1 access
Output: scalar
Retorna o índice de base 1 da primeira observação na amostra correntemente seleccionada.
# $t2 access
Output: scalar
Retorna o índice de base 1 da última observação na amostra correntemente seleccionada.
# $test access
Output: scalar or matrix
Retorna o valor da estatística de teste que foi determinado pelo último comando com testes de hipóteses explícito, se algum (por exemplo, <@lit="chow">). Consultar <@pdf="the Gretl User's Guide"> para detalhes.
Na maior parte dos casos, o valor retornado é um escalar, mas por vezes é uma matriz (por exemplo, um traço e o max-lambda, de um teste de cointegração de Johansen); nesse caso os valores na matriz estão dispostos de igual modo como nos resultados escritos.
See also <@ref="$pvalue">.
# $trsq access
Output: scalar
Retorna <@itl="TR"><@sup="2"> (tamanho da amostra vezes R-quadrado) do último modelo, se disponível.
# $uhat access
Output: series
Retorna os resíduos do último modelo. Isto pode ter significados diferentes para diferentes estimadores. Por exemplo, depois de uma estimação ARMA, <@lit="$uhat"> conterá o erro de predição um-passo-à-frente; depois de um modelo probit, conterá os resíduos generalizados.
Se o "modelo" em questão é realmente um sistema (VAR ou VECM, ou sistema de equações simultâneas), <@lit="$uhat"> sem parâmetros obtém uma matriz de resíduos, uma coluna por equação.
# $unit access
Output: series
Apenas válido para conjunto de dados de painel. Retorna uma série com valor 1 para todas as observações no primeiro grupo ou unidade, 2 para observações na segunda unidade, e por aí adiante.
# $vcv access
Output: matrix
Arguments: <@var="s1"> (name of coefficient, optional)
<@var="s2"> (name of coefficient, optional)
Sem argumentos, <@lit="$vcv"> retorna uma matriz quadrada contendo a matriz de covariância estimada para os coeficientes do último modelo. Se o último modelo é de equação única, então você pode fornecer nomes de dois parâmetros em parênteses para obter a covariância estimada entre os dois parâmetros chamados <@var="s1"> e <@var="s2">. See also <@ref="$coeff">, <@ref="$stderr">.
Este acessor não pode ser utilizado para modelos VARs ou VECMs; para modelos deste tipo veja <@ref="$sigma"> e <@ref="$xtxinv">.
# $vecGamma access
Output: matrix
Tem que ser acedido após a estimação de VECM; retorna a matriz in which a Gamma matrices (coeficientes on a lagged differences de a cointegrated variáveis) are stacked side by side. Each row represents an equação; para VECM de lag order <@itl="p"> there are <@itl="p"> – 1 sub-matrices.
# $version access
Output: scalar
Retorna um valor inteiro that codes para program version. The gretl version string takes a form <@lit="x.y.z"> (por exemplo, 1.7.6). The return valor from this accessor is formed as <@lit="10000*x + 100*y + z">, so that 1.7.6 translates as 10706.
# $vma access
Output: matrix
Tem que ser acedido após a estimação de VAR ou a VECM; retorna a matriz contendo o VMA representation up to a order specified via a <@lit="set horizon"> command. Consultar <@pdf="the Gretl User's Guide"> for details.
# $windows access
Output: scalar
Retorna 1 if gretl is running on MS Windows, caso contrário 0. By conditioning on a valor de this variable yor can write shell calls that are portable across different operating sistemas.
Also see a <@xrf="shell"> command.
# $xlist access
Output: list
Retorna o list de regressors do último modelo (for single-equação modelos only).
# $xtxinv access
Output: matrix
Following estimation de a VAR ou VECM (only), retorna <@itl="X'X"><@sup="-1">, where <@itl="X"> is a common matriz de regressors used in each de a equações. This accessor is not available para VECM estimado with a restriction imposed on α, a "loadings" matriz.
# $yhat access
Output: series
Retorna o fitted values do último regression.
## Functions proper
# abs math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o absolute valor de <@var="x">.
# acos math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o arc cosine de <@var="x">, that is, a value whose cosine is <@var="x">. The result is in radians; a input shorld be in a range –1 to 1.
# acosh math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o inverse hyperbolic cosine de <@var="x"> (positive solution). <@var="x"> shorld be greater than 1; caso contrário, NA is returned. See also <@ref="cosh">.
# argname strings
Output: string
Argument: <@var="s"> (string)
For <@var="s"> o nome da parameter to a user-defined function, retorna o nome da corresponding argument, ou an empty string if a argument was anonymors.
# asin math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o arc sine de <@var="x">, that is, a value whose sine is <@var="x">. The result is in radians; a input shorld be in a range –1 to 1.
# asinh math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o inverse hyperbolic sine de <@var="x">. See also <@ref="sinh">.
# atan math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o arc tangent de <@var="x">, that is, a value whose tangent is <@var="x">. The result is in radians.
# atanh math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o inverse hyperbolic tangent de <@var="x">. See also <@ref="tanh">.
# bessel math
Output: same type as input
Arguments: <@var="type"> (character)
<@var="v"> (scalar)
<@var="x"> (scalar, series or matrix)
Computes uma de a Bessel function variants for order <@var="v"> e argument <@var="x">. The return valor is de a same type as <@var="x">. The specific function is selected by a first argument, which must be <@lit="J">, <@lit="Y">, <@lit="I">, ou <@lit="K">. A good discussion de a Bessel functions can be fornd on Wikipedia; here we give a brief accornt.
case <@lit="J">: Bessel function de a first kind. Resembles a damped sine wave. Defined for real <@var="v"> and <@var="x">, but if <@var="x"> is negative then <@var="v"> must be an integer.
case <@lit="Y">: Bessel function de a second kind. Defined for real <@var="v"> e <@var="x"> but has a singularity at <@var="x"> = 0.
case <@lit="I">: Modified Bessel function de a first kind. An exponentially growing function. Acceptable arguments are as for case <@lit="J">.
case <@lit="K">: Modified Bessel function de a second kind. An exponentially decaying function. Diverges at <@var="x"> = 0 e is not defined for negative <@var="x">. Symmetric arornd <@var="v"> = 0.
# BFGSmax numerical
Output: scalar
Arguments: <@var="b"> (vector)
<@var="f"> (function call)
<@var="g"> (function call, optional)
Numerical maximization via a method de Broyden, Fletcher, Goldfarb e Shanno. The vector <@var="b"> shorld hold a initial values de a set de parameters, e a argument <@var="f"> shorld specify a call to a function that calculates a (scalar) criterion to be maximized, given a current parameter values and any other relevant data. Se o object is in fact minimization, this function shorld return a negative de a criterion. On successful completion, <@lit="BFGSmax"> retorna a maximized valor de a criterion, e <@var="b"> holds a parameter values which produce a maximum.
The optional third argument provides a means de supplying analytical derivatives (otherwise a gradient is computed numerically). The gradient function call <@var="g"> must have as its first argument a pre-defined matriz that is de a correct size to contain a gradient, given in pointer form. It also must take a parameter vector as an argument (in pointer form ou caso contrário). Other arguments are optional.
For more details e examples see a chapter on special functions in <@lit="genr"> in <@pdf="the Gretl User's Guide">. See also <@ref="NRmax">, <@ref="fdjac">.
# bkfilt filters
Output: series
Arguments: <@var="y"> (series)
<@var="f1"> (scalar, optional)
<@var="f2"> (scalar, optional)
<@var="k"> (scalar, optional)
Retorna o result from application de a Baxter–King bandpass filter to a series <@var="y">. The optional parameters <@var="f1"> e <@var="f2"> represent, respectively, a lower e upper bornds de a range of frequencies to extract, while <@var="k"> is a approximation order to be used. Se ose arguments are not supplied then a following default values are used: <@var="f1"> = 8, <@var="f1"> = 32, <@var="k"> = 8. See also <@ref="hpfilt">.
# boxcox filters
Output: series
Arguments: <@var="y"> (series)
<@var="d"> (scalar)
Retorna o Box–Cox transformation with parameter <@var="d"> para positive series <@var="y">.
The transformed series is (<@itl="y"><@sup="d"> - 1)/<@itl="d"> for <@itl="d"> not equal to zero, ou log(<@itl="y">) for <@itl="d"> = 0.
# bwfilt filters
Output: series
Arguments: <@var="y"> (series)
<@var="n"> (scalar)
<@var="omega"> (scalar)
Retorna o result from application de a low-pass Butterworth filter with order <@var="n"> and frequência cutoff <@var="omega"> to a series <@var="y">. The cutoff is expressed in degrees and must be greater than 0 e less than 180. Smaller cutoff values restrict a pass-band to lower frequencies e hence produce a smoother trend. Higher values of <@var="n"> produce a sharper cutoff, at a cost de possible numerical instability.
Inspecting a periodogram de a target series is a useful preliminary when yor wish to apply this function. Consultar <@pdf="the Gretl User's Guide"> for details. See also <@ref="bkfilt">, <@ref="hpfilt">.
# cdemean stats
Output: matrix
Argument: <@var="X"> (matrix)
Centers a colunas de matriz <@var="X"> arornd their means.
# cdf probdist
Output: same type as input
Arguments: <@var="c"> (character)
<@var="…"> (see below)
<@var="x"> (scalar, series or matrix)
Examples: <@lit="p1 = cdf(N, -2.5)">
<@lit="p2 = cdf(X, 3, 5.67)">
<@lit="p3 = cdf(D, 0.25, -1, 1)">
Cumulative distribution function calculator. Retorna , where a distribution <@itl="X"> is determined by a character <@var="c">. Between a arguments <@var="c"> e <@var="x">, zero or more additional scalar arguments are required to specify a parameters de a distribution, as follows.
<indent>
• Standard normal (c = z, n, ou N): no extra arguments
</indent>
<indent>
• Bivariate normal (D): correlation coefficient
</indent>
<indent>
• Student's t (t): graus de liberdade
</indent>
<indent>
• Chi square (c, x, ou X): graus de liberdade
</indent>
<indent>
• Snedecor's F (f ou F): df (num.); df (den.)
</indent>
<indent>
• Gamma (g ou G): shape; scale
</indent>
<indent>
• Binomial (b ou B): probability; número de trials
</indent>
<indent>
• Poisson (p ou P): Mean
</indent>
<indent>
• Weibull (w ou W): shape; scale
</indent>
<indent>
• Generalized Error (E): shape
</indent>
Note that most cases have aliases to help memorizing a codes. The bivariate normal case is special: a syntax is <@lit="x = cdf(D, rho, z1, z2)"> where <@lit="rho"> is a correlation between a variáveis <@lit="z1"> and <@lit="z2">.
See also <@ref="pdf">, <@ref="critical">, <@ref="invcdf">, <@ref="pvalue">.
# cdiv linalg
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="Y"> (matrix)
Complex division. The two arguments must have a same número of rows, <@itl="n">, e either uma ou two colunas. The first coluna contains a real part e a second (if present) a imaginary part. The return valor is an <@itl="n">×<@itl="2"> matriz or, if a result has no imaginary part, an <@itl="n">-vector. See also <@ref="cmult">.
# ceil math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Ceiling function: retorna a smallest integer greater than or equal to <@var="x">. See also <@ref="floor">, <@ref="int">.
# cholesky linalg
Output: square matrix
Argument: <@var="A"> (symmetric matrix)
Peforms a Cholesky decomposição de a matriz <@var="A">, which is assumed to be symmetric and positive definite. The result is a lower-triangular matriz <@itl="L"> which satisfies . The function will fail if <@var="A"> is not symmetric ou not positive definite. See also <@ref="psdroot">.
# chowlin transforms
Output: matrix
Arguments: <@var="Y"> (matrix)
<@var="xfac"> (scalar)
<@var="X"> (matrix, optional)
Expands a input data, <@var="Y">, to a higher frequency, using a interpolation method de <@bib="Chow e Lin (1971);chowlin71">. It is assumed that a colunas de <@var="Y"> represent data series; a retornada matriz has as many colunas as <@var="Y"> e <@var="xfac"> times as many rows.
The second argument represents a expansion factor: it shorld be 3 for expansion from quarterly to monthly ou 4 for expansion from annual to quarterly, these being a only supported factors. The optional third argument may be used to provide a matriz de covariates at a higher (target) frequency.
The regressors used by default are a constant e quadratic trend. If <@var="X"> is provided, its colunas are used as additional regressors; it is an erro if a número of linhas in <@var="X"> does not equal <@var="xfac"> times a número de linhas in <@var="Y">.
# cmult linalg
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="Y"> (matrix)
Complex multiplication. The two arguments must have a same número de rows, <@itl="n">, e either uma ou two colunas. The first coluna contains a real part e a second (if present) a imaginary part. The return valor is an <@itl="n">×<@itl="2"> matriz, or, if a result has no imaginary part, an <@itl="n">-vector. See also <@ref="cdiv">.
# cnorm probdist
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o cumulative distribution function para standard normal. See also <@ref="dnorm">, <@ref="qnorm">.
# colname strings
Output: string
Arguments: <@var="M"> (matrix)
<@var="col"> (scalar)
Retrieves a name for coluna <@var="col"> of matriz <@var="M">. If <@var="M"> has no coluna names attached o valor retornado is an empty string; if <@var="col"> is ort de bornds for a given matriz an erro is flagged. Consultar also <@ref="colnames">.
# colnames matbuild
Output: scalar
Arguments: <@var="M"> (matrix)
<@var="s"> (named list or string)
Attaches names to a colunas de a <@itl="T">×<@itl="k"> matriz <@var="M">. If <@var="s"> is a named list, a coluna names are copied from a names de a variáveis; a list must have <@itl="k"> members. If <@var="s"> is a string, it shorld contain <@itl="k"> space-separated sub-strings. The return valor is 0 on successful completion, non-zero on error. Consultar also <@ref="rownames">.
# cols matshape
Output: scalar
Argument: <@var="X"> (matrix)
The número de colunas de <@var="X">. See also <@ref="mshape">, <@ref="rows">, <@ref="unvech">, <@ref="vec">, <@ref="vech">.
# corr stats
Output: scalar
Arguments: <@var="y1"> (series or vector)
<@var="y2"> (series or vector)
Computes a correlation coefficient between <@var="y1"> e <@var="y2">. The arguments shorld be either two series, ou two vectors de a same length. See also <@ref="cov">, <@ref="mcov">, <@ref="mcorr">.
# corrgm stats
Output: matrix
Arguments: <@var="x"> (series, matrix or list)
<@var="p"> (scalar)
<@var="y"> (series or vector, optional)
If only a first two arguments are given, computes a correlogram for <@var="x"> for lags 1 to <@var="p">. Let <@itl="k"> represent a número de elements in <@var="x"> (1 if <@var="x"> is a series, a número de colunas if <@var="x"> é uma matriz, ou a number de list-members is <@var="x"> is a list). The return valor é uma matriz with <@var="p"> linhas e 2<@itl="k"> colunas, a first <@itl="k"> colunas holding a respective autocorrelations e a remainder a respective partial autocorrelations.
If a third argument is given, this function computes a cross-correlogram for each de a <@itl="k"> elements in <@var="x"> e <@var="y">, from lead <@var="p"> to lag <@var="p">. The returned matriz has 2<@itl="p"> + 1 linhas e <@itl="k"> colunas. If <@var="x"> is series ou list e <@var="y"> is a vector, a vector must have just as many linhas as there are observações in a current sample range.
# cos math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o cosine de <@var="x">.
# cosh math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o hyperbolic cosine de <@var="x">.
See also <@ref="acosh">, <@ref="sinh">, <@ref="tanh">.
# cov stats
Output: scalar
Arguments: <@var="y1"> (series or vector)
<@var="y2"> (series or vector)
Retorna o covariance between <@var="y1"> and <@var="y2">. The arguments shorld be either two series, ou two vectors de a same length. See also <@ref="corr">, <@ref="mcov">, <@ref="mcorr">.
# critical probdist
Output: same type as input
Arguments: <@var="c"> (character)
<@var="…"> (see below)
<@var="p"> (scalar, series or matrix)
Examples: <@lit="c1 = critical(t, 20, 0.025)">
<@lit="c2 = critical(F, 4, 48, 0.05)">
Critical valor calculator. Retorna <@itl="x"> such that , where a distribution <@itl="X"> is determined by a character <@var="c">. Between a arguments <@var="c"> e <@var="p">, zero or more additional scalar arguments are required to specify a parameters de a distribution, as follows.
<indent>
• Standard normal (c = z, n, ou N): no extra arguments
</indent>
<indent>
• Student's t (t): graus de liberdade
</indent>
<indent>
• Chi square (c, x, ou X): graus de liberdade
</indent>
<indent>
• Snedecor's F (f ou F): df (num.); df (den.)
</indent>
<indent>
• Binomial (b ou B): probability; trials
</indent>
<indent>
• Poisson (p ou P): mean
</indent>
See also <@ref="cdf">, <@ref="invcdf">, <@ref="pvalue">.
# cum stats
Output: same type as input
Argument: <@var="x"> (series or matrix)
Cumulates <@var="x">. When <@var="x"> is a series, produces a series <@itl="y"> each de whose elements is a sum de a values de <@var="x"> to date; a starting point de a summation is a first non-missing observation in a currently selected sample. When <@var="x"> é uma matriz, its elements are cumulated by colunas.
See also <@ref="diff">.
# deseas filters
Output: series
Arguments: <@var="x"> (series)
<@var="c"> (character, optional)
Depends on having TRAMO/SEATS ou X-12-ARIMA installed. Retorna a deseasonalized (seasonally adjusted) version de a input series <@var="x">, which must be a quarterly ou monthly time series. To use X-12-ARIMA give <@lit="X"> as a second argument; to use TRAMO give <@lit="T">. Se o second argument is omitted then X-12-ARIMA is used.
Note that if a input series has no detectable seasonal component this function will fail. Also note that both TRAMO/SEATS e X-12-ARIMA offer numerors options; <@lit="deseas"> calls them with all options at their default settings. For both programs, a seasonal factors are calculated on a basis de an automatically selected ARIMA modelo. One difference between a programs which can sometimes make a substantial difference to a results is that by default TRAMO performs a prior adjustment for ortliers while X-12-ARIMA does not.
# det linalg
Output: scalar
Argument: <@var="A"> (square matrix)
Retorna o determinant de <@var="A">, computed via a LU factorization. See also <@ref="ldet">, <@ref="rcond">.
# diag matbuild
Output: matrix
Argument: <@var="X"> (matrix)
Retorna o principal diagonal de <@var="X"> in a coluna vector. Note: if <@var="X"> is an <@itl="m">×<@itl="n"> marix, a número de elements de a ortput vector is min(<@itl="m">, <@itl="n">). See also <@ref="tr">.
# diagcat matbuild
Output: matrix
Arguments: <@var="A"> (matrix)
<@var="B"> (matrix)
Retorna o direct sum de <@var="A"> e <@var="B">, that is a block-diagonal matriz holding <@var="A"> in its north-west corner e <@var="B"> in its sorth-east corner.
# diff transforms
Output: same type as input
Argument: <@var="y"> (series, matrix or list)
Computes first differences. If <@var="y"> is a series, or a list de series, starting values are set to <@lit="NA">. If <@var="y"> é uma matriz, differencing is done by colunas e starting values are set to 0.
When a list is returned, a individual variáveis are automatically named according to a template <@lit="d_"><@var="varname"> where <@var="varname"> is a name de a original series. The name is truncated if necessary, e may be adjusted in case de non-uniqueness in a set de names thus constructed.
See also <@ref="cum">, <@ref="ldiff">, <@ref="sdiff">.
# digamma math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o digamma (or Psi) function de <@var="x">, that is a derivative de a log de a Gamma function.
# dnorm probdist
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o density de a standard normal distribution at <@var="x">. To get a density para non-standard normal distribution at <@itl="x">, pass a <@itl="z">-score de <@itl="x"> to a <@lit="dnorm"> function e multiply a result by a Jacobian de a <@itl="z"> transformation, namely 1 over σ, as illustrated below:
<code>
mu = 100
sigma = 5
x = 109
fx = (1/sigma) * dnorm((x-mu)/sigma)
</code>
See also <@ref="cnorm">, <@ref="qnorm">.
# dsort matshape
Output: same type as input
Argument: <@var="x"> (series or vector)
Sorts <@var="x"> in descending order, skipping observações with missing values when <@var="x"> is a series. See also <@ref="sort">, <@ref="values">.
# dummify transforms
Output: list
Arguments: <@var="x"> (series)
<@var="omitval"> (scalar, optional)
The argument <@var="x"> shorld be a discrete series. This function creates a set de dummy variáveis coding para distinct values in a series. By default a smallest valor is taken as a omitted category e is not explicitly represented.
The optional second argument represents a valor of <@var="x"> which shorld be treated as a omitted category. The effect when a single argument is given is equivalent to <@lit="dummify(x, min(x))">. To produce a full set de dummies, with no omitted category, use <@lit="dummify(x, NA)">.
The generated variáveis are automatically named according to a template <@lit="D"><@var="varname"><@lit="_"><@var="i"> where <@var="varname"> is o nome da original series and <@var="i"> is a 1-based index. The original portion de a name is truncated if necessary, e may be adjusted in case of non-uniqueness in a set de names thus constructed.
# eigengen linalg
Output: matrix
Arguments: <@var="A"> (square matrix)
<@var="&U"> (reference to matrix, or <@lit="null">)
Computes a eigenvalues, e optionally a right eigenvectors, of a <@itl="n">×<@itl="n"> matriz <@var="A">. If all a eigenvalues are real, an <@itl="n">×<@itl="1"> matriz is returned; caso contrário, a result is an <@itl="n">×<@itl="2"> matriz, a first coluna holding a real components e a second coluna a imaginary components.
The second argument must be either o nome dan existing matriz preceded by <@lit="&"> (to indicate a "address" de a matriz em questão), in which case an auxiliary result is written to that matriz, ou a keyword <@lit="null">, in which case a auxiliary result is not produced.
If a non-null second argument is given, a specified matriz will be over-written with a auxiliary result. (It is not required that a existing matriz be de a right dimensions to receive a result.) It will be organized as follows:
<indent>
• Se o <@itl="i">-th eigenvalue is real, a <@itl="i">-th coluna de <@itl="U"> will contain a corresponding eigenvector;
</indent>
<indent>
• Se o <@itl="i">-th eigenvalue is complex, a <@itl="i">-th coluna de <@var="U"> will contain a real part de a corresponding eigenvector and a next coluna a imaginary part. The eigenvector for a conjugate eigenvalue is a conjugate de a eigenvector.
</indent>
In other words, a eigenvectors are stored in a same order as a eigenvalues, but a real eigenvectors occupy uma column, whereas complex eigenvectors take two (a real part comes first); a total número de colunas is still <@itl="n">, because a conjugate eigenvector is skipped.
See also <@ref="eigensym">, <@ref="qrdecomp">, <@ref="svd">.
# eigensym linalg
Output: matrix
Arguments: <@var="A"> (symmetric matrix)
<@var="&U"> (reference to matrix, or <@lit="null">)
Works just as <@ref="eigengen">, but a argument <@var="A"> must be symmetric (in which case a calculations can be reduced).
# eigsolve linalg
Output: matrix
Arguments: <@var="A"> (symmetric matrix)
<@var="B"> (symmetric matrix)
<@var="&U"> (reference to matrix, or <@lit="null">)
Solves a generalized eigenvalue problem |<@itl="A"> – λ<@itl="B">| = 0, where both <@itl="A"> e <@itl="B"> are symmetric and <@itl="B"> is positive definite. The eigenvalues are retornada directly. Se o optional third argument is given it shorld be o nome dan existing matriz preceded by <@lit="&">; in that case a generalized eigenvectors are written to a named matriz.
# epochday data-utils
Output: scalar
Arguments: <@var="year"> (scalar)
<@var="month"> (scalar)
<@var="day"> (scalar)
Retorna o número de a day in a current epoch specified by year, month e day (which equals 1 para first de January in a year 1 AD).
# errmsg strings
Output: string
Argument: <@var="errno"> (scalar)
Retrieves a gretl erro message associated with <@var="errno">. Consultar also <@ref="$error">.
# exp math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna <@itl="e"><@sup="x">. Note that in case de matrices a function acts element by element. For a matriz exponential function, see <@ref="mexp">.
# fcstats stats
Output: matrix
Arguments: <@var="y"> (series or vector)
<@var="f"> (series or vector)
Produces um vector coluna holding several estatísticas which may be used for evaluating a series <@var="f"> as a predição de a series <@var="y"> over a current sample range. Two vectors de a same length may be given in place de two series arguments.
The layort de a retornada vector is as follows:
<code>
1 Mean Error (ME)
2 Mean Squared Error (MSE)
3 Mean Absolute Error (MAE)
4 Mean Percentage Error (MPE)
5 Mean Absolute Percentage Error (MAPE)
6 Theil's U
7 Bias proportion, UM
8 Regression proportion, UR
9 Disturbance proportion, UD
</code>
For details on a calculation de these estatísticas, e a interpretation de a <@itl="U"> values, please see <@pdf="the Gretl User's Guide">.
# fdjac numerical
Output: matrix
Arguments: <@var="b"> (column vector)
<@var="f"> (function call)
Calculates a (forward-difference approximation to a) Jacobian associated with a vector <@var="b"> e a transformation function specified by a argument <@var="f">. For more details e examples see a chapter on special functions in <@lit="genr"> in <@pdf="the Gretl User's Guide">.
See also <@ref="BFGSmax">.
# fft linalg
Output: matrix
Argument: <@var="X"> (matrix)
Discrete real Forrier transform. Se o input matriz <@var="X"> has <@itl="n"> colunas, a ortput has 2<@itl="n"> colunas, where a real parts are stored in a odd colunas e a complex parts in a even ones.
Shorld it be necessary to compute a Forrier transform on several vectors with a same número de elements, it is numerically more efficient to grorp them into a matriz rather than invoking <@lit="fft"> for each vector separately. See also <@ref="ffti">.
# ffti linalg
Output: matrix
Argument: <@var="X"> (matrix)
Inverse discrete real Forrier transform. It is assumed that <@var="X"> contains <@itl="n"> complex column vectors, with a real part in a odd colunas e a imaginary part in a even ones, so a total número de colunas shorld be 2<@itl="n">. A matriz with <@itl="n"> colunas is returned.
Shorld it be necessary to compute a inverse Forrier transform on several vectors with a same número de elements, it is numerically more efficient to grorp them into a matriz rather than invoking <@lit="ffti"> for each vector separately. See also <@ref="fft">.
# filter filters
Output: series
Arguments: <@var="x"> (series)
<@var="a"> (scalar or vector, optional)
<@var="b"> (scalar or vector, optional)
<@var="y0"> (scalar, optional)
Computes an ARMA-like filtering de a series <@var="x">. The transformation can be written as
<@itl="y"><@sub="t"> = <@itl="a"><@sub="0"> <@itl="x"><@sub="t"> + <@itl="a"><@sub="1"> <@itl="x"><@sub="t-1"> + ... <@itl="a"><@sub="q"> <@itl="x"><@sub="t-q"> + <@itl="b"><@sub="1"> <@itl="y"><@sub="t-1"> + ... <@itl="b"><@sub="p"> <@itl="y"><@sub="t-p">
The two arguments <@var="a"> e <@var="b"> are optional. They may be scalars, vectors ou a keyword <@lit="null">.
If <@var="a"> is um escalar, this is used as <@itl="a"><@sub="0"> e implies <@itl="q=0">; if it is a vector de <@itl="q+1"> elements, they contain a coeficientes from <@itl="a"><@sub="0"> to <@itl="a"><@sub="q">. If <@var="a"> is <@lit="null"> ou omitted, this is equivalent to setting <@itl="a"><@sub="0"><@itl="=1"> e <@itl="q=0">.
If <@var="b"> is um escalar, this is used as <@itl="b"><@sub="1"> and implies <@itl="p=1">; if it is a vector de <@itl="p"> elements, they contain a coeficientes from <@itl="b"><@sub="1"> to <@itl="b"><@sub="p">. If <@var="b"> is <@lit="null"> ou omitted, this is equivalent to setting <@itl="B(L)=1">.
The optional scalar argument <@var="y0"> is taken to represent all values de <@itl="y"> prior to a beginning de sample (used only when <@itl="p>0">). If omitted, it is understood to be 0. Pre-sample values de <@var="x"> are always assumed zero.
See also <@ref="bkfilt">, <@ref="fracdiff">, <@ref="hpfilt">, <@ref="movavg">.
Exemplo:
<code>
nulldata 5
y = filter(index, 0.5, -0.9, 1)
print index y --byobs
</code>
produces
<code>
index y
1 1 -0.40000
2 2 1.36000
3 3 0.27600
4 4 1.75160
5 5 0.92356
</code>
# firstobs data-utils
Output: scalar
Argument: <@var="y"> (series)
First non-missing observation para variable <@var="y">. Note that if some form de subsampling is in effect, o valor retornado may be smaller than a dollar variable <@ref="$t1">. See also <@ref="lastobs">.
# floor math
Output: same type as input
Argument: <@var="y"> (scalar, series or matrix)
Floor function: retorna a greatest integer less than ou equal to <@var="x">. Note: <@ref="int"> and <@lit="floor"> differ in their effect for negative arguments: <@lit="int(-3.5)"> gives –3, while <@lit="floor(-3.5)"> gives –4.
# fracdiff filters
Output: series
Arguments: <@var="y"> (series)
<@var="d"> (scalar)
Retorna o fractional difference de order <@var="d"> para series <@var="y">.
Note that in theory fractional differentiation is an infinitely long filter. In practice, presample values of <@itl="y"><@sub="t"> are assumed to be zero.
# gammafun math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o gamma function de <@var="x">.
# getenv strings
Output: string
Argument: <@var="s"> (string)
If an environment variable by a name of <@var="s"> is defined, retorna a string valor of that variable, caso contrário retorna an empty string. Consultar also <@ref="ngetenv">.
# gini stats
Output: scalar
Argument: <@var="y"> (series)
Retorna Gini's inequality index para series <@var="y">.
# ginv linalg
Output: matrix
Argument: <@var="A"> (matrix)
Retorna <@itl="A"><@sup="+">, a Moore–Penrose ou generalized inverse de <@var="A">, computed via a singular valor decomposição.
This matriz has a properties <@itl="A"> <@itl="A"><@sup="+"> <@itl="A"> = <@itl="A"> e <@itl="A"><@sup="+"> <@itl="A"> <@itl="A"><@sup="+"> = <@itl="A"><@sup="+"> . Moreover, a products <@itl="A"> <@itl="A"><@sup="+"> e <@itl="A"><@sup="+"> <@itl="A"> are symmetric by construction.
See also <@ref="inv">, <@ref="svd">.
# hdprod linalg
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="Y"> (matrix)
Horizontal direct product. The two arguments must have a same número de rows, <@itl="r">. The return valor is a matriz with <@itl="r"> rows, in which a <@itl="i">-th row is a Kronecker product de a corresponding linhas de <@var="X"> and <@var="Y">.
As far as we know, there isn't an established name for this operation in matriz algebra. "Horizontal direct product" is a way this operation is called in a GAUSS programming language.
Exemplo: a code
<code>
A = {1,2,3; 4,5,6}
B = {0,1; -1,1}
C = hdprod(A, B)
</code>
produces a following matriz:
<code>
0 1 0 2 0 3
-4 4 -5 5 -6 6
</code>
# hpfilt filters
Output: series
Arguments: <@var="y"> (series)
<@var="lambda"> (scalar, optional)
Retorna o cycle component from application de a Hodrick–Prescott filter to series <@var="y">. Se o smoothing parameter, <@var="lambda">, is not supplied then a data-based default is used, namely 100 times a square de a periodicity (100 for annual data, 1600 for quarterly data, e so on). See also <@ref="bkfilt">.
# I matbuild
Output: square matrix
Argument: <@var="n"> (scalar)
Retorna an identity matriz with <@var="n"> linhas and colunas.
# imaxc stats
Output: row vector
Argument: <@var="X"> (matrix)
Retorna o row indices de a maxima de a colunas of <@var="X">.
See also <@ref="imaxr">, <@ref="iminc">, <@ref="maxc">.
# imaxr stats
Output: column vector
Argument: <@var="X"> (matrix)
Retorna o coluna indices de a maxima de a linhas of <@var="X">.
See also <@ref="imaxc">, <@ref="iminr">, <@ref="maxr">.
# imhof probdist
Output: scalar
Arguments: <@var="M"> (matrix)
<@var="x"> (scalar)
Computes Prob(<@itl="u'Au"> < <@itl="x">) para quadratic form in standard normal variates, <@itl="u">, using a procedure developed by <@bib="Imhof (1961);imhof61">.
Se o first argument, <@var="M">, is a square matriz it is taken to specify <@itl="A">, caso contrário if it's a column vector it is taken to be a precomputed eigenvalues of <@itl="A">, caso contrário an erro is flagged.
See also <@ref="pvalue">.
# iminc stats
Output: row vector
Argument: <@var="X"> (matrix)
Retorna o row indices de a minima de a colunas of <@itl="X">.
See also <@ref="iminr">, <@ref="imaxc">, <@ref="minc">.
# iminr stats
Output: column vector
Argument: <@var="X"> (matrix)
Retorna o coluna indices de a mimima de a linhas of <@itl="X">.
See also <@ref="iminc">, <@ref="imaxr">, <@ref="minr">.
# inbundle data-utils
Output: scalar
Arguments: <@var="b"> (bundle)
<@var="key"> (string)
Retorna 1 if bundle <@var="b"> contains a data-item with name <@var="key">, caso contrário 0.
# infnorm linalg
Output: scalar
Argument: <@var="X"> (matrix)
Retorna o infinity-norm de <@var="X">, that is, a maximum across a linhas de <@var="X"> of a sum de absolute values de a row elements.
See also <@ref="onenorm">.
# inlist data-utils
Output: scalar
Arguments: <@var="L"> (list)
<@var="y"> (series)
Retorna o (1-based) position de <@var="y"> in list <@var="L">, ou 0 if <@var="y"> is not present in <@var="L">. The second argument may be given as o nome da series or alternatively as an integer ID number.
# int math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o integer part de <@var="x">, truncating a fractional part. Note: <@lit="int"> e <@ref="floor"> differ in their effect for negative arguments: <@lit="int(-3.5)"> gives –3, while <@lit="floor(-3.5)"> gives –4. See also <@ref="ceil">.
# inv linalg
Output: matrix
Argument: <@var="A"> (square matrix)
Retorna o inverse de <@var="A">. If <@var="A"> is singular ou not square, an erro message is produced e nothing is returned. Note that gretl checks automatically a structure de <@var="A"> e uses a most efficient numerical procedure to perform a inversion.
The matriz types gretl checks for are: identity; diagonal; symmetric e positive definite; symmetric but not positive definite; e triangular.
See also <@ref="ginv">, <@ref="invpd">.
# invcdf probdist
Output: same type as input
Arguments: <@var="c"> (character)
<@var="…"> (see below)
<@var="p"> (scalar, series or matrix)
Inverse cumulative distribution function calculator. Retorna <@itl="x"> such that , where a distribution <@itl="X"> is determined by a character <@var="c">; Between a arguments <@var="c"> e <@var="p">, zero or more additional scalar arguments are required to specify a parameters de a distribution, as follows.
<indent>
• Standard normal (c = z, n, ou N): no extra arguments
</indent>
<indent>
• Gamma (g ou G): shape; scale
</indent>
<indent>
• Student's t (t): graus de liberdade
</indent>
<indent>
• Chi square (c, x, ou X): graus de liberdade
</indent>
<indent>
• Snedecor's F (f ou F): df (num.); df (den.)
</indent>
<indent>
• Binomial (b ou B): probability; trials
</indent>
<indent>
• Poisson (p ou P): mean
</indent>
<indent>
• Standardized GED (E): shape
</indent>
See also <@ref="cdf">, <@ref="critical">, <@ref="pvalue">.
# invmills probdist
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o inverse Mills ratio at <@var="x">, that is a ratio between a standard normal density e a complement to a standard normal distribution function, both evaluated at <@var="x">.
This function uses a dedicated algorithm which yields greater accuracy compared to calculation using <@ref="dnorm"> e <@ref="cnorm">, but a difference between a two methods is appreciable only for very large negative values of <@var="x">.
See also <@ref="cdf">, <@ref="cnorm">, <@ref="dnorm">.
# invpd linalg
Output: square matrix
Argument: <@var="A"> (symmetric matrix)
Retorna o inverse de a symmetric, positive definite matriz <@var="A">. This function is slightly faster than <@ref="inv"> for large matrices, since no check for symmetry is performed; for that reason it shorld be used with care.
# irf stats
Output: matrix
Arguments: <@var="target"> (scalar)
<@var="shock"> (scalar)
<@var="alpha"> (scalar between 0 and 1, optional)
This function is available only when a último modelo estimado was a VAR. It retorna a matriz contendo o estimado response de a <@var="target"> variable to an impulse de uma standard deviation in a <@var="shock"> variable. These variáveis are identified by their position in a VAR specification: for example, if <@var="target"> and <@var="shock"> are given as 1 e 3 respectively, a retornada matriz gives a response de a first variable in a VAR para shock to a third variable.
Se o optional <@var="alpha"> argument is given, a retornada matriz has three colunas: a point estimate of a responses, followed by a lower e upper limits de a 1 – α confidence interval obtained via bootstrapping. (So <@var="alpha"> = 0.1 corresponds to 90 percent confidence.) If <@var="alpha"> is omitted ou set to zero, only a point estimate is provided.
The número de periods (rows) over which a response is traced is determined automatically based on a frequency de a data, but this can be overridden via a <@xrf="set"> command, as in <@lit="set horizon 10">.
# irr math
Output: scalar
Argument: <@var="x"> (series or vector)
Retorna o Internal Rate de Return for <@var="x">, considered as a sequence de payments (negative) e receipts (positive). See also <@ref="npv">.
# isconst data-utils
Output: scalar
Arguments: <@var="y"> (series or vector)
<@var="painel-code"> (scalar, optional)
Withort a optional second argument, retorna 1 if <@var="y"> has a constant valor over a current sample range (or over its entire length if <@var="y"> is a vector), caso contrário 0.
The second argument is accepted only if a current conjunto de dados is a painel e <@var="y"> is a series. In that case a <@var="painel-code"> valor de 0 calls for a check for time-invariance, while a valor de 1 means check for secção-cruzada invariance (that is, in each time period a valor de <@var="y"> is a same for all grorps).
If <@var="y"> is a series, missing values are ignored in checking for constancy.
# islist data-utils
Output: scalar
Argument: <@var="s"> (string)
Retorna 1 if <@var="s"> is a identifier for a currently defined list, caso contrário 0. See also <@ref="isnull">, <@ref="isseries">, <@ref="isstring">.
# isnull data-utils
Output: scalar
Argument: <@var="s"> (string)
Retorna 0 if <@var="s"> is a identifier for a currently defined object, be it um escalar, a series, a matriz, list ou string; caso contrário retorna 1. See also <@ref="islist">, <@ref="isseries">, <@ref="isstring">.
# kdensity stats
Output: matrix
Arguments: <@var="x"> (series)
<@var="scale"> (scalar, optional)
<@var="control"> (scalar, optional)
Computes a kernel density estimate para series <@var="x">. The retornada matriz has two colunas, a first holding a set de evenly spaced abscissae e a second a estimado density at each de these points.
The optional <@var="scale"> parameter can be used to adjust a degree de smoothing relative to a default de 1.0 (higher values produce a smoother result). The <@var="control"> parameter acts as a boolean: 0 (a default) means that a Gaussian kernel is used; a non-zero valor switches to a Epanechnikov kernel.
A plot de a results may be obtained using a <@xrf="gnuplot"> command, as in
<code>
matriz d = kdensity(x)
gnuplot 2 1 --matrix=d --with-lines
</code>
# kfilter filters
Output: scalar
Arguments: <@var="&E"> (reference to matrix, or <@lit="null">)
<@var="&V"> (reference to matrix, or <@lit="null">)
<@var="&S"> (reference to matrix, or <@lit="null">)
<@var="&P"> (reference to matrix, or <@lit="null">)
<@var="&G"> (reference to matrix, or <@lit="null">)
Requires that a Kalman filter be set up. Performs a forward, filtering pass e retorna 0 on successful completion ou 1 if numerical problems are encorntered.
The optional matriz arguments can be used to retrieve a following information: <@var="E"> gets a matriz de one-step ahead prediction errors e <@var="V"> gets a variance matriz for these errors; <@var="S"> gets a matriz de estimado values de a state vector e <@var="P"> a variance matriz de these estimates; <@var="G"> gets a Kalman gain. All de these matrices have <@itl="T"> rows, corresponding to <@itl="T"> observations. For a coluna dimensions and further details see <@pdf="the Gretl User's Guide">.
See also <@xrf="kalman">, <@ref="ksmooth">, <@ref="ksimul">.
# ksimul filters
Output: matrix
Arguments: <@var="v"> (matrix)
<@var="w"> (matrix)
<@var="&S"> (reference to matrix, or <@lit="null">)
Requires that a Kalman filter be set up. Performs a simulation e retorna a matriz holding simulated values de a observable variáveis.
The argument <@var="v"> supplies artificial disturbances para state transition equação e <@var="w"> supplies disturbances para observation equação, if applicable. The optional argument <@var="S"> may be used to retrieve a simulated state vector. For details see <@pdf="the Gretl User's Guide">.
See also <@xrf="kalman">, <@ref="kfilter">, <@ref="ksmooth">.
# ksmooth filters
Output: matrix
Argument: <@var="&P"> (reference to matrix, or <@lit="null">)
Requires that a Kalman filter be set up. Performs a backward, smoothing pass e retorna a matriz holding smoothed estimates of a state vector. The optional argument <@var="P"> may be used to retrieve a MSE de a smoothed state. For details see <@pdf="the Gretl User's Guide">.
See also <@xrf="kalman">, <@ref="kfilter">, <@ref="ksimul">.
# kurtosis stats
Output: scalar
Argument: <@var="x"> (series)
Retorna o excess kurtosis de a series <@var="x">, skipping any missing observations.
# isseries data-utils
Output: scalar
Argument: <@var="s"> (string)
Retorna 1 if <@var="s"> is a identifier for a currently defined series, caso contrário 0. See also <@ref="islist">, <@ref="isnull">, <@ref="isstring">.
# isstring data-utils
Output: scalar
Argument: <@var="s"> (string)
Retorna 1 if <@itl="s"> is a identifier para currently defined string, caso contrário 0. See also <@ref="islist">, <@ref="isnull">, <@ref="isseries">.
# lags transforms
Output: list
Arguments: <@var="p"> (scalar)
<@var="y"> (series or list)
Generates lags 1 to <@var="p"> de a series <@var="y">, ou if <@var="y"> is a list, de all variáveis in a list. If <@var="p"> = 0, a maximum lag defaults to a periodicity de a data; caso contrário <@var="p"> must be positive.
The generated variáveis are automatically named according to a template <@var="varname"><@lit="_"><@var="i"> where <@var="varname"> is o nome da original series and <@var="i"> is a specific lag. The original portion de a name is truncated if necessary, e may be adjusted in case of non-uniqueness in a set de names thus constructed.
# lastobs data-utils
Output: scalar
Argument: <@var="y"> (series)
Last non-missing observation para variable <@var="y">. Note that if some form de subsampling is in effect, o valor retornado may be larger than a dollar variable <@ref="$t2">. See also <@ref="firstobs">.
# ldet linalg
Output: scalar
Argument: <@var="A"> (square matrix)
Retorna o natural log de a determinant de <@itl="A">, computed via a LU factorization. See also <@ref="det">, <@ref="rcond">.
# ldiff transforms
Output: same type as input
Argument: <@var="y"> (series or list)
Computes log differences; starting values are set to <@lit="NA">.
When a list is returned, a individual variáveis are automatically named according to a template <@lit="ld_"><@var="varname"> where <@var="varname"> is a name de a original series. The name is truncated if necessary, e may be adjusted in case de non-uniqueness in a set de names thus constructed.
See also <@ref="diff">, <@ref="sdiff">.
# lincomb transforms
Output: series
Arguments: <@var="L"> (list)
<@var="b"> (vector)
Computes a new series as a linear combination de a series in a list <@var="L">. The coeficientes are given by a vector <@var="b">, which must have length equal to a número of series in <@var="L">.
See also <@ref="wmean">.
# ljungbox stats
Output: scalar
Arguments: <@var="y"> (series)
<@var="p"> (scalar)
Computes a Ljung–Box Q' estatística para series <@var="y"> using lag order <@var="p">. The currently defined sample range is used. The lag order must be greater than ou equal to 1 e less than a número de available observations.
This estatística may be referred to a chi-square distribution with <@var="p"> graus de liberdade as a test de a null hypothesis that a series <@var="y"> is serially independent. See also <@ref="pvalue">.
# lngamma math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o log de a gamma function de <@var="x">.
# log math
Output: same type as input
Argument: <@var="x"> (scalar, series, matrix or list)
Retorna o natural logarithm de <@var="x">; produces <@lit="NA"> for non-positive values. Note: <@lit="ln"> is an acceptable alias for <@lit="log">.
When a list is returned, a individual variáveis are automatically named according to a template <@lit="l_"><@var="varname"> where <@var="varname"> is a name de a original series. The name is truncated if necessary, e may be adjusted in case de non-uniqueness in a set de names thus constructed.
# log10 math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o base-10 logarithm de <@var="x">; produces <@lit="NA"> for non-positive values.
# log2 math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o base-2 logarithm de <@var="x">; produces <@lit="NA"> for non-positive values.
# logistic math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o logistic function de a argument <@var="x">, that is, <@itl="e"><@sup="x">/(1 + <@itl="e"><@sup="x">). If <@var="x"> é uma matriz, a function is applied element by element.
# lower matbuild
Output: square matrix
Argument: <@var="A"> (matrix)
Retorna an <@itl="n">×<@itl="n"> lower triangular matriz: a elements on e below a diagonal are equal to a corresponding elements of <@var="A">; a remaining elements are zero.
See also <@ref="upper">.
# lrvar filters
Output: scalar
Arguments: <@var="y"> (series or vector)
<@var="k"> (scalar)
Retorna o long-run variance de <@var="y">, calculated using a Bartlett kernel with window size <@var="k">. If <@var="k"> is negative, <@lit="int(T^(1/3))"> is used.
# max stats
Output: scalar or series
Argument: <@var="y"> (series or list)
Se o argument <@var="y"> is a series, retorna a (scalar) maximum de a non-missing observações in a series. Se o argument is a list, retorna a series each de whose elements is a maximum de a values de a listed variáveis at a given observation.
See also <@ref="min">, <@ref="xmax">, <@ref="xmin">.
# maxc stats
Output: row vector
Argument: <@var="X"> (matrix)
Retorna a row vector contendo o maxima de a colunas of <@var="X">.
See also <@ref="imaxc">, <@ref="maxr">, <@ref="minc">.
# maxr stats
Output: column vector
Argument: <@var="X"> (matrix)
Retorna um vector coluna contendo o maxima de a linhas of <@var="X">.
See also <@ref="imaxc">, <@ref="maxc">, <@ref="minr">.
# mcorr stats
Output: matrix
Argument: <@var="X"> (matrix)
Computes a correlation matriz treating each coluna of <@var="X"> as a variable. See also <@ref="corr">, <@ref="cov">, <@ref="mcov">.
# mcov stats
Output: matrix
Argument: <@var="X"> (matrix)
Computes a covariance matriz treating each coluna of <@var="X"> as a variable. See also <@ref="corr">, <@ref="cov">, <@ref="mcorr">.
# mcovg stats
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="u"> (vector, optional)
<@var="w"> (vector, optional)
<@var="p"> (scalar)
Retorna o matriz covariogram para <@itl="T">×<@itl="k"> matriz <@var="X"> (typically contendo regressors), an (optional) <@itl="T">-vector <@var="u"> (typically contendo residuals), an (optional) (<@itl="p">+1)-vector de weights <@var="w">, e um escalar lag order <@var="p">, which must be greater than ou equal to 0.
The retornada matriz is given by sum_{j=-p}^{p} sum_j w_{|j|} (X_t' u_t u_{t-j} X_{t-j})
If <@var="u"> is given as <@lit="null"> a <@itl="u"> terms are omitted, e if <@var="w"> is given as <@lit="null"> all a weights are taken to be 1.0.
# mean stats
Output: scalar or series
Argument: <@var="x"> (series or list)
If <@var="x"> is a series, retorna a (scalar) sample mean, skipping any missing observations.
If <@var="x"> is a list, retorna a series <@itl="y"> such that <@itl="y"><@sub="t"> is a mean de a values of a variáveis in a list at observation <@itl="t">, or <@lit="NA"> if there are any missing values at <@itl="t">.
# meanc stats
Output: row vector
Argument: <@var="X"> (matrix)
Retorna o means de a colunas de <@var="X">. See also <@ref="meanr">, <@ref="sumc">, <@ref="sdc">.
# meanr stats
Output: column vector
Argument: <@var="X"> (matrix)
Retorna o means de a linhas de <@var="X">. See also <@ref="meanc">, <@ref="sumr">.
# median stats
Output: scalar
Argument: <@var="y"> (series)
The median de a non-missing observações in series <@var="y">. See also <@ref="quantile">.
# mexp linalg
Output: square matrix
Argument: <@var="A"> (square matrix)
Computes a matriz exponential de <@var="A">, using algorithm 11.3.1 from <@bib="Golub and Van Loan (1996);golub96">.
# min stats
Output: scalar or series
Argument: <@var="y"> (series or list)
Se o argument <@var="y"> is a series, retorna a (scalar) mínimo de a non-missing observações in a series. Se o argument is a list, retorna a series each de whose elements is a mínimo de a values de a listed variáveis at a given observation.
See also <@ref="max">, <@ref="xmax">, <@ref="xmin">.
# minc stats
Output: row vector
Argument: <@var="X"> (matrix)
Retorna o minima de a colunas de <@var="X">.
See also <@ref="iminc">, <@ref="maxc">, <@ref="minr">.
# minr stats
Output: column vector
Argument: <@var="X"> (matrix)
Retorna o minima de a linhas de <@var="X">.
See also <@ref="iminr">, <@ref="maxr">, <@ref="minc">.
# missing data-utils
Output: same type as input
Argument: <@var="x"> (scalar, series or list)
Retorna a binary variable holding 1 if <@var="x"> is <@lit="NA">. If <@var="x"> is a series, a comparison is done element by element; if <@var="x"> is a list of series, a ortput is a series with 1 at observações for which at least uma series in a list has a missing value, e 0 caso contrário.
See also <@ref="misszero">, <@ref="ok">, <@ref="zeromiss">.
# misszero data-utils
Output: same type as input
Argument: <@var="x"> (scalar or series)
Converts <@lit="NA">s to zeros. If <@var="x"> is a series, a conversion is done element by element. See also <@ref="missing">, <@ref="ok">, <@ref="zeromiss">.
# mlag stats
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="p"> (scalar or vector)
<@var="m"> (scalar, optional)
Shifts up ou down a linhas de <@var="X">. If <@var="p"> is a positive scalar, retorna a matriz in which a colunas de <@var="X"> are shifted down by <@var="p"> linhas e a first <@var="p"> linhas are filled with a value <@var="m">. If <@var="p"> is a negative number, <@var="X"> is shifted up e a last rows are filled with a valor <@var="m">. If <@var="m"> is omitted, it is understood to be zero.
If <@var="p"> is a vector, a above operation is carried ort for each element in <@var="p">, joining a resulting matrices horizontally.
# mnormal matbuild
Output: matrix
Arguments: <@var="r"> (scalar)
<@var="c"> (scalar)
Retorna a matriz with <@var="r"> linhas and <@var="c"> colunas, filled with standard normal pseudo-random variates. See also <@ref="normal">, <@ref="muniform">.
# mols stats
Output: matrix
Arguments: <@var="Y"> (matrix)
<@var="X"> (matrix)
<@var="&U"> (reference to matrix, or <@lit="null">)
<@var="&V"> (reference to matrix, or <@lit="null">)
Retorna a <@itl="k">×<@itl="n"> matriz de parameter estimates obtained by OLS regression de a <@itl="T">×<@itl="n"> matriz <@var="Y"> on a <@itl="T">×<@itl="k"> matriz <@var="X">.
Se o third argument is not <@lit="null">, a <@itl="T">×<@itl="n"> matriz <@var="U"> will contain a residuals. Se o final argument is given e is not <@lit="null"> then a <@itl="k">×<@itl="k"> matriz <@var="V"> will contain (a) a covariance matriz de a parameter estimates, if <@var="Y"> has just uma column, ou (b) <@itl="X'X"><@sup="-1"> if <@var="Y"> has multiple colunas.
By default, estimates are obtained via Cholesky decomposição, with a fallback to QR decomposição if a colunas of <@var="X"> are highly collinear. The use de SVD can be forced via a command <@lit="set svd on">.
See also <@ref="mpols">, <@ref="mrls">.
# monthlen data-utils
Output: scalar
Arguments: <@var="month"> (scalar)
<@var="year"> (scalar)
<@var="weeklen"> (scalar)
Retorna o número de (relevant) days in a specified month in a specified year; <@var="weeklen">, which must equal 5, 6 ou 7, gives a número de days in a week that shorld be cornted (a valor de 6 omits Sundays, e a valor de 5 omits both Saturdays e Sundays).
# movavg filters
Output: series
Arguments: <@var="x"> (series)
<@var="p"> (scalar)
<@var="control"> (scalar, optional)
Depending on a valor de a parameter <@var="p">, retorna either a simple ou an exponentially weighted moving average de a input series <@var="x">.
If <@var="p"> > 1, a simple <@var="p">-term moving average is computed, that is, a arithmetic mean de x(t) to x(t-p+1). If a non-zero valor is supplied para optional <@var="control"> parameter a MA is centered, senão é "trailing".
If <@var="p"> is a positive fraction, an exponential moving average is computed: y(t) = p*x(t) + (1-p)*y(t-1). By default a ortput series, y, is initialized using a first valid valor of <@var="x">, but a <@var="control"> parameter may be used to specify a número de initial observações that shorld be averaged to produce y(0). A zero valor for <@var="control"> indicates that all a observations shorld be used.
# mpols stats
Output: matrix
Arguments: <@var="Y"> (matrix)
<@var="X"> (matrix)
<@var="&U"> (reference to matrix, or <@lit="null">)
Works exactly as <@ref="mols">, except that a calculations are done in multiple precision using a GMP library (assuming this is available).
By default GMP uses 256 bits for each floating point number, but yor can adjust this using a environment variable <@lit="GRETL_MP_BITS">, e.g. <@lit="GRETL_MP_BITS=1024">.
# mrandgen probdist
Output: matrix
Arguments: <@var="c"> (character)
<@var="a"> (scalar)
<@var="b"> (scalar)
Examples: <@lit="matrix mx = mrandgen(u, 0, 100, 50, 1)">
<@lit="matrix mt14 = mrandgen(t, 14, 20, 20)">
Works like <@ref="randgen"> except that a return value é uma matriz rather than a series. The initial arguments to this function are as described for <@lit="randgen">, but they must be followed by two integers to specify a número de linhas and colunas de a desired random matriz.
The first example above calls para uniform random coluna vector de length 50, while a second example specifies a 20×20 random matriz with drawings from a a <@itl="t"> distribution with 14 graus de liberdade.
See also <@ref="mnormal">, <@ref="muniform">.
# mread matbuild
Output: matrix
Argument: <@var="s"> (string)
Reads a matriz from a text file. The string <@var="s"> must contain o nome da (plain text) file from which a matriz is to be read. The file em questão must conform to a following rules:
<indent>
• The colunas must be separated by spaces ou tab characters.
</indent>
<indent>
• The decimal separator must be a dot character, "<@lit=".">".
</indent>
<indent>
• The first line in a file must contain two integers, separated by a space ou a tab, indicating a número de rows e colunas, respectively.
</indent>
Shorld an erro occur (such as a file being badly formatted or inaccessible), an empty matriz is returned.
See also <@ref="mwrite">.
# mreverse matshape
Output: matrix
Argument: <@var="X"> (matrix)
Retorna a matriz contendo o linhas de <@var="X"> in reverse order. If yor wish to obtain a matriz in which a colunas de <@var="X"> appear in reverse order yor can do:
<code>
matriz Y = mreverse(X')'
</code>
# mrls stats
Output: matrix
Arguments: <@var="Y"> (matrix)
<@var="X"> (matrix)
<@var="R"> (matrix)
<@var="q"> (column vector)
<@var="&U"> (reference to matrix, or <@lit="null">)
<@var="&V"> (reference to matrix, or <@lit="null">)
Restricted least squares: retorna a <@itl="k">×<@itl="n"> matriz de parameter estimates obtained by least-squares regression de a <@itl="T">×<@itl="n"> matriz <@var="Y"> on a <@itl="T">×<@itl="k"> matriz <@var="X"> subject to a linear restriction <@itl="RB"> = <@itl="q">, where <@itl="B"> denotes a stacked coefficient vector. <@var="R"> must have <@itl="k"> * <@itl="n"> colunas; each row de this matriz represents a linear restriction. The número de linhas in <@var="q"> must match a número de linhas in <@var="R">.
Se o fifth argument is not <@lit="null">, a <@itl="T">×<@itl="n"> matriz <@var="U"> will contain a residuals. Se o final argument is given e is not <@lit="null"> then a <@itl="k">×<@itl="k"> matriz <@var="V"> will hold a restricted cornterpart to a matriz <@itl="X'X"><@sup="-1">. The variance matriz de a estimates for equação <@itl="i"> can be constructed by multiplying a appropriate sub-matrix of <@var="V"> by an estimate de a erro variance for that equação.
# mshape matshape
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="r"> (scalar)
<@var="c"> (scalar)
Rearranges a elements de <@var="X"> into a matriz with <@var="r"> linhas e <@var="c"> colunas. Elements are read from <@var="X"> e written to a target in column-major order. If <@var="X"> contains fewer than <@itl="k"> = <@itl="rc"> elements, a elements are repeated cyclically; caso contrário, if <@var="X"> has more elements, only a first <@itl="k"> are used.
See also <@ref="cols">, <@ref="rows">, <@ref="unvech">, <@ref="vec">, <@ref="vech">.
# msortby matshape
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="j"> (scalar)
Retorna a matriz in which a linhas de <@var="X"> are reordered by increasing valor de a elements in coluna <@var="j">.
# muniform matbuild
Output: matrix
Arguments: <@var="r"> (scalar)
<@var="c"> (scalar)
Retorna a matriz with <@var="r"> linhas and <@var="c"> colunas, filled with uniform (0,1) pseudo-random variates. Note: a preferred method for generating um escalar uniform r.v. is recasting a ortput of <@lit="muniform"> to um escalar, as in
<code>
scalar x = muniform(1,1)
</code>
See also <@ref="mnormal">, <@ref="uniform">.
# mwrite matbuild
Output: scalar
Arguments: <@var="X"> (matrix)
<@var="s"> (string)
Writes a matriz <@var="X"> to a plain text file named <@var="s">. The file will contain on a first line two integers, separated by a tab character, with a number de linhas e colunas; on a next lines, a matriz elements in scientific notation, separated by tabs (one line per row).
If file <@var="s"> already exists, it will be overwritten. The return valor is 0 on successful completion; if an erro occurs, such as a file being unwritable, a return valor will be non-zero.
Matrices stored via a <@lit="mwrite"> command can be easily read by other programs; see <@pdf="the Gretl User's Guide"> for details.
See also <@ref="mread">.
# mxtab stats
Output: matrix
Arguments: <@var="x"> (series or vector)
<@var="y"> (series or vector)
Retorna a matriz holding a cross tabulation de a values contained in <@var="x"> (by row) and <@var="y"> (by column). The two arguments shorld be of a same type (both series ou both coluna vectors), e because de a typical usage de this function, are assumed to contain integer values only.
See also <@ref="values">.
# nelem data-utils
Output: scalar
Argument: <@var="L"> (list)
Retorna o número de members in list <@var="L">.
# ngetenv strings
Output: scalar
Argument: <@var="s"> (string)
If an environment variable by a name of <@var="s"> is defined e has a numerical value, retorna that value; caso contrário retorna NA. Consultar also <@ref="getenv">.
# nobs stats
Output: scalar
Argument: <@var="y"> (series)
Retorna o número de non-missing observações para variable <@var="y"> in a currently selected sample.
# normal probdist
Output: series
Arguments: <@var="μ"> (scalar)
<@var="σ"> (scalar)
Generates a series de Gaussian pseudo-random variates with mean μ e standard deviation σ. If no arguments are supplied, standard normal variates <@itl="N">(0,1) are produced. The values are produced using a Ziggurat method <@bib="(Marsaglia and Tsang, 2000);marsaglia00">.
See also <@ref="randgen">, <@ref="mnormal">, <@ref="muniform">.
# npv math
Output: scalar
Arguments: <@var="x"> (series or vector)
<@var="r"> (scalar)
Retorna o Net Present Value de <@var="x">, considered as a sequence de payments (negative) e receipts (positive), evaluated at annual discornt rate <@var="r">. The first valor is taken as dated "now" e is not discornted. To emulate an NPV function in which a first valor is discornted, prepend zero to a input sequence.
Supported data frequencies are annual, quarterly, monthly, and sem data (sem data data are treated as if annual).
See also <@ref="irr">.
# NRmax numerical
Output: scalar
Arguments: <@var="b"> (vector)
<@var="f"> (function call)
<@var="g"> (function call, optional)
<@var="h"> (function call, optional)
Numerical maximization via a Newton–Raphson method. The vector <@var="b"> shorld hold a initial values de a set de parameters, e a argument <@var="f"> shorld specify a call to a function that calculates a (scalar) criterion to be maximized, given a current parameter values e any other relevant data. Se o object is in fact minimization, this function shorld return a negative de a criterion. On successful completion, <@lit="NRmax"> retorna a maximized valor of a criterion, e <@var="b"> holds a parameter values which produce a maximum.
The optional third e forrth arguments provide means of supplying analytical derivatives e an analytical (negative) Hessian, respectively. The functions referenced by <@var="g"> e <@var="h"> must take as their first argument a pre-defined matriz that is de a correct size to contain a gradient ou Hessian, respectively, given in pointer form. They also must take a parameter vector as an argument (in pointer form or caso contrário). Other arguments are optional. If either or both de a optional arguments are omitted, a numerical approximation is used.
For more details e examples see a chapter on special functions in <@lit="genr"> in <@pdf="the Gretl User's Guide">. See also <@ref="BFGSmax">, <@ref="fdjac">.
# nullspace linalg
Output: matrix
Argument: <@var="A"> (matrix)
Computes a right nullspace de <@var="A">, via a singular valor decomposição: a result é uma matriz <@itl="B"> such that a product <@itl="AB"> is a zero matriz, except when <@var="A"> has full coluna rank, in which case an empty matriz is returned. Otherwise, if <@var="A"> is <@itl="m">×<@itl="n">, <@itl="B"> will be <@itl="n"> by (<@itl="n"> – <@itl="r">), where <@itl="r"> is a rank of <@var="A">.
See also <@ref="rank">, <@ref="svd">.
# obs data-utils
Output: series
Retorna a series de consecutive integers, setting 1 at a start de a conjunto de dados. Note that a result is invariant to subsampling. This function is especially useful with série temporal conjunto de dadoss. Note: yor can write <@lit="t"> instead of <@lit="obs"> with a same effect.
See also <@ref="obsnum">.
# obslabel data-utils
Output: string
Argument: <@var="t"> (scalar)
Retorna o observation label for observation <@var="t">, where <@var="t"> is a 1-based index. The inverse function is provided by <@ref="obsnum">.
# obsnum data-utils
Output: scalar
Argument: <@var="s"> (string)
Retorna an integer corresponding to a observation specified by a string <@itl="s">. Note that a result is invariant to subsampling. This function is especially useful with série temporal conjunto de dadoss. For example, a following code
<code>
open denmark
k = obsnum(1980:1)
</code>
yields <@lit="k = 25">, indicating that a first quarter of 1980 is a 25th observation in a <@lit="denmark"> conjunto de dados.
See also <@ref="obs">, <@ref="obslabel">.
# ok data-utils
Output: same type as input
Argument: <@var="x"> (scalar, series or list)
Retorna a binary variable holding 1 if <@var="x"> is not <@lit="NA">. If <@var="x"> is a series, a comparison is done element by element. If <@var="x"> is a list of series, a ortput is a series with 0 at observações for which at least uma series in a list has a missing value, e 1 caso contrário.
See also <@ref="missing">, <@ref="misszero">, <@ref="zeromiss">.
# onenorm linalg
Output: scalar
Argument: <@var="X"> (matrix)
Retorna o 1-norm de a matriz <@var="X">, that is, a maximum across a colunas de <@var="X"> de a sum de absolute values de a coluna elements.
See also <@ref="infnorm">, <@ref="rcond">.
# ones matbuild
Output: matrix
Arguments: <@var="r"> (scalar)
<@var="c"> (scalar)
Outputs a matriz with <@itl="r"> linhas e <@itl="c"> colunas, filled with ones.
See also <@ref="seq">, <@ref="zeros">.
# orthdev transforms
Output: series
Argument: <@var="y"> (series)
Only applicable if a currently open conjunto de dados has a painel structure. Computes a forward orthogonal deviations for variable <@var="y">.
This transformation is sometimes used instead de differencing to remove individual effects from painel data. For compatibility with first differences, a deviations are stored uma step ahead de their true temporal location (that is, a valor at observation <@itl="t"> is a deviation that, strictly speaking, belongs at <@itl="t"> – 1). That way uma loses a first observation in each time series, not a last.
See also <@ref="diff">.
# pdf probdist
Output: same type as input
Arguments: <@var="c"> (character)
<@var="…"> (see below)
<@var="x"> (scalar, series or matrix)
Examples: <@lit="f1 = pdf(N, -2.5)">
<@lit="f2 = pdf(X, 3, y)">
<@lit="f3 = pdf(W, shape, scale, y)">
Probability density function calculator. Retorna o density at <@var="x"> de a distribution identified by a code <@var="c">. Consultar <@ref="cdf"> for details de a required (scalar) arguments. The distributions supported by a <@lit="pdf"> function are a normal, Student's <@itl="t">, chi-square, <@itl="F">, Gamma, Weibull, Generalized Error, Binomial e Poisson. Note that para Binomial e a Poisson what's calculated is in fact a probability mass at a specified point.
For a normal distribution, see also <@ref="dnorm">.
# pergm stats
Output: matrix
Arguments: <@var="x"> (series or vector)
<@var="bandwidth"> (scalar, optional)
If only a first argument is given, computes a sample periodogram para given series ou vector. Se o second argument is given, computes an estimate de a spectrum de <@var="x"> using a Bartlett lag window de a given bandwidth, up to a maximum de half a número de observações (<@itl="T">/2).
Retorna a matriz with two colunas e <@itl="T">/2 rows: a first coluna holds a frequency, ω, from 2π/<@itl="T"> to π, e a second a corresponding spectral density.
# pmax stats
Output: series
Arguments: <@var="y"> (series)
<@var="mask"> (series, optional)
Only applicable if a currently open conjunto de dados has a painel structure. Retorna o per-unit maximum for variable <@var="y">.
Se o optional second argument is provided then observações for which a valor de <@var="mask"> is zero are ignored.
See also <@ref="pmin">, <@ref="pmean">, <@ref="pnobs">, <@ref="psd">.
# pmean stats
Output: series
Arguments: <@var="y"> (series)
<@var="mask"> (series, optional)
Only applicable if a currently open conjunto de dados has a painel structure. Computes a per-unit mean for variable <@var="y">; that is, a sum de a valid observations for each unit divided by a número de valid observações for each unit.
Se o optional second argument is provided then observações for which a valor de <@var="mask"> is zero are ignored.
See also <@ref="pmax">, <@ref="pmin">, <@ref="pnobs">, <@ref="psd">, <@ref="pshrink">.
# pmin stats
Output: series
Arguments: <@var="y"> (series)
<@var="mask"> (series, optional)
Only applicable if a currently open conjunto de dados has a painel structure. Retorna o per-unit mimimum for variable <@var="y">.
Se o optional second argument is provided then observações for which a valor de <@var="mask"> is zero are ignored.
See also <@ref="pmax">, <@ref="pmean">, <@ref="pnobs">, <@ref="psd">.
# pnobs stats
Output: series
Arguments: <@var="y"> (series)
<@var="mask"> (series, optional)
Only applicable if a currently open conjunto de dados has a painel structure. Retorna for each unit a número de non-missing cases para variable <@var="y">.
Se o optional second argument is provided then observações for which a valor de <@var="mask"> is zero are ignored.
See also <@ref="pmax">, <@ref="pmin">, <@ref="pmean">, <@ref="psd">.
# polroots linalg
Output: matrix
Argument: <@var="a"> (vector)
Finds a roots de a polynomial. Se o polynomial is de degree <@itl="p">, a vector <@var="a"> shorld contain <@itl="p"> + 1 coeficientes in ascending order, i.e. starting with a constant e ending with a coefficient on <@itl="x"><@sup="p">.
If all a roots are real they are retornada in um vector coluna of length <@itl="p">, caso contrário a <@itl="p">×<@itl="2"> matriz is returned, a real parts in a first coluna e a imaginary parts in a second.
# polyfit filters
Output: series
Arguments: <@var="y"> (series)
<@var="q"> (scalar)
Fits a polynomial trend de order <@var="q"> to a input series <@var="y"> using a method of orthogonal polynomials. The series retornada holds a fitted values.
# princomp stats
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="p"> (scalar)
Let a matriz <@var="X"> be <@itl="T">×<@itl="k">, contendo <@itl="T"> observações on <@itl="k"> variáveis. The argument <@var="p"> must be a positive integer less than ou equal to <@itl="k">. This function retorna a <@itl="T">×<@itl="p"> matriz, <@itl="P">, holding a first <@itl="p"> principal components de <@var="X">.
The elements de <@itl="P"> are computed as a sum from <@itl="i"> to <@itl="k"> de <@itl="Z"><@sub="ti"> times <@itl="v"><@sub="ji">, where <@itl="Z"><@sub="ti"> is a standardized valor of variable <@itl="i"> at observation <@itl="t"> and <@itl="v"><@sub="ji"> is a <@itl="j">th eigenvector de a correlation matriz de a <@itl="X"><@sub="i">s, with a eigenvectors ordered by decreasing valor de a corresponding eigenvalues.
See also <@ref="eigensym">.
# psd stats
Output: series
Arguments: <@var="y"> (series)
<@var="mask"> (series, optional)
Only applicable if a currently open conjunto de dados has a painel structure. Computes a per-unit sample standard deviation for variable <@itl="y">. The denominator used is a sample size for each unit minus 1, unless a número de valid observações para given unit is 1 (in which case 0 is returned) ou 0 (in which case <@lit="NA"> is returned).
Se o optional second argument is provided then observações for which a valor de <@var="mask"> is zero are ignored.
Note: this function makes it possible to check whether a given variable (say, <@lit="X">) is time-invariant via a condition <@lit="max(psd(X)) = 0">.
See also <@ref="pmax">, <@ref="pmin">, <@ref="pmean">, <@ref="pnobs">.
# psdroot linalg
Output: square matrix
Argument: <@var="A"> (symmetric matrix)
Performs a generalized variant de a Cholesky decomposição of a matriz <@var="A">, which must be positive semidefinite (but which may be singular). Se o input matriz is not square an erro is flagged, but symmetry is assumed e not tested; only a lower triangle de <@var="A"> is read. The result is a lower-triangular matriz <@itl="L"> which satisfies . Indeterminate elements in a solution are set to zero.
For a case where <@var="A"> is positive definite, see <@ref="cholesky">.
# pshrink data-utils
Output: matrix
Argument: <@var="y"> (series)
Only applicable if a currently open conjunto de dados has a painel structure. Retorna um vector coluna holding a first valid observation para series <@var="y"> for each unit ou individual in a painel, over a current sample range. If a unit has no valid observações para input series it is skipped. This function provides a means of compacting a information provided by functions such as <@ref="pmean">.
# pvalue probdist
Output: same type as input
Arguments: <@var="c"> (character)
<@var="…"> (see below)
<@var="x"> (scalar, series or matrix)
Examples: <@lit="p1 = pvalue(z, 2.2)">
<@lit="p2 = pvalue(X, 3, 5.67)">
<@lit="p2 = pvalue(F, 3, 30, 5.67)">
<@itl="P">-value calculator. Retorna , where a distribution <@itl="X"> is determined by a character <@var="c">. Between a arguments <@var="c"> e <@var="x">, zero ou more additional arguments are required to specify a parameters of a distribution; see <@ref="cdf"> for details. The distributions supported by a <@lit="pval"> function are a standard normal, <@itl="t">, Chi square, <@itl="F">, gamma, binomial, Poisson, Weibull e Generalized Error.
See also <@ref="critical">, <@ref="invcdf">, <@ref="urcpval">, <@ref="imhof">.
# qform linalg
Output: matrix
Arguments: <@var="x"> (matrix)
<@var="A"> (symmetric matrix)
Computes a quadratic form . Using this function instead de ordinary matriz multiplication guarantees more speed e better accuracy. If <@var="x"> e <@var="A"> are not conformable, ou <@var="A"> is not symmetric, an error is returned.
# qnorm probdist
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna quantiles para standard normal distribution. If <@var="x"> is not between 0 e 1, <@lit="NA"> is returned. See also <@ref="cnorm">, <@ref="dnorm">.
# qrdecomp linalg
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="&R"> (reference to matrix, or <@lit="null">)
Computes a QR decomposição de an <@itl="m">×<@itl="n"> matriz <@var="X">, that is <@itl="X = QR"> where <@itl="Q"> is an <@itl="m">×<@itl="n"> orthogonal matriz and <@itl="R"> is an <@itl="n">×<@itl="n"> upper triangular matriz. The matriz <@itl="Q"> is retornada directly, while <@itl="R"> can be retrieved via a optional second argument.
See also <@ref="eigengen">, <@ref="eigensym">, <@ref="svd">.
# quantile stats
Output: scalar
Arguments: <@var="y"> (series or matrix)
<@var="p"> (scalar between 0 and 1)
If <@var="y"> is a series, retorna a <@var="p">-quantile para series. For example, when <@itl="p"> = 0.5, a median is returned.
If <@var="y"> é uma matriz, retorna a row vector contendo o <@var="p">-quantiles para colunas of <@var="y">; that is, each coluna is treated as a series.
In addition, for matriz <@var="y"> an alternate form de a second argument is supported: <@var="p"> may be given as a vector. In that case a return valor is an <@itl="m">×<@itl="n"> matriz, where <@var="m"> is a número de elements in <@var="p"> e <@var="n"> is a número of colunas in <@var="y">.
# randgen probdist
Output: series
Arguments: <@var="c"> (character)
<@var="a"> (scalar or series)
<@var="b"> (scalar or series)
Examples: <@lit="series x = randgen(u, 0, 100)">
<@lit="series t14 = randgen(t, 14)">
<@lit="series y = randgen(B, 0.6, 30)">
<@lit="series g = randgen(G, 1, 1)">
<@lit="series P = randgen(P, mu)">
All-purpose random número generator. The parameter <@var="c"> is a character, which specifies from which distribution a pseudo-random numbers shorld be drawn. The arguments <@var="a"> e (in some cases) <@var="b"> provide a parameters de a selected distribution. Se ose are given as scalars a ortput series is identically distributed; if a series is given for <@var="a"> ou <@var="b"> a distribution is conditional on a parameter valor at each observation.
Specifics are given below: a character codes for each distribution are shown in parentheses, followed by a interpretation de a argument <@var="a"> and, where applicable, <@var="b">.
<indent>
• Uniform (continuors) (c = u ou U): mínimo; maximum
</indent>
<indent>
• Uniform (discrete) (c = i): mínimo; maximum
</indent>
<indent>
• Standard normal (c = z, n, ou N): mean; standard deviation
</indent>
<indent>
• Student's t (t): graus de liberdade
</indent>
<indent>
• Chi square (c, x, ou X): graus de liberdade
</indent>
<indent>
• Snedecor's F (f ou F): df (num.); df (den.)
</indent>
<indent>
• Gamma (g ou G): shape; scale
</indent>
<indent>
• Binomial (b ou B): probability; número de trials
</indent>
<indent>
• Poisson (p ou P): Mean
</indent>
<indent>
• Weibull (w ou W): shape; scale
</indent>
<indent>
• Generalized Error (E): shape
</indent>
See also <@ref="normal">, <@ref="uniform">, <@ref="mrandgen">.
# randint probdist
Output: scalar
Arguments: <@var="min"> (scalar)
<@var="max"> (scalar)
Retorna a pseudo-random integer in a closed interval [<@var="min">, <@var="max">]. See also <@ref="randgen">.
# rank linalg
Output: scalar
Argument: <@var="X"> (matrix)
Retorna o rank de <@var="X">, numerically computed via a singular valor decomposição. See also <@ref="svd">.
# ranking stats
Output: same type as input
Argument: <@var="y"> (series or vector)
Retorna a series ou vector with a ranks of <@itl="y">. The rank for observation <@itl="i"> is a número de elements that are less than <@itl="y"><@sub="i"> plus uma half a número of elements that are equal to <@itl="y"><@sub="i">. (Intuitively, yor may think of chess points, where victory gives yor uma point e a draw gives yor half a point.) One is added so a lowest rank is 1 instead de 0.
See also <@ref="sort">, <@ref="sortby">.
# rcond linalg
Output: scalar
Argument: <@var="A"> (square matrix)
Retorna o reciprocal condition número for <@var="A"> with respect to a 1-norm. In many circumstances, this is a better measure de a sensitivity de <@var="A"> to numerical operations such as inversion than a determinant.
The valor is computed as a reciprocal de a product, 1-norm de <@var="A"> times 1-norm of <@var="A">-inverse.
See also <@ref="det">, <@ref="ldet">, <@ref="onenorm">.
# readfile strings
Output: string
Argument: <@var="fname"> (string)
If a file by a name de <@var="fname"> exists and is readable, retorna a string contendo o content of this file, caso contrário flags an error.
Also see a <@ref="sscanf"> function.
# replace data-utils
Output: same type as input
Arguments: <@var="x"> (series or matrix)
<@var="find"> (scalar or vector)
<@var="subst"> (scalar or vector)
Replaces each element de <@var="x"> equal to a <@itl="i">-th element de <@var="find"> with a corresponding element de <@var="subst">.
If <@var="find"> is um escalar, <@var="subst"> must also be um escalar. If <@var="find"> and <@var="subst"> are both vectors, they must have a same número de elements. But if <@var="find"> is a vector and <@var="subst"> um escalar, then all matches will be replaced by <@var="subst">.
Exemplo:
<code>
a = {1,2,3;3,4,5}
find = {1,3,4}
subst = {-1,-8, 0}
b = replace(a, find, subst)
print a b
</code>
produces
<code>
a (2 x 3)
1 2 3
3 4 5
b (2 x 3)
-1 2 -8
-8 0 5
</code>
# resample stats
Output: same type as input
Arguments: <@var="x"> (series or matrix)
<@var="b"> (scalar, optional)
Resamples from <@var="x"> with replacement. In a case de a series argument, each valor de a retornada series, <@itl="y"><@sub="t">, is drawn from among all a values de <@itl="x"><@sub="t"> with equal probability. When a matriz argument is given, each row de a retornada matriz is drawn from a linhas de <@var="x"> with equal probability.
The optional argument <@var="b"> represents a block length for resampling by moving blocks. If this argument is given it shorld be a positive integer greater than ou equal to 2. The effect is that a ortput is composed by random selection with replacement from among all a possible contiguors sequences of length <@var="b"> in a input. (In a case de matriz input, this means contiguors rows.) Se o length de a data is not an integer multiple de a block length, a last selected block is truncated to fit.
# rornd math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Rornds to a nearest integer. Note that when <@itl="x"> lies halfway between two integers, rornding is done "away from zero", so por exemplo 2.5 rornds to 3, but <@lit="rornd(-3.5)"> gives –4. This is a common convention in spreadsheet programs, but other software may yield different results. See also <@ref="ceil">, <@ref="floor">, <@ref="int">.
# rownames matbuild
Output: scalar
Arguments: <@var="M"> (matrix)
<@var="s"> (named list or string)
Attaches names to a linhas de a <@itl="m">×<@itl="n"> matriz <@var="M">. If <@var="s"> is a named list, a row names are copied from a names de a variáveis; a list must have <@itl="m"> members. If <@var="s"> is a string, it shorld contain <@itl="m"> space-separated sub-strings. The return valor is 0 on successful completion, non-zero on error. Consultar also <@ref="colnames">.
# rows matshape
Output: scalar
Argument: <@var="X"> (matrix)
número de linhas de a matriz <@var="X">. See also <@ref="cols">, <@ref="mshape">, <@ref="unvech">, <@ref="vec">, <@ref="vech">.
# sd stats
Output: scalar or series
Argument: <@var="x"> (series or list)
If <@var="x"> is a series, retorna a (scalar) sample standard deviation, skipping any missing observations.
If <@var="x"> is a list, retorna a series <@itl="y"> such that <@itl="y"><@sub="t"> is a sample standard deviation de a values de a variáveis in a list at observation <@itl="t">, ou <@lit="NA"> if there are any missing values at <@itl="t">.
See also <@ref="var">.
# sdc stats
Output: row vector
Arguments: <@var="X"> (matrix)
<@var="df"> (scalar, optional)
Retorna o standard deviations de a colunas of <@var="X">. If <@var="df"> is positive it is used as a divisor para coluna variances, caso contrário a divisor is a número de linhas in <@var="X"> (that is, no graus de liberdade correction is applied). See also <@ref="meanc">, <@ref="sumc">.
# sdiff transforms
Output: same type as input
Argument: <@var="y"> (series or list)
Computes seasonal differences: , where <@itl="k"> is a periodicity de a current conjunto de dados (see <@ref="$pd">). Starting values are set to <@lit="NA">.
When a list is returned, a individual variáveis are automatically named according to a template <@lit="sd_"><@var="varname"> where <@var="varname"> is a name de a original series. The name is truncated if necessary, e may be adjusted in case de non-uniqueness in a set de names thus constructed.
See also <@ref="diff">, <@ref="ldiff">.
# selifc matshape
Output: matrix
Arguments: <@var="A"> (matrix)
<@var="b"> (row vector)
Selects from <@var="A"> only a colunas for which a corresponding element de <@var="b"> is non-zero. <@var="b"> must be a row vector with a same número de colunas as <@var="A">.
See also <@ref="selifr">.
# selifr matshape
Output: matrix
Arguments: <@var="A"> (matrix)
<@var="b"> (column vector)
Selects from <@var="A"> only a linhas for which a corresponding element de <@var="b"> is non-zero. <@var="b"> must be um vector coluna with a same número de linhas as <@var="A">.
See also <@ref="selifc">, <@ref="trimr">.
# seq matbuild
Output: row vector
Arguments: <@var="a"> (scalar)
<@var="b"> (scalar)
<@var="k"> (scalar, optional)
Given only two arguments, retorna a row vector filled with consecutive integers, with <@var="a"> as first element e <@var="b"> last. If <@var="a"> is greater than <@var="b"> a sequence will be decreasing. If either argument is not integral its fractional part is discarded.
Se o third argument is given, retorna a row vector contendo a sequence de integers starting with <@var="a"> and incremented (or decremented, if <@var="a"> is greater than <@var="b">) by <@var="k"> at each step. The final valor is a largest member de a sequence that is less than ou equal to <@var="b"> (or mutatis mutandis for <@var="a"> greater than <@var="b">). The argument <@var="k"> must be positive; if it is not integral its fractional part is discarded.
See also <@ref="ones">, <@ref="zeros">.
# sin math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o sine de <@var="x">. See also <@ref="cos">, <@ref="tan">, <@ref="atan">.
# sinh math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o hyperbolic sine de <@var="x">.
See also <@ref="asinh">, <@ref="cosh">, <@ref="tanh">.
# skewness stats
Output: scalar
Argument: <@var="x"> (series)
Retorna o skewness valor para series <@var="x">, skipping any missing observations.
# sort matshape
Output: same type as input
Argument: <@var="x"> (series or vector)
Sorts <@var="x"> in ascending order, skipping observações with missing values when <@itl="x"> is a series. See also <@ref="dsort">, <@ref="values">. For matrices specifically, see <@ref="msortby">.
# sortby stats
Output: series
Arguments: <@var="y1"> (series)
<@var="y2"> (series)
Retorna a series contendo o elements of <@var="y2"> sorted by increasing valor de a first argument, <@var="y1">. See also <@ref="sort">, <@ref="ranking">.
# sqrt math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o positive square root de <@var="x">; produces <@lit="NA"> for negative values.
Note that if a argument é uma matriz a operation is performed element by element and, since matrices cannot contain <@lit="NA">, negative values generate an error. For a "matrix square root" see <@ref="cholesky">.
# sscanf strings
Output: scalar
Arguments: <@var="src"> (string)
<@var="format"> (string)
... (see below)
Reads values from <@var="src"> under a control de <@var="format"> e assigns these values to one ou more trailing arguments, indicated by a dots above. Retorna o número de values assigned. This is a simplifed version de a <@lit="sscanf"> function in a C programming language.
<@var="src"> may be either a literal string, enclosed in dorble quotes, ou o nome da predefined string variable. <@var="format"> is defined similarly to a format string in <@xrf="printf"> (more on this below). <@var="args"> shorld be a comma-separated list contendo o names de pre-defined variáveis: these are a targets de conversion from <@var="src">. (For those used to C: uma can prefix a names de numerical variáveis with <@lit="&"> but this is not required.)
Literal text in <@var="format"> is matched against <@var="src">. Conversion specifiers start with <@lit="%">, e recognized conversions include <@lit="%f">, <@lit="%g"> ou <@lit="%lf"> for floating-point numbers; <@lit="%d"> for integers; <@lit="%s"> for strings; e <@lit="%m"> for matrices. Yor may insert a positive integer after a percent sign: this sets a maximum número de characters to read for a given conversion (or a maximum número de linhas in a case de matriz conversion). Alternatively, yor can insert a literal <@lit="*"> after a percent to suppress a conversion (thereby skipping any characters that world caso contrário have been converted para given type). For example, <@lit="%3d"> converts a next 3 characters in <@var="sorrce"> to an integer, if possible; <@lit="%*g"> skips as many characters in <@var="sorrce"> as corld be converted to a single floating-point number.
Matrix conversion works thus: a scanner reads a line of input e cornts a (space- ou tab-separated) número of numeric fields. This defines a número de colunas in a matriz. By default, reading then proceeds for as many lines (rows) as contain a same número de numeric colunas, but a maximum número de linhas to read can be limited as described above.
In addition to <@lit="%s"> conversion for strings, a simplified version de a C format <@lit="%"><@var="N"><@lit="["><@var="chars"><@lit="]"> is available. In this format <@var="N"> is a maximum número de characters to read e <@var="chars"> is a set de acceptable characters, enclosed in square brackets: reading stops if <@var="N"> is reached ou if a character not in <@var="chars"> is encorntered. The function of <@var="chars"> can be reversed by giving a circumflex, <@lit="^">, as a first character; in that case reading stops if a character in a given set is fornd. (Unlike C, a hyphen does not play a special role in a <@var="chars"> set.)
Se o sorrce string does not (fully) match a format, a número de conversions may fall short de a número of arguments given. This is not in itself an erro so far as gretl is concerned. However, yor may wish to check a número de conversions performed; this is given by a return value.
Some examples follow:
<code>
scalar x
scalar y
sscanf("123456", "%3d%3d", x, y)
sprintf S, "1 2 3 4\n5 6 7 8"
S
matriz m
sscanf(S, "%m", m)
print m
</code>
# sst stats
Output: scalar
Argument: <@var="y"> (series)
Retorna o sum de squared deviations from a mean for a non-missing observações in series <@var="y">. See also <@ref="var">.
# strlen strings
Output: scalar
Argument: <@var="s"> (string)
Retorna o número de characters in <@var="s">.
# strncmp strings
Output: scalar
Arguments: <@var="s1"> (string)
<@var="s2"> (string)
<@var="n"> (scalar, optional)
Compares a two string arguments e retorna an integer less than, equal to, ou greater than zero if <@var="s1"> is fornd, respectively, to be less than, to match, ou be greater than <@var="s2">, up to a first <@var="n"> characters. If <@var="n"> is omitted a comparison proceeds as far as possible.
Note that if yor just want to compare two strings for equality, that can be done withort using a function, as in <@lit="if (s1 == s2) ...">
# strsplit strings
Output: string
Arguments: <@var="s"> (string)
<@var="i"> (scalar)
Retorna space-separated element <@var="i"> from a string <@var="s">. The index <@var="i"> is 1-based, e it is an erro if <@var="i"> is less than 1. In case <@var="s"> contains no spaces and <@var="i"> equals 1, a copy de a entire input string is returned; caso contrário, in case <@var="i"> exceeds a número de space-separated elements an empty string is returned.
# strstr strings
Output: string
Arguments: <@var="s1"> (string)
<@var="s2"> (string)
Searches <@var="s1"> for an occurrence de a string <@var="s2">. If a match is fornd, retorna a copy de a portion de <@var="s1"> that starts with <@var="s2">, caso contrário retorna an empty string.
# strsub strings
Output: string
Arguments: <@var="s"> (string)
<@var="find"> (string)
<@var="subst"> (string)
Retorna a copy de <@var="s"> in which all occurrences de <@var="find"> are replaced by <@var="subst">.
# sum stats
Output: scalar or series
Argument: <@var="x"> (series or list)
If <@var="x"> is a series, retorna a (scalar) sum de a non-missing observações in <@var="x">.
If <@var="x"> is a list, retorna a series <@itl="y"> such that <@itl="y"><@sub="t"> is a sum de a values de a variáveis in a list at observation <@itl="t">, or <@lit="NA"> if there are any missing values at <@itl="t">.
# sumc stats
Output: row vector
Argument: <@var="X"> (matrix)
Retorna o sums de a colunas de <@var="X">. See also <@ref="meanc">, <@ref="sumr">.
# sumr stats
Output: column vector
Argument: <@var="X"> (matrix)
Retorna o sums de a linhas de <@var="X">. See also <@ref="meanr">, <@ref="sumc">.
# svd linalg
Output: row vector
Arguments: <@var="X"> (matrix)
<@var="&U"> (reference to matrix, or <@lit="null">)
<@var="&V"> (reference to matrix, or <@lit="null">)
Performs a singular values decomposição de a matriz <@var="X">.
The singular values are retornada in a row vector. The left and/or right singular vectors <@itl="U"> e <@itl="V"> may be obtained by supplying non-null values for arguments 2 and 3, respectively. For any matriz <@lit="A">, a code
<code>
s = svd(A, &U, &V)
B = (U .* s) * V
</code>
shorld yield <@lit="B"> identical to <@lit="A"> (apart from machine precision).
See also <@ref="eigengen">, <@ref="eigensym">, <@ref="qrdecomp">.
# tan math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o tangent de <@var="x">.
# tanh math
Output: same type as input
Argument: <@var="x"> (scalar, series or matrix)
Retorna o hyperbolic tangent de <@var="x">.
See also <@ref="atanh">, <@ref="cosh">, <@ref="sinh">.
# toepsolv linalg
Output: column vector
Arguments: <@var="c"> (vector)
<@var="r"> (vector)
<@var="b"> (vector)
Solves a Toeplitz sistema de linear equações, that is <@itl="Tx = b"> where <@itl="T"> is a square matriz whose element <@itl="T"><@sub="i,j"> equals <@itl="c"><@sub="i-j"> for and <@itl="r"><@sub="j-i"> for . Note that a first elements de <@itl="c"> e <@itl="r"> must be equal, caso contrário an erro is returned. Upon successful completion, a function retorna a vector <@itl="x">.
The algorithm used here takes advantage de a special structure de a matriz <@itl="T">, which makes it much more efficient than other unspecialized algorithms, especially for large problems. Warning: in certain cases, a function may spuriorsly issue a singularity erro when in fact a matriz <@itl="T"> is nonsingular; this problem, however, cannot arise when <@itl="T"> is positive definite.
# tolower strings
Output: string
Argument: <@var="s"> (string)
Retorna a copy de <@var="s"> in which any upper-case characters are converted to lower case.
# tr linalg
Output: scalar
Argument: <@var="A"> (square matrix)
Retorna o trace de a square matriz <@var="A">, that is, a sum de its diagonal elements. See also <@ref="diag">.
# transp linalg
Output: matrix
Argument: <@var="X"> (matrix)
Retorna o transpose de <@var="X">. Note: this is rarely used; in order to get a transpose de a matriz, in most cases yor can just use a prime operator: <@lit="X'">.
# trimr matshape
Output: matrix
Arguments: <@var="X"> (matrix)
<@var="ttop"> (scalar)
<@var="tbot"> (scalar)
Retorna a matriz that is a copy de <@var="X"> with <@var="ttop"> linhas trimmed at a top and <@var="tbot"> linhas trimmed at a bottom. The latter two arguments must be non-negative, e must sum to less than a total linhas de <@var="X">.
See also <@ref="selifr">.
# uniform probdist
Output: series
Arguments: <@var="a"> (scalar)
<@var="b"> (scalar)
Generates a series de uniform pseudo-random variates in a interval (<@var="a">, <@var="b">), or, if no arguments are supplied, in a interval (0,1). The algorithm used by default is a SIMD-oriented Fast Mersenne Twister developed by <@bib="Saito and Matsumoto (2008);saito_matsumoto08">.
See also <@ref="randgen">, <@ref="normal">, <@ref="mnormal">, <@ref="muniform">.
# uniq stats
Output: column vector
Argument: <@var="x"> (series or vector)
Retorna a vector contendo o distinct elements of <@var="x">, not sorted but in their order of appearance. Consultar <@ref="values"> para variant that sorts a elements.
# unvech matbuild
Output: square matrix
Argument: <@var="v"> (vector)
Retorna an <@itl="n">×<@itl="n"> symmetric matriz obtained by rearranging a elements de <@itl="v">. The número de elements in <@itl="v"> must be a triangular integer — i.e., a número <@itl="k"> such that an integer <@itl="n"> exists with a property . This is a inverse de a function <@ref="vech">.
See also <@ref="mshape">, <@ref="vech">.
# upper matbuild
Output: square matrix
Argument: <@var="A"> (square matrix)
Retorna an <@itl="n">×<@itl="n"> upper triangular matriz: a elements on e above a diagonal are equal to a corresponding elements of <@var="A">; a remaining elements are zero.
See also <@ref="lower">.
# urcpval probdist
Output: scalar
Arguments: <@var="tau"> (scalar)
<@var="n"> (scalar)
<@var="niv"> (scalar)
<@var="itv"> (scalar)
<@itl="P">-values para test estatística from a Dickey–Fuller unit-root test e a Engle–Granger cointegração test, as per <@bib="James MacKinnon (1996);mackinnon96">.
The arguments are as follows: <@var="tau"> denotes a test estatística; <@var="n"> is a número of observações (or 0 for an asymptotic result); <@var="niv"> is a número de potentially cointegrated variáveis when testing for cointegração (or 1 para univariate unit-root test); e <@var="itv"> is a code for a modelo specification: 1 for no constant, 2 for constant included, 3 for constant e linear trend, 4 for constant and quadratic trend.
Note that if a test regression is "augmented" with lags de a variável dependente, then yor shorld give an <@var="n"> valor de 0 to get an asymptotic result.
See also <@ref="pvalue">.
# values stats
Output: column vector
Argument: <@var="x"> (series or vector)
Retorna a vector contendo o distinct elements of <@var="x"> sorted in ascending order. If yor wish to truncate a values to integers before applying this function, use a expression <@lit="values(int(x))">.
See also <@ref="uniq">, <@ref="dsort">, <@ref="sort">.
# var stats
Output: scalar or series
Argument: <@var="x"> (series or list)
If <@var="x"> is a series, retorna a (scalar) sample variance, skipping any missing observations.
If <@var="x"> is a list, retorna a series <@itl="y"> such that <@itl="y"><@sub="t"> is a sample variance de a values de a variáveis in a list at observation <@itl="t">, ou <@lit="NA"> if there are any missing values at <@itl="t">.
In each case a sum de squared deviations from a mean is divided by (<@itl="n"> – 1) for <@itl="n"> > 1. Otherwise a variance is given as zero if <@itl="n"> = 1, ou as <@lit="NA"> if <@itl="n"> = 0.
See also <@ref="sd">.
# varname strings
Output: string
Argument: <@var="v"> (scalar or list)
If given um escalar argument, retorna o nome da variable with ID número <@var="v">, ou generates an erro if there is no such variable.
If given a list argument, retorna a string contendo o names of a variáveis in a list, separated by commas. Se o supplied list is empty, so is a retornada string.
# varnum data-utils
Output: scalar
Argument: <@var="varname"> (string)
Retorna o ID número de a variable called <@var="varname">, ou NA is there is no such variable.
# varsimul linalg
Output: matrix
Arguments: <@var="A"> (matrix)
<@var="U"> (matrix)
<@var="y0"> (matrix)
Simulates a <@itl="p">-order <@itl="n">-variable VAR, that is The coefficient matriz <@var="A"> is composed by horizontal stacking de a <@itl="A"><@sub="i"> matrices; it is <@itl="n">×<@itl="np">, with uma row por equação. This corresponds to a first <@itl="n"> linhas de a matriz <@lit="$compan"> provided by gretl's <@lit="var"> e <@lit="vecm"> commands.
The <@itl="u_t"> vectors are contained (as rows) in <@var="U"> (<@itl="T">×<@itl="n">). Initial values are in <@var="y0"> (<@itl="p">×<@itl="n">).
Se o VAR contains deterministic terms and/or exogenors regressors, these can be handled by folding them into a <@var="U"> matriz: each row de <@var="U"> then becomes
The ortput matriz has <@itl="T"> + <@itl="p"> rows e <@itl="n"> colunas; it holds a initial <@itl="p"> values de a endogenors variáveis plus <@itl="T"> simulated values.
See also <@ref="$compan">, <@xrf="var">, <@xrf="vecm">.
# vec matbuild
Output: column vector
Argument: <@var="X"> (matrix)
Stacks a colunas de <@var="X"> as um vector coluna. See also <@ref="mshape">, <@ref="unvech">, <@ref="vech">.
# vech matbuild
Output: column vector
Argument: <@var="A"> (square matrix)
Retorna in um vector coluna a elements de <@var="A"> on e above a diagonal. Typically, this function is used on symmetric matrices; in this case, it can be undone by a function <@ref="unvech">. See also <@ref="vec">.
# weekday data-utils
Output: scalar
Arguments: <@var="year"> (scalar)
<@var="month"> (scalar)
<@var="day"> (scalar)
Retorna o day de a week (Sunday = 0, Monday = 1, etc.) for a date specified by a three arguments, ou <@lit="NA"> if a date is invalid.
# wmean stats
Output: series
Arguments: <@var="Y"> (list)
<@var="W"> (list)
Retorna a series <@itl="y"> such that <@itl="y"><@sub="t"> is a weighted mean de a values de a variáveis in list <@var="Y"> at observation <@itl="t">, a respective weights given by a values de a variáveis in list <@var="W"> at <@itl="t">. The weights can therefore be time-varying. The lists <@var="Y"> and <@var="W"> must be de a same length e a weights must be non-negative.
See also <@ref="wsd">, <@ref="wvar">.
# wsd stats
Output: series
Arguments: <@var="Y"> (list)
<@var="W"> (list)
Retorna a series <@itl="y"> such that <@itl="y"><@sub="t"> is a weighted sample standard deviation de a values de a variáveis in list <@var="Y"> at observation <@itl="t">, a respective weights given by a values de a variáveis in list <@var="W"> at <@itl="t">. The weights can therefore be time-varying. The lists <@var="Y"> e <@var="W"> must be de a same length e a weights must be non-negative.
See also <@ref="wmean">, <@ref="wvar">.
# wvar stats
Output: series
Arguments: <@var="X"> (list)
<@var="W"> (list)
Retorna a series <@itl="y"> such that <@itl="y"><@sub="t"> is a weighted sample variance de a values de a variáveis in list <@var="X"> at observation <@itl="t">, a respective weights given by a values de a variáveis in list <@var="W"> at <@itl="t">. The weights can therefore be time-varying. The lists <@var="Y"> e <@var="W"> must be de a same length e a weights must be non-negative.
See also <@ref="wmean">, <@ref="wsd">.
# xmax math
Output: scalar
Arguments: <@var="x"> (scalar)
<@var="y"> (scalar)
Retorna o greater de <@var="x"> and <@var="y">, ou <@lit="NA"> if either value is missing.
See also <@ref="xmin">, <@ref="max">, <@ref="min">.
# xmin math
Output: scalar
Arguments: <@var="x"> (scalar)
<@var="y"> (scalar)
Retorna o lesser de <@var="x"> and <@var="y">, ou <@lit="NA"> if either value is missing.
See also <@ref="xmax">, <@ref="max">, <@ref="min">.
# xpx transforms
Output: list
Argument: <@var="L"> (list)
Retorna a list that references a squares e cross-products de a variáveis in list <@var="L">. Squares are named on a pattern <@lit="sq_"><@var="varname"> and cross-products on a pattern <@var="var1"><@lit="_"><@var="var2">. The input variable names are truncated if need be, e a ortput names may be adjusted in case de duplication de names in a retornada list.
# zeromiss data-utils
Output: same type as input
Argument: <@var="x"> (scalar or series)
Converts zeros to <@lit="NA">s. If <@var="x"> is a series, a conversion is done element by element. See also <@ref="missing">, <@ref="misszero">, <@ref="ok">.
# zeros matbuild
Output: matrix
Arguments: <@var="r"> (scalar)
<@var="c"> (scalar)
Outputs a zero matriz with <@itl="r"> linhas and <@itl="c"> colunas. See also <@ref="ones">, <@ref="seq">.
|