R Under development (unstable) (2023-12-12 r85669 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ############### > # preliminaries > library("klaR") Loading required package: MASS > library("MASS") > data(B3) > postscript("testklaR.ps", encoding="ISOLatin1") > > ############ > # classifier > > # Naive Bayes > suppressWarnings(RNGversion("2.10.0")) > set.seed(123) > print(NB <- NaiveBayes(PHASEN ~ ., data = B3)) $apriori grouping 1 2 3 4 0.3757962 0.1528662 0.2993631 0.1719745 $tables $tables$BSP91JW [,1] [,2] 1 4.036102 2.244077 2 6.312083 2.061909 3 2.769149 2.899790 4 1.093333 2.876427 $tables$CP91JW [,1] [,2] 1 3.545254 1.699672 2 6.427500 2.423309 3 3.656596 3.213913 4 2.620000 2.773264 $tables$DEFRATE [,1] [,2] 1 -1.3394915 1.680638 2 -0.8479167 2.836558 3 -0.8380851 2.287536 4 -1.6548148 2.364026 $tables$EWAJW [,1] [,2] 1 1.0645763 0.9941611 2 2.6808333 1.0823160 3 1.0778723 1.5252511 4 -0.9940741 1.7364160 $tables$EXIMRATE [,1] [,2] 1 3.880847 1.879159 2 3.104167 2.399933 3 3.013617 2.525056 4 3.124815 1.537289 $tables$GM1JW [,1] [,2] 1 8.613390 3.341465 2 11.015833 6.389384 3 6.841489 4.125120 4 9.607778 4.355480 $tables$IAU91JW [,1] [,2] 1 6.893559322 6.496527 2 11.360416667 5.967744 3 -0.003404255 9.228796 4 -1.939259259 7.781813 $tables$IB91JW [,1] [,2] 1 3.397119 7.133815 2 6.830417 5.931912 3 1.673191 6.424419 4 -1.491852 9.012635 $tables$LSTKJW [,1] [,2] 1 2.111017 1.837423 2 4.195833 2.074516 3 6.291064 3.122604 4 4.249630 4.449861 $tables$PBSPJW [,1] [,2] 1 2.789153 0.9991398 2 3.927917 1.0445885 3 4.496170 1.4784915 4 4.206296 2.5334412 $tables$PCPJW [,1] [,2] 1 2.214746 1.340367 2 3.187917 1.484426 3 4.062128 1.530176 4 3.938148 2.295010 $tables$ZINSK [,1] [,2] 1 4.715085 1.209989 2 6.836250 2.004783 3 7.682553 3.020254 4 5.672222 2.115302 $tables$ZINSLR [,1] [,2] 1 3.976271 1.180540 2 3.571250 1.340773 3 3.230000 1.641586 4 3.739259 1.643043 $levels [1] "1" "2" "3" "4" $call NaiveBayes.default(x = X, grouping = Y) $x BSP91JW CP91JW DEFRATE EWAJW EXIMRATE GM1JW IAU91JW IB91JW LSTKJW PBSPJW 1955,4 10.53 9.31 0.05 5.70 3.08 11.15 23.56 14.69 3.00 2.89 1956,1 10.60 12.66 0.06 5.20 1.96 11.03 12.72 24.95 2.36 2.59 1956,2 9.21 6.55 0.05 4.80 2.82 10.04 11.52 14.90 3.39 3.01 1956,3 5.17 7.87 0.05 3.30 3.74 8.33 0.85 7.55 5.30 3.03 1956,4 4.93 8.60 0.04 2.10 4.16 7.69 -2.08 3.23 6.91 3.46 1957,1 8.39 5.62 0.04 3.20 2.90 6.62 -3.76 14.58 1.03 1.95 1957,2 5.04 9.85 0.04 2.50 3.65 8.79 -8.90 -2.28 3.73 3.18 1957,3 5.73 6.13 0.03 2.70 4.57 11.22 -0.34 -2.08 6.20 3.98 1957,4 3.91 3.90 0.03 3.00 4.37 12.42 4.09 0.00 4.12 3.29 1958,1 2.17 4.37 0.00 0.30 2.89 13.66 3.37 -8.85 7.94 5.63 1958,2 1.67 2.60 0.02 0.60 3.75 12.57 6.28 2.23 8.08 4.78 1958,3 4.69 6.73 0.02 0.90 3.93 11.53 6.57 7.06 1.84 2.06 1958,4 6.09 6.36 0.02 0.40 4.11 12.15 8.18 8.03 1.99 1.47 1959,1 5.15 7.06 0.00 1.80 3.57 12.30 5.33 17.91 1.23 -0.25 1959,2 8.72 6.73 0.03 1.20 3.57 14.63 12.81 13.50 -2.16 1.14 1959,3 7.03 4.22 0.03 1.20 3.20 15.25 12.48 9.90 -0.30 1.58 1959,4 8.11 5.02 0.03 2.10 3.97 13.55 16.42 7.72 0.36 2.82 1960,1 11.12 4.60 0.02 4.10 3.30 12.65 22.35 12.36 -0.54 2.12 1960,2 8.68 9.10 0.04 2.50 2.21 9.74 17.03 4.76 3.21 2.28 1960,3 8.39 9.53 0.04 2.40 2.56 8.07 17.42 3.43 4.20 2.51 1960,4 8.16 8.65 0.04 2.20 3.65 7.38 14.48 2.60 4.75 2.86 1961,1 7.74 7.51 2.68 3.43 3.20 6.40 15.98 10.52 6.73 4.71 1961,2 4.82 5.01 3.22 2.74 2.55 7.44 13.18 4.49 8.16 4.81 1961,3 3.00 6.70 2.95 1.93 1.42 10.57 9.10 3.08 8.20 4.37 1961,4 2.38 5.37 2.35 1.74 1.63 12.77 8.50 1.70 7.84 5.48 1962,1 2.97 4.48 2.79 1.44 1.76 12.22 8.66 -4.50 5.87 4.55 1962,2 5.34 7.81 2.38 1.29 1.24 13.08 6.69 3.85 5.64 4.44 1962,3 5.59 4.46 -1.13 1.70 0.77 10.11 7.58 5.03 5.20 3.58 1962,4 4.62 5.87 2.01 1.31 1.10 9.23 7.21 2.87 6.12 3.28 1963,1 -1.40 2.71 1.94 0.89 0.90 8.04 -2.84 -21.59 6.46 4.15 1963,2 2.75 2.88 0.25 1.35 0.92 6.12 0.15 3.39 5.04 3.51 1963,3 4.31 3.44 0.93 1.03 0.94 7.51 1.28 8.76 3.25 2.18 1963,4 5.02 2.22 0.57 1.30 2.94 7.02 2.01 8.78 2.86 2.73 1964,1 10.04 6.17 1.96 1.12 2.40 8.10 5.93 40.25 0.96 2.36 1964,2 7.26 4.71 0.24 1.07 1.91 8.97 8.54 10.33 0.27 2.62 1964,3 4.72 4.49 0.90 1.13 0.41 8.39 7.41 5.51 2.91 2.66 1964,4 4.90 6.04 -0.08 1.16 1.10 8.35 8.36 8.98 5.44 4.47 1965,1 6.03 5.27 0.68 1.72 1.15 9.17 10.48 4.16 4.24 4.06 1965,2 5.34 8.01 -0.88 1.32 -0.82 9.56 7.63 3.22 4.67 3.75 1965,3 4.63 7.81 -0.32 1.42 -0.94 8.60 6.13 5.28 7.77 3.82 1965,4 5.05 6.28 -1.72 1.00 0.95 8.12 6.12 1.61 4.29 3.50 1966,1 4.80 6.04 1.41 0.91 0.50 6.16 3.80 9.55 4.80 3.61 1966,2 4.15 3.31 0.16 0.47 0.76 5.37 2.22 2.61 4.51 3.41 1966,3 2.25 3.12 0.27 -0.15 1.48 4.09 -3.43 -0.03 4.52 3.71 1966,4 0.42 0.60 -2.36 -1.00 3.19 2.04 -9.07 0.37 5.16 3.18 1967,1 -1.34 1.78 0.23 -3.00 3.95 1.72 -18.00 -5.07 3.46 2.18 1967,2 -1.81 0.04 -2.17 -4.14 3.56 1.40 -13.28 -9.59 1.43 2.25 1967,3 -0.66 0.39 -0.76 -3.54 2.49 3.30 -10.66 -6.19 -0.99 0.42 1967,4 2.55 2.35 -2.79 -2.78 4.06 7.23 5.30 -3.55 -2.53 1.50 1968,1 3.34 1.30 -0.39 -0.93 4.04 7.65 -3.94 1.37 0.02 0.88 1968,2 4.39 5.08 -1.30 -0.01 3.01 7.41 7.00 -0.41 1.74 2.47 1968,3 7.29 5.11 0.74 1.00 2.51 7.48 16.22 2.07 2.02 3.41 1968,4 7.45 6.84 -2.21 2.47 5.18 7.56 8.22 3.82 3.33 2.12 1969,1 7.39 8.72 1.02 2.99 2.36 6.99 27.25 1.13 2.38 3.34 1969,2 7.87 7.47 0.68 2.94 3.06 8.30 20.29 8.32 3.42 3.65 1969,3 7.52 8.10 1.25 2.70 2.72 9.36 22.44 8.07 4.32 4.03 1969,4 6.88 7.71 1.35 2.48 3.52 7.89 15.34 1.04 7.94 5.91 1970,1 5.84 7.38 1.50 2.35 1.66 6.98 20.06 -2.91 12.34 6.17 1970,2 7.12 7.42 -1.18 2.59 2.05 6.37 17.96 6.85 12.54 8.30 1970,3 4.16 7.67 1.41 2.48 1.50 5.85 12.97 6.18 14.21 7.52 1970,4 4.76 8.20 -0.76 2.09 3.05 6.51 11.15 10.89 12.58 6.88 1971,1 6.58 6.95 0.89 2.47 2.37 8.84 12.11 22.34 10.16 8.00 1971,2 2.39 6.48 -0.33 1.94 1.73 12.08 7.35 4.71 9.99 7.61 1971,3 2.45 5.29 0.29 1.23 1.50 13.31 -1.25 2.87 10.31 7.46 1971,4 1.46 3.64 -1.34 0.94 1.96 13.26 -0.58 3.58 9.61 7.92 1972,1 4.67 6.60 0.17 0.88 2.18 13.54 -2.74 12.00 5.76 5.80 1972,2 3.76 3.83 -2.59 1.01 1.81 12.77 -5.59 5.14 6.09 5.13 1972,3 3.41 4.67 0.23 1.06 1.27 13.84 -1.44 1.60 6.09 4.96 1972,4 5.48 3.80 0.00 1.29 3.43 14.37 -1.06 4.98 6.68 5.42 1973,1 6.57 4.21 1.67 1.78 2.49 12.86 0.67 6.88 6.21 5.85 1973,2 5.01 4.40 1.40 1.77 2.65 8.67 0.19 1.29 7.57 6.21 1973,3 4.50 2.09 2.44 1.74 3.06 1.53 -2.12 -0.57 8.57 5.99 1973,4 3.09 1.37 -0.55 1.53 4.07 0.65 -0.61 -6.74 11.46 7.46 1974,1 1.35 0.01 -0.86 0.33 5.18 0.30 -14.68 -5.01 7.45 5.58 1974,2 0.49 -0.09 0.08 -0.50 4.08 2.96 -12.38 -10.85 10.80 6.90 1974,3 -0.27 1.52 -0.37 -1.23 2.95 8.13 -7.11 -11.07 10.60 7.65 1974,4 -1.47 0.50 -3.78 -1.75 5.48 10.25 -9.15 -9.39 12.18 8.11 1975,1 -3.13 1.73 -5.39 -2.64 4.43 11.59 -7.21 -13.75 9.74 7.15 1975,2 -1.95 3.18 -5.87 -2.71 2.70 13.57 -1.41 -9.60 5.94 6.38 1975,3 -1.18 2.82 -5.17 -2.59 1.73 14.48 -2.73 -5.38 5.23 4.78 1975,4 1.63 4.66 -5.99 -1.95 3.34 16.56 8.15 -2.50 2.47 4.38 1976,1 6.01 5.50 -4.38 -1.05 3.22 14.77 9.75 -4.34 -0.08 3.41 1976,2 6.41 3.51 -3.66 -0.15 2.37 12.20 8.34 5.64 1.74 3.60 1976,3 4.21 3.08 -2.48 0.66 1.56 9.85 2.06 3.70 4.51 4.57 1976,4 5.52 3.77 -3.20 1.31 3.08 5.45 5.49 2.81 3.33 3.00 1977,1 3.81 4.08 -2.92 0.98 2.80 6.64 5.41 9.86 4.11 3.53 1977,2 1.98 4.43 -2.11 0.59 2.49 6.59 3.79 0.16 5.13 3.92 1977,3 1.73 4.87 -1.52 0.68 0.28 8.31 14.03 -0.28 4.30 3.12 1977,4 2.75 4.73 -3.10 0.91 3.97 10.44 7.56 -2.06 4.32 4.33 1978,1 2.75 4.37 -2.97 1.07 3.62 13.39 5.17 -5.24 3.77 4.20 1978,2 3.86 3.54 -2.35 1.16 2.86 13.48 7.08 5.48 2.54 4.09 1978,3 4.10 3.58 -1.45 1.23 1.79 12.93 9.63 3.75 3.90 4.89 1978,4 3.06 3.34 -2.94 1.40 3.59 13.45 7.31 3.89 4.28 3.88 1979,1 3.59 3.05 -3.20 1.78 2.71 10.84 11.21 -2.23 3.94 3.74 1979,2 4.95 5.23 -2.36 2.19 0.83 8.85 9.15 6.98 2.17 3.07 1979,3 4.31 2.16 -1.14 2.36 -0.49 6.29 7.68 7.22 3.73 3.85 1979,4 3.74 2.84 -3.53 2.68 1.26 4.33 7.09 8.40 5.15 4.46 1980,1 4.25 4.97 -3.25 2.54 0.56 1.45 6.30 19.83 4.12 4.85 1980,2 0.40 -1.98 -2.71 2.14 -0.08 1.45 2.71 -0.26 9.25 5.86 1980,3 0.30 1.77 -2.65 1.64 -1.57 2.13 1.55 0.82 8.45 4.76 1980,4 -0.89 0.55 -2.95 1.06 0.67 4.52 -0.40 -6.51 8.87 4.72 1981,1 -1.01 -0.68 -5.48 0.47 -0.30 4.24 -2.67 -11.71 6.18 3.94 1981,2 -0.34 0.00 -3.15 0.28 0.38 1.64 -3.77 -1.40 4.87 3.67 1981,3 0.63 -0.67 -3.11 -0.05 -0.30 0.54 -5.28 -1.90 4.26 3.97 1981,4 0.82 -1.02 -3.10 -0.57 4.26 -1.60 -7.37 -6.24 3.86 4.95 1982,1 -0.75 -0.66 -6.12 -1.33 2.06 0.25 -9.63 -6.79 4.77 5.01 1982,2 -0.24 -0.68 -0.25 -1.05 2.42 3.32 -7.75 -6.07 2.55 4.32 1982,3 -1.77 -2.38 -3.11 -1.02 1.07 4.31 -8.87 -4.92 4.92 4.68 1982,4 -1.58 -1.54 -3.82 -1.32 4.44 6.26 -5.02 1.58 4.17 3.87 1983,1 0.64 0.50 -5.51 -1.93 3.41 10.22 -0.72 0.56 1.31 3.86 1983,2 1.58 1.73 -0.10 -1.90 2.56 10.72 4.86 0.57 -0.08 3.12 1983,3 2.18 1.99 -1.91 -1.39 0.50 11.17 5.69 3.25 0.32 2.89 1983,4 3.70 1.63 -2.73 -0.67 3.23 9.28 10.99 2.05 -0.36 3.08 1984,1 4.22 1.84 -3.94 -0.03 2.71 4.73 0.79 5.55 1.80 2.46 1984,2 1.48 1.78 -0.51 0.22 2.36 3.12 -10.42 0.90 0.59 2.27 1984,3 3.61 2.32 -0.66 0.16 1.67 1.82 3.50 -1.09 -0.82 1.65 1984,4 3.09 1.30 -2.58 0.57 5.63 3.44 0.52 0.18 1.71 1.94 1985,1 0.02 -0.07 -4.02 0.70 3.33 3.73 7.88 -16.20 1.31 1.64 1985,2 3.03 1.36 0.51 0.80 4.08 3.06 16.21 -4.85 2.59 1.90 1985,3 3.01 2.78 0.14 1.01 3.30 4.50 3.67 -0.42 1.31 2.31 1985,4 1.68 2.70 -1.36 0.99 5.52 5.64 7.64 -4.27 1.87 2.33 1986,1 1.10 2.42 -3.28 1.35 5.32 6.80 4.91 0.26 3.63 3.23 1986,2 3.05 4.68 0.53 1.49 5.28 9.56 7.52 3.18 2.00 3.59 1986,3 2.28 3.52 -0.97 1.58 5.27 9.34 2.30 2.21 3.32 3.11 1986,4 2.68 3.23 -1.62 1.56 6.86 8.61 0.97 5.83 2.18 2.78 1987,1 1.82 2.82 -3.70 1.29 6.15 8.96 4.31 -2.31 2.04 2.62 1987,2 0.68 3.03 -0.62 1.15 5.41 8.91 3.01 0.09 4.11 2.32 1987,3 1.56 3.34 -1.83 0.83 4.34 9.71 5.99 1.32 2.30 1.22 1987,4 2.11 4.37 -1.53 0.58 6.51 8.65 4.70 0.12 2.23 1.44 1988,1 4.87 4.81 -3.57 1.06 6.02 9.85 5.07 18.70 0.12 1.11 1988,2 3.40 1.98 -1.35 0.88 5.60 10.04 5.19 1.84 0.05 1.41 1988,3 3.49 2.80 -1.77 0.88 4.60 10.11 6.52 -1.16 0.17 1.69 1988,4 2.99 1.60 -1.97 0.94 6.81 9.76 7.95 -1.42 0.66 1.87 1989,1 5.06 3.21 -1.79 1.58 7.18 9.67 6.65 11.08 0.85 2.29 1989,2 5.32 3.13 2.12 1.55 6.61 5.82 10.01 3.70 -0.54 2.14 1989,3 3.03 1.89 0.19 1.55 5.73 4.40 7.96 1.15 1.61 2.68 1989,4 3.40 3.10 -0.08 1.70 6.28 4.55 9.87 3.39 1.41 2.58 1990,1 5.11 5.15 -2.80 2.79 6.99 2.83 16.83 7.38 1.49 3.09 1990,2 4.07 5.34 1.11 3.07 5.53 8.67 12.78 3.73 3.69 3.35 1990,3 6.49 5.56 -2.93 3.41 6.64 21.47 12.37 5.03 0.75 3.58 1990,4 6.34 5.43 -3.34 3.79 7.62 24.11 11.77 3.85 1.91 2.69 1991,1 6.52 7.00 -11.02 3.17 6.64 27.84 13.08 -2.94 0.32 3.00 1991,2 6.83 6.72 0.41 2.91 5.51 20.86 13.61 4.98 1.66 4.18 1991,3 4.24 4.98 -2.21 2.48 5.49 9.15 9.78 5.20 3.87 3.96 1991,4 2.18 4.46 -1.10 2.19 7.64 7.26 3.59 2.61 5.11 4.49 1992,1 2.31 1.98 -3.53 1.92 7.31 4.37 -0.33 9.76 4.69 4.78 1992,2 0.66 0.55 1.23 1.23 6.82 6.41 -3.28 2.27 3.62 4.21 1992,3 0.88 2.57 -2.67 0.84 6.39 6.60 -4.23 1.29 5.71 4.63 1992,4 1.13 3.55 -4.16 -0.15 7.33 10.63 -8.02 5.25 4.48 4.03 1993,1 -3.78 -0.39 -3.88 -1.21 7.87 9.82 -16.36 -2.54 6.45 3.72 1993,2 -2.03 0.41 0.22 -1.66 7.39 9.31 -19.95 0.46 4.09 3.66 1993,3 -1.27 1.29 -4.87 -1.97 6.03 9.79 -18.29 1.73 1.08 2.73 1993,4 -2.13 -0.57 -2.98 -2.05 7.59 0.72 -15.82 -3.23 1.67 2.67 1994,1 1.39 2.33 -2.86 -1.84 7.49 11.33 -10.59 4.62 -0.12 2.66 1994,2 1.63 0.64 1.20 -1.58 7.75 11.38 -4.90 3.62 -1.81 1.77 1994,3 1.40 0.57 -3.56 -1.34 5.58 9.53 -0.76 2.19 -1.54 1.85 1994,4 1.83 -0.08 -2.22 -0.93 7.50 15.20 2.75 6.12 -0.92 1.79 PCPJW ZINSK ZINSLR 1955,4 1.91 6.27 3.21 1956,1 2.20 4.60 3.54 1956,2 3.09 6.19 3.22 1956,3 2.08 6.71 3.37 1956,4 1.48 7.10 3.14 1957,1 1.65 4.96 4.95 1957,2 1.47 5.21 3.82 1957,3 3.29 4.83 3.09 1957,4 3.59 4.50 3.91 1958,1 4.19 3.83 1.47 1958,2 3.84 3.71 2.19 1958,3 1.75 3.17 4.31 1958,4 0.62 3.83 4.56 1959,1 -0.15 2.90 5.98 1959,2 -0.05 2.79 4.59 1959,3 1.64 2.81 4.15 1959,4 2.27 4.38 3.11 1960,1 1.02 4.50 4.08 1960,2 1.02 4.79 3.99 1960,3 0.47 5.56 3.99 1960,4 1.35 5.56 3.41 1961,1 3.38 4.20 1.46 1961,2 3.13 3.20 1.03 1961,3 3.51 3.10 1.63 1961,4 3.22 3.80 0.60 1962,1 3.30 3.00 1.37 1962,2 3.76 3.10 1.45 1962,3 3.12 3.30 2.48 1962,4 1.68 4.40 2.93 1963,1 3.27 3.40 2.01 1963,2 2.85 3.70 2.62 1963,3 2.52 3.90 3.93 1963,4 3.28 5.10 3.30 1964,1 2.11 3.40 3.70 1964,2 1.89 3.70 3.59 1964,3 2.58 3.90 3.66 1964,4 2.33 5.40 1.85 1965,1 2.05 4.10 2.36 1965,2 3.10 4.70 2.95 1965,3 3.84 5.20 3.23 1965,4 3.81 6.60 3.83 1966,1 4.12 5.50 3.66 1966,2 4.12 6.50 4.30 1966,3 3.19 6.90 4.45 1966,4 2.97 7.70 4.74 1967,1 2.36 5.40 5.14 1967,2 1.60 4.10 4.62 1967,3 1.63 3.50 6.47 1967,4 0.88 4.10 5.49 1968,1 1.70 3.40 5.85 1968,2 1.43 3.70 4.18 1968,3 1.47 3.60 2.88 1968,4 1.87 4.60 4.21 1969,1 1.57 4.00 3.25 1969,2 1.90 4.80 3.27 1969,3 2.09 6.30 3.17 1969,4 2.01 8.00 1.66 1970,1 3.19 9.40 1.10 1970,2 3.33 9.75 -0.52 1970,3 3.51 9.24 0.58 1970,4 3.90 8.71 0.91 1971,1 5.09 7.37 -0.06 1971,2 4.93 6.35 0.52 1971,3 5.01 7.50 0.99 1971,4 5.40 6.97 0.26 1972,1 5.81 4.89 2.02 1972,2 5.37 4.65 3.04 1972,3 5.35 4.85 3.38 1972,4 5.85 7.74 3.17 1973,1 5.66 8.09 2.79 1973,2 6.86 12.05 3.32 1973,3 6.19 14.17 4.09 1973,4 7.26 13.58 2.29 1974,1 6.86 11.16 4.59 1974,2 7.20 9.41 3.95 1974,3 7.41 9.47 3.24 1974,4 7.12 9.01 2.34 1975,1 6.59 6.53 1.94 1975,2 5.90 4.85 2.41 1975,3 6.31 4.10 3.67 1975,4 5.25 4.08 4.26 1976,1 5.19 3.74 4.71 1976,2 4.39 3.79 4.46 1976,3 4.01 4.47 3.71 1976,4 3.40 4.76 4.68 1977,1 3.33 4.67 3.59 1977,2 3.29 4.38 2.55 1977,3 3.41 4.13 3.00 1977,4 3.07 4.03 1.69 1978,1 2.42 3.47 1.48 1978,2 2.56 3.56 1.71 1978,3 2.83 3.66 1.55 1978,4 2.72 3.90 2.62 1979,1 3.14 4.11 3.20 1979,2 3.47 5.89 4.53 1979,3 4.35 7.17 3.96 1979,4 5.57 9.20 3.61 1980,1 5.50 9.03 3.85 1980,2 6.56 10.05 3.07 1980,3 5.76 9.09 3.31 1980,4 5.52 9.44 4.16 1981,1 5.46 11.09 5.90 1981,2 5.93 12.98 7.15 1981,3 6.65 12.61 7.34 1981,4 6.67 11.07 5.30 1982,1 5.75 10.06 4.79 1982,2 5.14 9.13 4.73 1982,3 5.28 8.76 4.51 1982,4 4.29 7.07 4.33 1983,1 3.96 5.62 3.75 1983,2 3.31 5.29 4.65 1983,3 2.93 5.64 5.40 1983,4 2.66 6.23 5.15 1984,1 3.19 5.89 5.61 1984,2 2.93 5.94 5.73 1984,3 1.99 5.91 6.26 1984,4 2.07 5.87 5.28 1985,1 2.34 6.05 5.80 1985,2 1.84 5.77 5.25 1985,3 1.71 4.87 4.26 1985,4 1.27 4.76 4.29 1986,1 0.45 4.50 3.01 1986,2 -0.65 4.50 2.21 1986,3 -0.82 4.50 2.75 1986,4 -1.13 4.60 3.25 1987,1 -0.50 4.09 3.11 1987,2 0.67 3.73 3.15 1987,3 0.73 3.87 4.78 1987,4 0.89 4.04 4.66 1988,1 0.96 3.32 4.62 1988,2 1.22 3.56 4.50 1988,3 1.40 4.99 4.68 1988,4 1.74 5.03 4.28 1989,1 2.63 6.13 4.52 1989,2 3.04 6.70 4.94 1989,3 2.99 7.04 4.29 1989,4 2.97 8.01 5.08 1990,1 2.44 8.20 5.48 1990,2 1.97 8.14 5.62 1990,3 2.96 8.39 5.38 1990,4 3.18 8.90 6.42 1991,1 2.97 9.17 5.81 1991,2 3.62 9.11 4.42 1991,3 4.36 9.24 4.92 1991,4 3.98 9.46 4.23 1992,1 4.37 9.61 3.44 1992,2 4.57 9.76 4.14 1992,3 3.29 9.72 3.80 1992,4 2.96 8.97 3.41 1993,1 3.57 8.32 3.10 1993,2 3.12 7.68 3.00 1993,3 2.98 6.83 3.55 1993,4 3.31 6.35 3.05 1994,1 2.94 5.88 3.17 1994,2 2.58 5.29 4.82 1994,3 2.60 5.01 5.27 1994,4 2.49 5.28 5.62 $usekernel [1] FALSE $varnames [1] "BSP91JW" "CP91JW" "DEFRATE" "EWAJW" "EXIMRATE" "GM1JW" [7] "IAU91JW" "IB91JW" "LSTKJW" "PBSPJW" "PCPJW" "ZINSK" [13] "ZINSLR" attr(,"class") [1] "NaiveBayes" > predict(NB) $class 1955,4 1956,1 1956,2 1956,3 1956,4 1957,1 1957,2 1957,3 1957,4 1958,1 1958,2 2 2 2 2 3 1 3 2 1 3 3 1958,3 1958,4 1959,1 1959,2 1959,3 1959,4 1960,1 1960,2 1960,3 1960,4 1961,1 1 1 1 1 1 1 2 2 2 2 2 1961,2 1961,3 1961,4 1962,1 1962,2 1962,3 1962,4 1963,1 1963,2 1963,3 1963,4 2 3 3 3 2 1 1 4 1 1 1 1964,1 1964,2 1964,3 1964,4 1965,1 1965,2 1965,3 1965,4 1966,1 1966,2 1966,3 1 1 1 2 1 2 3 1 1 1 3 1966,4 1967,1 1967,2 1967,3 1967,4 1968,1 1968,2 1968,3 1968,4 1969,1 1969,2 3 4 4 4 4 1 1 1 1 2 2 1969,3 1969,4 1970,1 1970,2 1970,3 1970,4 1971,1 1971,2 1971,3 1971,4 1972,1 2 2 3 3 3 3 3 3 3 3 3 1972,2 1972,3 1972,4 1973,1 1973,2 1973,3 1973,4 1974,1 1974,2 1974,3 1974,4 3 3 3 3 3 3 3 3 4 4 4 1975,1 1975,2 1975,3 1975,4 1976,1 1976,2 1976,3 1976,4 1977,1 1977,2 1977,3 4 4 4 4 1 1 1 1 1 1 1 1977,4 1978,1 1978,2 1978,3 1978,4 1979,1 1979,2 1979,3 1979,4 1980,1 1980,2 1 1 1 1 1 1 1 2 3 2 3 1980,3 1980,4 1981,1 1981,2 1981,3 1981,4 1982,1 1982,2 1982,3 1982,4 1983,1 3 3 3 3 3 3 3 3 3 4 4 1983,2 1983,3 1983,4 1984,1 1984,2 1984,3 1984,4 1985,1 1985,2 1985,3 1985,4 1 1 1 1 1 1 1 4 1 1 1 1986,1 1986,2 1986,3 1986,4 1987,1 1987,2 1987,3 1987,4 1988,1 1988,2 1988,3 1 1 1 1 1 1 1 1 1 1 1 1988,4 1989,1 1989,2 1989,3 1989,4 1990,1 1990,2 1990,3 1990,4 1991,1 1991,2 1 1 1 1 1 2 2 2 2 2 2 1991,3 1991,4 1992,1 1992,2 1992,3 1992,4 1993,1 1993,2 1993,3 1993,4 1994,1 2 3 3 3 3 3 3 3 4 4 4 1994,2 1994,3 1994,4 4 4 1 Levels: 1 2 3 4 $posterior 1 2 3 4 1955,4 1.961720e-06 9.998297e-01 1.682367e-04 1.511149e-07 1956,1 2.725294e-07 9.998529e-01 1.454627e-04 1.340705e-06 1956,2 8.227504e-04 9.986461e-01 5.279898e-04 3.196076e-06 1956,3 2.662015e-02 9.211345e-01 5.157259e-02 6.727121e-04 1956,4 1.193202e-02 4.419464e-01 5.380011e-01 8.120515e-03 1957,1 9.721137e-01 2.503533e-02 2.212928e-03 6.380878e-04 1957,2 1.701378e-01 1.004268e-01 6.944220e-01 3.501336e-02 1957,3 2.457405e-01 4.205937e-01 3.252978e-01 8.367993e-03 1957,4 9.187352e-01 6.102807e-02 1.855646e-02 1.680234e-03 1958,1 5.081683e-04 1.131698e-04 5.070331e-01 4.923455e-01 1958,2 1.943208e-02 1.986254e-03 7.858109e-01 1.927708e-01 1958,3 9.970857e-01 2.246141e-03 3.407923e-04 3.273520e-04 1958,4 9.986592e-01 9.506012e-04 7.495282e-05 3.152431e-04 1959,1 9.736562e-01 1.065345e-03 1.587433e-04 2.511973e-02 1959,2 9.865946e-01 1.036829e-02 9.042384e-05 2.946644e-03 1959,3 9.959751e-01 3.712509e-03 6.048961e-05 2.518642e-04 1959,4 8.599144e-01 1.398020e-01 2.528520e-04 3.073340e-05 1960,1 2.798919e-01 7.196743e-01 3.987206e-04 3.504431e-05 1960,2 4.607125e-02 9.530178e-01 8.952757e-04 1.569394e-05 1960,3 1.340201e-02 9.853072e-01 1.274434e-03 1.632325e-05 1960,4 4.026154e-02 9.563229e-01 3.386716e-03 2.887812e-05 1961,1 2.158653e-05 9.913308e-01 8.641272e-03 6.321023e-06 1961,2 4.085657e-04 5.608774e-01 4.371963e-01 1.517792e-03 1961,3 8.854073e-04 2.423686e-01 7.493607e-01 7.385279e-03 1961,4 3.597370e-04 5.287253e-02 9.185744e-01 2.819338e-02 1962,1 6.157814e-02 9.512097e-02 7.927668e-01 5.053413e-02 1962,2 3.337558e-03 7.921593e-01 2.017655e-01 2.737631e-03 1962,3 7.559177e-01 1.944425e-01 4.850094e-02 1.138797e-03 1962,4 6.105014e-01 3.003695e-01 8.566291e-02 3.466147e-03 1963,1 1.525585e-03 1.690451e-08 1.180976e-01 8.803768e-01 1963,2 8.179509e-01 3.155038e-03 1.695000e-01 9.394045e-03 1963,3 9.958953e-01 7.782730e-04 2.685747e-03 6.407015e-04 1963,4 9.930218e-01 2.034659e-03 4.198763e-03 7.447749e-04 1964,1 9.914927e-01 3.328988e-03 2.751771e-05 5.150817e-03 1964,2 9.966235e-01 3.136845e-03 1.688347e-04 7.081805e-05 1964,3 9.901247e-01 7.135699e-03 2.561811e-03 1.777535e-04 1964,4 2.394750e-01 6.167823e-01 1.410114e-01 2.731397e-03 1965,1 6.012770e-01 3.795439e-01 1.881711e-02 3.619044e-04 1965,2 1.055641e-01 7.927508e-01 1.013172e-01 3.678758e-04 1965,3 4.313911e-03 4.741627e-01 5.205206e-01 1.002826e-03 1965,4 5.480155e-01 2.875002e-01 1.601201e-01 4.364136e-03 1966,1 3.675932e-01 3.638831e-01 2.643740e-01 4.149715e-03 1966,2 6.123943e-01 1.467950e-02 3.560678e-01 1.685837e-02 1966,3 1.952191e-01 2.779730e-04 6.866969e-01 1.178061e-01 1966,4 1.361442e-03 1.156773e-07 5.251737e-01 4.734648e-01 1967,1 1.600757e-05 2.744222e-14 2.160274e-02 9.783813e-01 1967,2 2.262887e-07 1.847513e-17 5.353693e-04 9.994644e-01 1967,3 8.835728e-07 4.077587e-17 9.267990e-05 9.999064e-01 1967,4 3.883022e-02 4.017185e-10 3.828026e-04 9.607870e-01 1968,1 7.819538e-01 3.896380e-08 2.394389e-03 2.156518e-01 1968,2 9.992650e-01 4.820123e-05 2.301232e-04 4.566742e-04 1968,3 9.752538e-01 2.359551e-02 1.083764e-03 6.695745e-05 1968,4 8.919585e-01 1.067978e-01 1.191146e-03 5.252941e-05 1969,1 1.625712e-02 9.798581e-01 3.879199e-03 5.543316e-06 1969,2 2.171018e-02 9.774504e-01 8.363663e-04 3.103232e-06 1969,3 8.389885e-04 9.981355e-01 1.024043e-03 1.504670e-06 1969,4 1.797602e-06 8.064271e-01 1.933118e-01 2.593828e-04 1970,1 2.094992e-12 3.483530e-03 9.960902e-01 4.262764e-04 1970,2 1.065063e-16 9.904262e-05 9.986767e-01 1.224219e-03 1970,3 1.427173e-16 2.162371e-05 9.975659e-01 2.412439e-03 1970,4 1.584092e-12 1.286897e-03 9.948183e-01 3.894754e-03 1971,1 6.196699e-11 1.251185e-02 9.462568e-01 4.123131e-02 1971,2 1.532268e-09 3.628726e-04 9.379773e-01 6.165986e-02 1971,3 2.053873e-10 1.408280e-05 8.786006e-01 1.213853e-01 1971,4 1.412347e-10 7.751205e-07 6.020274e-01 3.979719e-01 1972,1 9.073672e-04 4.518539e-02 7.984434e-01 1.554638e-01 1972,2 1.369100e-02 3.446872e-03 7.663863e-01 2.164759e-01 1972,3 2.073604e-02 2.110205e-02 8.225081e-01 1.356538e-01 1972,4 2.097584e-04 6.580543e-02 8.566557e-01 7.732909e-02 1973,1 2.774870e-05 2.366503e-01 7.453579e-01 1.796398e-02 1973,2 6.900687e-13 5.195201e-04 9.972629e-01 2.217533e-03 1973,3 1.028483e-18 4.450610e-06 9.998931e-01 1.024180e-04 1973,4 3.055332e-22 1.870199e-09 9.968906e-01 3.109430e-03 1974,1 2.638340e-13 5.673335e-10 9.820729e-01 1.792710e-02 1974,2 2.775176e-15 3.773360e-13 3.550137e-01 6.449863e-01 1974,3 2.826815e-16 5.892309e-14 5.352409e-02 9.464759e-01 1974,4 1.545132e-19 4.003116e-17 1.575364e-02 9.842464e-01 1975,1 1.862394e-15 2.132987e-17 1.214670e-03 9.987853e-01 1975,2 1.097539e-09 1.537491e-12 2.798841e-03 9.972012e-01 1975,3 5.136249e-07 1.158737e-10 6.959544e-03 9.930399e-01 1975,4 4.018182e-03 3.567674e-05 1.941898e-02 9.765272e-01 1976,1 6.451090e-01 2.587362e-03 2.328831e-02 3.290153e-01 1976,2 9.855927e-01 4.784169e-03 4.620469e-03 5.002628e-03 1976,3 8.237013e-01 9.422178e-03 1.393858e-01 2.749072e-02 1976,4 9.918375e-01 4.768302e-03 2.944955e-03 4.491979e-04 1977,1 9.849947e-01 6.658376e-03 7.072824e-03 1.274068e-03 1977,2 8.268290e-01 1.784672e-03 1.446794e-01 2.670695e-02 1977,3 9.586371e-01 3.845842e-03 3.558336e-02 1.933657e-03 1977,4 8.940424e-01 9.319842e-03 7.823839e-02 1.839936e-02 1978,1 9.202016e-01 4.486760e-03 4.055772e-02 3.475393e-02 1978,2 9.761998e-01 1.349049e-02 7.109766e-03 3.199920e-03 1978,3 7.727070e-01 1.187699e-01 9.652873e-02 1.199438e-02 1978,4 9.729738e-01 1.423925e-02 9.293235e-03 3.493743e-03 1979,1 9.812490e-01 9.935592e-03 7.371601e-03 1.443819e-03 1979,2 8.401804e-01 1.542440e-01 5.339781e-03 2.358129e-04 1979,3 1.509435e-01 5.122655e-01 3.353810e-01 1.409991e-03 1979,4 9.210342e-05 3.179878e-01 6.785973e-01 3.322860e-03 1980,1 5.073234e-05 8.248037e-01 1.737937e-01 1.351907e-03 1980,2 4.887411e-13 4.634769e-07 9.960843e-01 3.915273e-03 1980,3 1.753453e-08 3.582743e-05 9.987704e-01 1.193776e-03 1980,4 9.683898e-09 2.613266e-07 9.487000e-01 5.129975e-02 1981,1 2.092203e-10 2.567401e-08 9.312033e-01 6.879665e-02 1981,2 2.418930e-13 3.923265e-08 9.950113e-01 4.988696e-03 1981,3 1.294583e-13 2.128817e-08 9.936171e-01 6.382864e-03 1981,4 5.386951e-11 9.434812e-09 8.658293e-01 1.341707e-01 1982,1 9.795687e-11 2.617755e-10 5.031552e-01 4.968448e-01 1982,2 2.012270e-06 3.511095e-09 5.189505e-01 4.810475e-01 1982,3 1.590362e-08 7.353091e-11 5.813743e-01 4.186256e-01 1982,4 1.250932e-04 3.383522e-09 2.524427e-01 7.474322e-01 1983,1 7.305237e-03 8.775321e-08 2.923732e-02 9.634574e-01 1983,2 4.907065e-01 9.135850e-07 1.942349e-02 4.898691e-01 1983,3 8.784351e-01 1.111365e-05 1.446200e-02 1.070918e-01 1983,4 9.839715e-01 4.949721e-05 2.676952e-03 1.330209e-02 1984,1 9.741630e-01 1.300378e-04 9.367514e-03 1.633949e-02 1984,2 5.890573e-01 8.632453e-07 1.150518e-01 2.958899e-01 1984,3 9.705843e-01 1.852511e-05 4.630806e-03 2.476632e-02 1984,4 9.935467e-01 1.506638e-05 3.056606e-03 3.381626e-03 1985,1 4.509543e-01 2.184255e-07 7.954432e-03 5.410910e-01 1985,2 9.965000e-01 1.298857e-04 2.234725e-03 1.135361e-03 1985,3 9.988147e-01 3.162336e-05 5.338527e-04 6.198167e-04 1985,4 9.994383e-01 6.608526e-06 2.393003e-04 3.157738e-04 1986,1 9.965564e-01 7.213467e-05 1.699421e-03 1.672039e-03 1986,2 9.974265e-01 1.616979e-03 4.577026e-04 4.988483e-04 1986,3 9.983348e-01 1.439885e-04 4.236895e-04 1.097526e-03 1986,4 9.995529e-01 6.107146e-05 1.316635e-04 2.543601e-04 1987,1 9.989369e-01 1.555062e-05 1.686840e-04 8.788960e-04 1987,2 9.969070e-01 1.350524e-05 1.263074e-03 1.816461e-03 1987,3 9.988073e-01 2.811927e-06 7.976964e-05 1.110130e-03 1987,4 9.996011e-01 4.562694e-06 1.195527e-04 2.748149e-04 1988,1 9.996675e-01 6.326529e-05 1.533911e-05 2.539242e-04 1988,2 9.995163e-01 2.991580e-06 5.786961e-05 4.228720e-04 1988,3 9.995152e-01 7.508808e-06 5.315830e-05 4.241440e-04 1988,4 9.996969e-01 1.022402e-05 1.455993e-04 1.473204e-04 1989,1 9.977010e-01 1.981941e-03 2.892687e-04 2.783130e-05 1989,2 9.840920e-01 1.065045e-02 4.981342e-03 2.761781e-04 1989,3 9.806887e-01 2.981456e-03 1.538676e-02 9.430893e-04 1989,4 9.173311e-01 3.708407e-02 4.456798e-02 1.016846e-03 1990,1 5.881725e-02 9.286735e-01 1.248644e-02 2.285569e-05 1990,2 4.490587e-02 9.315033e-01 2.342148e-02 1.693210e-04 1990,3 2.903430e-05 9.999102e-01 5.813403e-05 2.636599e-06 1990,4 4.443323e-07 9.999779e-01 2.104774e-05 5.653727e-07 1991,1 3.828776e-13 9.999998e-01 8.374232e-08 1.302181e-07 1991,2 1.101553e-06 9.999066e-01 9.107449e-05 1.268468e-06 1991,3 3.587262e-03 8.600240e-01 1.357182e-01 6.705336e-04 1991,4 6.451509e-04 6.101770e-02 9.376315e-01 7.056209e-04 1992,1 9.294735e-05 9.768898e-03 9.883252e-01 1.812930e-03 1992,2 4.304148e-05 7.447910e-05 9.938598e-01 6.022683e-03 1992,3 6.499784e-05 8.935077e-05 9.873107e-01 1.253499e-02 1992,4 2.046134e-03 8.820034e-05 9.557525e-01 4.211312e-02 1993,1 1.358151e-07 1.765459e-12 8.510096e-01 1.489902e-01 1993,2 9.964731e-06 5.510639e-12 8.141779e-01 1.858122e-01 1993,3 2.289546e-04 8.538011e-12 6.612378e-02 9.336473e-01 1993,4 8.363168e-05 2.963162e-12 4.704661e-01 5.294503e-01 1994,1 2.563580e-01 7.052395e-08 1.474823e-01 5.961597e-01 1994,2 4.301713e-01 7.324543e-08 4.857448e-02 5.212542e-01 1994,3 4.480383e-01 4.208724e-08 6.167426e-03 5.457942e-01 1994,4 8.894851e-01 2.811280e-06 6.588061e-03 1.039240e-01 There were 50 or more warnings (use warnings() to see the first 50) > > # S-KNN > # numerical too instable to check posteriors > SK <- sknn(PHASEN ~ ., data = B3) > predict(SK, B3)$class [1] 2 3 2 3 3 1 3 3 3 3 3 4 4 4 1 1 1 1 2 2 2 2 2 3 3 3 3 1 2 4 1 1 1 1 2 3 2 [38] 1 3 3 1 1 1 3 1 4 4 4 1 1 1 2 1 1 2 2 2 3 3 3 3 3 3 4 4 2 1 1 2 2 2 3 3 3 [75] 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3 4 4 3 4 4 [112] 4 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 1 3 3 [149] 3 3 3 3 4 3 1 1 1 Levels: 1 2 3 4 > SK <- sknn(PHASEN ~ ., data = B3, gamma = 10, kn = 10) > predict(SK, B3)$class [1] 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 1 1 1 2 2 2 2 2 3 3 3 3 3 3 4 1 1 1 1 1 1 2 [38] 2 2 3 3 3 3 3 3 4 4 4 4 1 1 1 1 1 1 2 2 3 3 3 3 3 4 4 4 4 1 1 2 2 3 3 3 3 [75] 4 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 [112] 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 [149] 3 3 3 3 3 3 4 1 1 Levels: 1 2 3 4 > > > ## SVMlight > ## this works on Windows only, hence omitted for the meantime: > #if(class(try(system("svm_learn -?", intern = TRUE))) == "try-error"){ > # cat("SVMlight seems not to be installed, hence svmlight cannot be used", "\n", > # "and these differences are expected") > #}else{ > # print(SVM <- svmlight(PHASEN ~ ., data = B3)) > # predict(SVM, B3) > #} > > # RDA > set.seed(123) > rda(PHASEN ~ ., data = B3) Call: rda(formula = PHASEN ~ ., data = B3) Regularization parameters: gamma lambda 0.004460746 0.065747844 Prior probabilities of groups: 1 2 3 4 0.3757962 0.1528662 0.2993631 0.1719745 Misclassification rate: apparent: 8.28 % cross-validated: 18.81 % > rB3 <- rda(PHASEN ~ ., gamma = 0.05, lambda = 0.2, data = B3) > print(pB3 <- predict(rB3)) $class [1] 2 2 2 3 3 3 3 3 1 4 3 1 1 4 1 1 1 1 2 2 2 2 2 3 3 3 3 1 3 4 1 1 1 1 1 1 2 [38] 1 2 3 2 2 1 3 3 4 4 4 4 1 1 1 1 1 1 2 2 3 3 3 3 3 3 4 4 4 1 4 2 2 3 3 3 3 [75] 4 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3 4 3 3 4 4 [112] 4 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 [149] 3 3 3 3 3 3 4 1 1 Levels: 1 2 3 4 $posterior 1 2 3 4 [1,] 6.942790e-03 9.927492e-01 3.043962e-04 3.600808e-06 [2,] 7.647745e-05 9.897550e-01 1.009467e-02 7.383126e-05 [3,] 9.062095e-02 8.527306e-01 5.589550e-02 7.529514e-04 [4,] 6.700512e-03 3.073665e-02 9.572473e-01 5.315568e-03 [5,] 5.719925e-05 1.383715e-03 9.968024e-01 1.756724e-03 [6,] 1.896356e-01 7.526959e-04 8.045757e-01 5.036085e-03 [7,] 5.547387e-07 3.010765e-07 9.999696e-01 2.952649e-05 [8,] 1.819160e-02 2.308294e-02 9.327086e-01 2.601685e-02 [9,] 5.996693e-01 8.628658e-02 2.679203e-01 4.612377e-02 [10,] 6.004345e-02 1.392043e-02 3.346671e-01 5.913691e-01 [11,] 1.003635e-01 7.312930e-03 8.316434e-01 6.068021e-02 [12,] 7.294878e-01 1.434697e-02 3.654677e-02 2.196184e-01 [13,] 6.361148e-01 1.715753e-02 1.370792e-02 3.330198e-01 [14,] 4.899453e-02 4.549081e-05 1.078322e-02 9.401768e-01 [15,] 6.714158e-01 1.221396e-03 2.121639e-04 3.271507e-01 [16,] 9.695211e-01 8.409688e-04 2.603575e-04 2.937753e-02 [17,] 9.910278e-01 6.737371e-03 9.527392e-05 2.139569e-03 [18,] 9.955805e-01 4.114827e-03 1.026149e-05 2.943645e-04 [19,] 3.104389e-02 9.666615e-01 2.129448e-03 1.651206e-04 [20,] 5.439049e-03 9.932890e-01 1.255627e-03 1.632558e-05 [21,] 2.960840e-02 9.640842e-01 6.265995e-03 4.138753e-05 [22,] 4.154773e-02 9.168291e-01 4.161793e-02 5.261494e-06 [23,] 3.849063e-02 6.412402e-01 3.201575e-01 1.116339e-04 [24,] 3.278434e-02 1.732948e-02 9.274074e-01 2.247877e-02 [25,] 7.020066e-02 1.498866e-02 8.376872e-01 7.712349e-02 [26,] 2.798119e-01 4.156664e-02 5.941885e-01 8.443296e-02 [27,] 8.381007e-02 9.640964e-02 6.507756e-01 1.690047e-01 [28,] 8.814566e-01 5.773790e-02 5.710043e-02 3.705026e-03 [29,] 2.309855e-01 1.872573e-01 4.898522e-01 9.190494e-02 [30,] 3.552633e-02 4.348100e-08 5.234078e-02 9.121329e-01 [31,] 8.455779e-01 1.623748e-02 1.167102e-01 2.147438e-02 [32,] 8.999370e-01 8.462191e-03 5.515510e-02 3.644574e-02 [33,] 9.366329e-01 9.000817e-03 4.261839e-02 1.174788e-02 [34,] 9.997969e-01 1.196996e-08 1.023638e-05 1.928911e-04 [35,] 9.887302e-01 2.398172e-03 2.014645e-03 6.856976e-03 [36,] 8.863881e-01 4.625837e-02 4.245628e-02 2.489729e-02 [37,] 3.527411e-01 3.655845e-01 2.591925e-01 2.248186e-02 [38,] 7.879863e-01 1.721611e-01 3.389268e-02 5.959891e-03 [39,] 1.190944e-01 4.643346e-01 3.911646e-01 2.540642e-02 [40,] 2.068175e-02 5.915670e-02 8.976908e-01 2.247071e-02 [41,] 1.437270e-01 5.602786e-01 2.856228e-01 1.037157e-02 [42,] 2.956024e-01 4.203624e-01 2.632094e-01 2.082582e-02 [43,] 4.509460e-01 1.321251e-01 3.769406e-01 3.998831e-02 [44,] 1.578066e-01 1.553900e-02 5.596444e-01 2.670099e-01 [45,] 6.895632e-02 3.455236e-04 7.033785e-01 2.273196e-01 [46,] 7.041558e-04 7.543904e-09 4.566468e-02 9.536312e-01 [47,] 1.546782e-03 8.125607e-10 2.752750e-03 9.957005e-01 [48,] 3.522435e-03 1.588912e-10 1.517692e-03 9.949599e-01 [49,] 1.992502e-01 1.974532e-07 7.809900e-06 8.007418e-01 [50,] 7.648973e-01 1.638195e-06 1.168094e-02 2.234202e-01 [51,] 9.745595e-01 3.974790e-03 2.481479e-03 1.898420e-02 [52,] 9.876819e-01 1.186769e-02 2.177213e-04 2.326984e-04 [53,] 8.368267e-01 1.366525e-01 2.608153e-02 4.392407e-04 [54,] 9.406611e-01 5.933723e-02 1.504154e-06 1.462339e-07 [55,] 6.698945e-01 3.295119e-01 5.689007e-04 2.471528e-05 [56,] 1.987790e-01 7.997663e-01 1.412071e-03 4.258984e-05 [57,] 1.068901e-03 8.284897e-01 1.703640e-01 7.737838e-05 [58,] 1.860920e-07 2.623835e-03 9.973755e-01 4.538093e-07 [59,] 1.297534e-08 1.407961e-04 9.998589e-01 2.605728e-07 [60,] 1.087699e-08 1.419623e-05 9.999808e-01 4.952973e-06 [61,] 8.077134e-07 2.596312e-04 9.997126e-01 2.699165e-05 [62,] 4.286263e-04 8.010001e-03 9.904213e-01 1.140105e-03 [63,] 4.339579e-03 5.468052e-03 5.076366e-01 4.825558e-01 [64,] 9.417687e-05 3.062234e-03 5.497678e-02 9.418668e-01 [65,] 7.492873e-04 2.520980e-03 2.840197e-02 9.683278e-01 [66,] 1.282732e-01 1.103140e-01 9.884957e-02 6.625632e-01 [67,] 7.862979e-01 4.022073e-02 5.321355e-02 1.202678e-01 [68,] 1.473756e-01 8.240449e-02 2.218995e-01 5.483204e-01 [69,] 2.409145e-03 8.009065e-01 4.866028e-02 1.480240e-01 [70,] 1.367285e-03 8.247440e-01 7.648807e-02 9.740067e-02 [71,] 2.940653e-07 4.217433e-02 9.488010e-01 9.024400e-03 [72,] 2.307109e-10 4.698116e-05 9.997909e-01 1.621123e-04 [73,] 4.465587e-11 3.036653e-05 9.999261e-01 4.357205e-05 [74,] 1.008364e-06 1.397998e-05 9.803526e-01 1.963241e-02 [75,] 5.378207e-08 3.566385e-05 4.048701e-02 9.594773e-01 [76,] 9.940991e-08 1.554199e-04 2.140265e-02 9.784418e-01 [77,] 3.946174e-09 3.917676e-06 1.436568e-03 9.985595e-01 [78,] 3.288936e-06 5.600055e-08 2.806944e-04 9.997160e-01 [79,] 3.522214e-04 9.622799e-08 9.020333e-05 9.995575e-01 [80,] 4.364671e-03 1.075367e-06 5.725980e-04 9.950617e-01 [81,] 9.781672e-03 3.498578e-06 5.460466e-06 9.902094e-01 [82,] 9.376810e-01 4.071172e-05 2.022425e-05 6.225806e-02 [83,] 9.930419e-01 3.162838e-04 3.300418e-04 6.311796e-03 [84,] 9.166108e-01 1.926710e-02 3.917338e-02 2.494869e-02 [85,] 9.821079e-01 6.838348e-03 1.068349e-02 3.702596e-04 [86,] 9.385346e-01 2.317953e-02 3.487979e-02 3.406083e-03 [87,] 8.885527e-01 1.634823e-02 7.882935e-02 1.626976e-02 [88,] 9.213734e-01 2.029628e-02 4.459041e-02 1.373994e-02 [89,] 9.757631e-01 3.209678e-03 1.071968e-02 1.030759e-02 [90,] 9.709081e-01 1.136756e-03 9.962744e-03 1.799244e-02 [91,] 9.678462e-01 1.857664e-03 7.450178e-03 2.284596e-02 [92,] 9.537166e-01 1.023387e-02 1.309516e-02 2.295438e-02 [93,] 9.594638e-01 4.443761e-03 1.442751e-02 2.166495e-02 [94,] 9.871159e-01 8.530329e-03 2.591114e-03 1.762637e-03 [95,] 2.946894e-01 6.632970e-01 3.521684e-02 6.796800e-03 [96,] 1.263967e-01 6.299788e-01 2.376755e-01 5.948956e-03 [97,] 2.753108e-03 8.062821e-01 1.909116e-01 5.312984e-05 [98,] 3.370938e-05 9.944917e-01 5.474508e-03 8.157221e-08 [99,] 2.888803e-06 7.282194e-03 9.925710e-01 1.438743e-04 [100,] 1.756064e-04 1.179022e-02 9.874322e-01 6.020181e-04 [101,] 3.731948e-04 8.145761e-04 9.883283e-01 1.048394e-02 [102,] 8.491857e-06 1.598193e-04 9.992996e-01 5.321282e-04 [103,] 1.965387e-07 1.434501e-04 9.998120e-01 4.437233e-05 [104,] 5.495622e-07 6.865601e-05 9.998810e-01 4.981355e-05 [105,] 3.538001e-04 4.304248e-05 9.985662e-01 1.036909e-03 [106,] 3.220470e-04 3.726455e-04 9.932224e-01 6.082945e-03 [107,] 7.466417e-03 2.785562e-04 4.876772e-01 5.045778e-01 [108,] 3.498756e-03 2.031328e-03 6.437108e-01 3.507591e-01 [109,] 1.414110e-01 5.022247e-04 5.512046e-01 3.068821e-01 [110,] 2.952905e-01 1.356278e-04 1.391178e-02 6.906621e-01 [111,] 2.123452e-01 1.146624e-04 2.401280e-03 7.851389e-01 [112,] 1.128972e-01 1.425175e-03 4.245606e-03 8.814321e-01 [113,] 9.381578e-01 5.691725e-04 7.636532e-05 6.119663e-02 [114,] 9.681848e-01 1.406739e-03 2.357167e-02 6.836806e-03 [115,] 2.347275e-01 1.397137e-05 5.943108e-01 1.709477e-01 [116,] 9.774534e-01 9.327398e-05 1.968943e-03 2.048441e-02 [117,] 9.960263e-01 3.964782e-05 2.393833e-03 1.540192e-03 [118,] 9.999107e-01 2.078851e-06 5.617436e-06 8.158779e-05 [119,] 9.994623e-01 5.316328e-04 1.474660e-06 4.577146e-06 [120,] 9.894398e-01 3.973213e-04 2.242251e-03 7.920622e-03 [121,] 9.996827e-01 8.307136e-05 2.851031e-05 2.057149e-04 [122,] 9.986189e-01 4.157476e-05 1.028050e-03 3.114905e-04 [123,] 9.934785e-01 2.358993e-04 1.327313e-03 4.958288e-03 [124,] 9.901955e-01 2.021730e-05 5.910440e-03 3.873856e-03 [125,] 9.961419e-01 7.699575e-07 2.773286e-03 1.084088e-03 [126,] 9.995595e-01 4.646496e-06 2.015046e-04 2.343013e-04 [127,] 9.845399e-01 4.520737e-05 1.001541e-02 5.399465e-03 [128,] 9.779142e-01 1.985930e-04 2.260811e-03 1.962639e-02 [129,] 9.907489e-01 2.077461e-04 1.049305e-03 7.994011e-03 [130,] 9.825595e-01 4.754348e-06 1.626150e-03 1.580959e-02 [131,] 9.947707e-01 1.606623e-05 3.326245e-04 4.880619e-03 [132,] 9.923358e-01 5.150251e-04 3.154550e-04 6.833741e-03 [133,] 9.993641e-01 5.587044e-05 3.458794e-05 5.454427e-04 [134,] 9.964929e-01 8.295652e-04 8.703139e-04 1.807235e-03 [135,] 9.993284e-01 2.589435e-04 4.832574e-05 3.642894e-04 [136,] 9.976417e-01 1.781785e-03 3.915988e-04 1.849545e-04 [137,] 9.927352e-01 7.131440e-03 9.980253e-05 3.355155e-05 [138,] 9.521648e-01 4.783418e-02 9.700578e-07 4.459522e-09 [139,] 3.669959e-01 6.302931e-01 2.145202e-03 5.657211e-04 [140,] 5.226792e-07 9.999993e-01 5.406548e-09 2.074386e-07 [141,] 1.729160e-10 1.000000e+00 2.120390e-11 3.568799e-10 [142,] 6.303822e-18 1.000000e+00 1.493150e-19 4.189471e-18 [143,] 5.020237e-07 9.999899e-01 3.839961e-07 9.220911e-06 [144,] 2.782988e-02 9.673782e-01 4.642069e-03 1.498405e-04 [145,] 7.945330e-02 6.930278e-01 2.266465e-01 8.723703e-04 [146,] 2.774110e-02 4.100136e-02 9.309527e-01 3.048727e-04 [147,] 2.269299e-02 3.736710e-02 8.859553e-01 5.398461e-02 [148,] 5.312299e-03 6.118956e-03 9.823323e-01 6.236424e-03 [149,] 9.987911e-04 3.616040e-04 9.939304e-01 4.709173e-03 [150,] 6.887435e-04 9.385831e-08 9.895580e-01 9.753200e-03 [151,] 1.280251e-04 2.369129e-08 9.870697e-01 1.280230e-02 [152,] 1.933390e-03 2.242650e-08 9.962177e-01 1.848927e-03 [153,] 6.993322e-03 2.309945e-09 9.400626e-01 5.294405e-02 [154,] 2.769703e-02 2.462646e-07 9.257812e-01 4.652153e-02 [155,] 3.311147e-01 5.778617e-07 7.565445e-02 5.932303e-01 [156,] 8.358789e-01 1.612828e-06 2.206345e-03 1.619132e-01 [157,] 9.109553e-01 6.333418e-06 3.546609e-04 8.868366e-02 > cB3 <- pB3$class > pB3 <- pB3$posterior > > # stepclass > set.seed(123) > print(SC <- stepclass(PHASEN ~ ., data = B3, method = "lda", criterion = "AS", output=FALSE)) method : lda final model : PHASEN ~ CP91JW + EWAJW + LSTKJW + ZINSK abiltity to seperate = 0.6187 > > ######### > # scaling > > ## beta scaling, e.scal > pbB3 <- b.scal(pB3, B3$PHASEN, dis = TRUE) > #betascale(pbB3) > #e.scal(pB3) > #e.scal(pB3, tc = B3$PHASEN) > > # ucpm > ucpm(pB3, B3$PHASEN) $CR [1] 0.8917197 $AC [1] 0.7635127 $AS [1] 0.8252139 $CF [1] 0.8822775 $CFvec 1 2 3 4 0.9337863 0.8371194 0.8733527 0.8253976 > ucpm(pbB3$member, B3$PHASEN) $CR [1] 0.8980892 $AC [1] 0.7754896 $AS [1] 0.8373357 $CF [1] 0.8903094 $CFvec 1 2 3 4 0.9110857 0.8714992 0.8936662 0.8557865 > > > ############## > # greedy.wilks > data(B3) > gw_obj <- greedy.wilks(PHASEN ~ ., data = B3, niveau = 0.1) > print(gw_obj, digits=4) Formula containing included variables: PHASEN ~ EWAJW + LSTKJW + ZINSK + CP91JW + IAU91JW + PBSPJW + ZINSLR + PCPJW Values calculated in each step of the selection procedure: vars Wilks.lambda F.statistics.overall p.value.overall F.statistics.diff 1 EWAJW 0.6058 33.18 1.405e-16 33.183 2 LSTKJW 0.4272 26.86 1.218e-25 21.192 3 ZINSK 0.3615 21.21 7.608e-29 9.149 4 CP91JW 0.3003 19.05 1.154e-32 10.185 5 IAU91JW 0.2625 17.11 6.598e-35 7.151 6 PBSPJW 0.2451 14.99 3.696e-35 3.500 7 ZINSLR 0.2205 13.95 1.443e-36 5.459 8 PCPJW 0.2000 13.11 9.455e-38 5.000 p.value.diff 1 1.405e-16 2 1.554e-11 3 1.327e-05 4 3.784e-06 5 1.605e-04 6 1.709e-02 7 1.379e-03 8 2.486e-03 > ldaresult <- lda(gw_obj$formula, data = B3) > gw_obj2 <- greedy.wilks(B3[,-1], B3$PHASEN, niveau = 0.1) > identical(all.equal(gw_obj$results, gw_obj2$results), TRUE) [1] TRUE > > > #### > # nm > data(B3) > x <- nm(PHASEN ~ ., data = B3) > x$learn BSP91JW CP91JW DEFRATE EWAJW EXIMRATE GM1JW IAU91JW 1 4.036102 3.545254 -1.3394915 1.0645763 3.880847 8.613390 6.893559322 2 6.312083 6.427500 -0.8479167 2.6808333 3.104167 11.015833 11.360416667 3 2.769149 3.656596 -0.8380851 1.0778723 3.013617 6.841489 -0.003404255 4 1.093333 2.620000 -1.6548148 -0.9940741 3.124815 9.607778 -1.939259259 IB91JW LSTKJW PBSPJW PCPJW ZINSK ZINSLR 1 3.397119 2.111017 2.789153 2.214746 4.715085 3.976271 2 6.830417 4.195833 3.927917 3.187917 6.836250 3.571250 3 1.673191 6.291064 4.496170 4.062128 7.682553 3.230000 4 -1.491852 4.249630 4.206296 3.938148 5.672222 3.739259 > x <- nm(PHASEN ~ ., data = B3, gamma = 0.1) > predict(x)$post 1 2 3 4 1955,4 3.472988e-12 1.000000e+00 6.256530e-28 9.209813e-38 1956,1 1.967463e-11 1.000000e+00 8.959782e-23 1.924185e-33 1956,2 1.882068e-06 9.999981e-01 2.223063e-14 5.553180e-22 1956,3 1.174916e-01 5.236247e-03 8.771519e-01 1.202531e-04 1956,4 9.067165e-05 2.234848e-08 9.968615e-01 3.047773e-03 1957,1 3.870388e-01 1.020512e-03 6.119223e-01 1.837694e-05 1957,2 5.496775e-09 3.318330e-17 6.801114e-02 9.319889e-01 1957,3 1.166941e-03 3.486237e-08 5.046809e-01 4.941521e-01 1957,4 9.151862e-01 4.514699e-04 4.943612e-02 3.492618e-02 1958,1 8.511008e-06 2.470814e-11 2.222837e-03 9.977687e-01 1958,2 9.016348e-01 8.529318e-03 7.993207e-02 9.903783e-03 1958,3 8.568335e-01 1.431629e-01 3.607673e-06 3.512772e-08 1958,4 3.067390e-01 6.932609e-01 4.717733e-08 1.233783e-10 1959,1 1.382153e-02 9.861785e-01 4.985562e-10 1.393021e-14 1959,2 9.385329e-05 9.999061e-01 1.018568e-17 1.280491e-21 1959,3 2.745819e-03 9.972542e-01 2.241443e-14 5.375662e-17 1959,4 6.405728e-05 9.999359e-01 5.953432e-17 6.669036e-21 1960,1 6.988521e-09 1.000000e+00 5.725794e-26 5.818246e-33 1960,2 3.440691e-05 9.999656e-01 1.207759e-15 7.516451e-21 1960,3 6.612344e-05 9.999339e-01 1.263519e-14 3.231589e-20 1960,4 3.087470e-03 9.969125e-01 1.340914e-10 1.287466e-15 1961,1 1.875582e-06 9.999981e-01 1.809291e-14 1.141122e-22 1961,2 1.229742e-02 9.877024e-01 1.340580e-07 8.658827e-13 1961,3 2.297179e-01 7.696405e-01 6.410647e-04 5.668398e-07 1961,4 4.960982e-01 4.997128e-01 4.135101e-03 5.394124e-05 1962,1 9.852647e-01 2.189668e-03 4.685051e-03 7.860576e-03 1962,2 2.187218e-01 7.808754e-01 3.996255e-04 3.160063e-06 1962,3 7.325656e-01 2.672382e-01 1.957836e-04 3.591392e-07 1962,4 9.032811e-01 9.265692e-02 4.054543e-03 7.389732e-06 1963,1 7.339309e-16 3.430401e-30 2.172746e-07 9.999998e-01 1963,2 8.269534e-03 2.127405e-08 9.615644e-01 3.016605e-02 1963,3 8.335183e-01 3.978251e-04 1.657725e-01 3.113607e-04 1963,4 8.898305e-01 6.742892e-04 1.094195e-01 7.574328e-05 1964,1 5.552572e-10 1.000000e+00 6.276229e-20 1.265898e-32 1964,2 2.377382e-01 7.622618e-01 2.008911e-08 2.120929e-12 1964,3 9.557727e-01 4.414078e-02 8.640369e-05 1.395924e-07 1964,4 4.228472e-02 9.577040e-01 1.125014e-05 1.613403e-10 1965,1 2.358090e-01 7.641897e-01 1.293290e-06 4.573253e-10 1965,2 5.046386e-01 4.947181e-01 6.421651e-04 1.112905e-06 1965,3 2.721444e-01 6.712938e-01 5.655436e-02 7.492892e-06 1965,4 9.384091e-01 1.556845e-02 4.579564e-02 2.267695e-04 1966,1 7.087844e-01 1.269574e-01 1.642543e-01 3.823452e-06 1966,2 2.887408e-02 1.025617e-06 9.654188e-01 5.706075e-03 1966,3 1.715603e-06 1.012954e-14 7.673364e-01 2.326619e-01 1966,4 7.816257e-11 1.022979e-22 2.608917e-01 7.391083e-01 1967,1 1.067741e-19 6.628875e-38 3.480040e-05 9.999652e-01 1967,2 6.058609e-18 3.811354e-37 1.005614e-06 9.999990e-01 1967,3 1.691011e-13 1.559688e-30 4.752637e-06 9.999952e-01 1967,4 9.759991e-01 5.045654e-09 1.085870e-04 2.389234e-02 1968,1 4.232896e-04 7.851046e-14 1.512715e-02 9.844496e-01 1968,2 9.997123e-01 6.389233e-05 1.841760e-04 3.965700e-05 1968,3 6.543684e-02 9.345632e-01 1.951972e-11 3.454319e-15 1968,4 8.532763e-01 1.467106e-01 1.303746e-05 5.223202e-09 1969,1 3.943878e-07 9.999996e-01 8.795726e-23 4.390598e-29 1969,2 5.915987e-07 9.999994e-01 3.635206e-19 3.274949e-26 1969,3 1.558122e-08 1.000000e+00 2.943650e-21 8.742149e-29 1969,4 2.844816e-04 9.997155e-01 2.451193e-09 5.647720e-15 1970,1 9.234552e-06 9.999908e-01 1.927538e-10 6.734492e-17 1970,2 2.888751e-08 1.000000e+00 9.785636e-13 6.232884e-22 1970,3 9.718046e-06 9.999872e-01 3.063395e-06 1.936368e-14 1970,4 3.862314e-06 9.999959e-01 2.061494e-07 6.264200e-16 1971,1 3.441319e-10 1.000000e+00 5.282803e-15 4.909304e-26 1971,2 1.839722e-02 9.534786e-01 2.811598e-02 8.243135e-06 1971,3 1.445700e-06 1.404073e-08 9.562189e-01 4.377967e-02 1971,4 7.345582e-06 2.780965e-08 9.138428e-01 8.614982e-02 1972,1 3.050049e-03 7.821211e-04 9.934640e-01 2.703812e-03 1972,2 2.563834e-06 2.715661e-11 3.783050e-01 6.216924e-01 1972,3 1.335780e-04 1.737048e-08 2.428053e-01 7.570611e-01 1972,4 6.583025e-04 1.002554e-05 9.443097e-01 5.502195e-02 1973,1 8.323619e-03 3.686080e-03 9.865152e-01 1.475052e-03 1973,2 1.907606e-06 1.020643e-08 9.987786e-01 1.219488e-03 1973,3 5.650933e-10 2.184012e-15 9.999027e-01 9.726599e-05 1973,4 1.784516e-11 2.694241e-18 9.983770e-01 1.622967e-03 1974,1 3.495811e-18 1.961723e-32 1.054575e-01 8.945425e-01 1974,2 3.309108e-20 1.751800e-34 2.290788e-03 9.977092e-01 1974,3 4.320003e-17 5.203365e-28 7.138464e-04 9.992862e-01 1974,4 8.035438e-19 3.234839e-30 1.216134e-04 9.998784e-01 1975,1 4.756468e-19 7.025849e-32 4.146113e-07 9.999996e-01 1975,2 1.123433e-11 4.518901e-21 3.278204e-06 9.999967e-01 1975,3 1.785758e-10 3.404891e-19 1.114261e-05 9.999889e-01 1975,4 9.637751e-01 1.222955e-03 6.129196e-05 3.494065e-02 1976,1 9.971666e-01 2.746922e-03 6.381602e-07 8.581077e-05 1976,2 7.890956e-01 2.109031e-01 1.180233e-06 4.340608e-08 1976,3 3.344110e-01 6.902980e-05 5.985957e-01 6.692425e-02 1976,4 9.902541e-01 2.793671e-04 9.428759e-03 3.777358e-05 1977,1 9.495612e-01 4.799824e-02 2.440279e-03 2.665894e-07 1977,2 2.153304e-01 2.721643e-06 7.096038e-01 7.506303e-02 1977,3 8.433622e-01 1.566371e-01 6.924847e-07 6.671118e-09 1977,4 9.939679e-01 4.724456e-04 2.867925e-03 2.691708e-03 1978,1 1.875724e-01 2.445933e-06 5.781048e-03 8.066441e-01 1978,2 9.162849e-01 8.369739e-02 1.620503e-05 1.469576e-06 1978,3 5.745327e-01 4.254631e-01 4.062001e-06 1.166544e-07 1978,4 9.562770e-01 4.361003e-02 9.857144e-05 1.440811e-05 1979,1 9.918409e-01 8.147995e-03 8.420808e-06 2.682733e-06 1979,2 2.829828e-01 7.170153e-01 1.886117e-06 4.410491e-10 1979,3 8.217633e-01 1.759412e-01 2.295405e-03 9.574092e-08 1979,4 5.989776e-01 3.245700e-01 7.645220e-02 2.031714e-07 1980,1 1.924036e-03 9.980587e-01 1.728536e-05 8.075518e-15 1980,2 9.198976e-07 1.372799e-12 9.992905e-01 7.085780e-04 1980,3 1.653621e-06 7.104327e-12 9.989598e-01 1.038576e-03 1980,4 6.086415e-09 1.879658e-17 3.493405e-01 6.506595e-01 1981,1 1.513218e-12 2.489632e-24 1.969965e-03 9.980300e-01 1981,2 2.339505e-09 1.259689e-18 8.866675e-01 1.133325e-01 1981,3 2.577487e-10 1.283297e-20 8.105798e-01 1.894202e-01 1981,4 1.167114e-12 3.949235e-26 1.467601e-01 8.532399e-01 1982,1 2.021965e-15 6.276169e-30 5.379590e-03 9.946204e-01 1982,2 6.572380e-13 3.671270e-26 2.928630e-03 9.970714e-01 1982,3 1.560676e-14 5.208210e-28 1.489215e-03 9.985108e-01 1982,4 3.225832e-08 1.638642e-18 4.319003e-02 9.568099e-01 1983,1 1.771391e-04 1.630827e-12 4.921423e-03 9.949014e-01 1983,2 9.613690e-01 3.413997e-06 2.246396e-03 3.638115e-02 1983,3 9.989620e-01 1.373144e-04 3.202853e-04 5.803885e-04 1983,4 9.966626e-01 3.337206e-03 1.972565e-07 2.034946e-08 1984,1 3.963533e-01 6.083644e-07 5.930797e-01 1.056641e-02 1984,2 6.537712e-10 2.104297e-22 4.196614e-02 9.580339e-01 1984,3 8.987604e-01 1.462443e-08 8.702338e-02 1.421616e-02 1984,4 6.585481e-02 2.894535e-10 6.979735e-01 2.361717e-01 1985,1 1.303221e-03 7.709256e-15 2.759518e-04 9.984208e-01 1985,2 9.996519e-01 3.479989e-04 8.893914e-08 5.285830e-10 1985,3 8.867201e-01 2.139783e-07 9.784082e-02 1.543886e-02 1985,4 9.971931e-01 3.603590e-07 1.209688e-03 1.596895e-03 1986,1 9.598700e-01 1.609785e-06 3.122576e-02 8.902619e-03 1986,2 9.968522e-01 3.122231e-03 2.504093e-05 5.603311e-07 1986,3 8.649695e-01 5.460061e-06 9.956050e-02 3.546451e-02 1986,4 9.474326e-01 6.196164e-06 4.903993e-02 3.521318e-03 1987,1 9.192757e-01 1.959045e-07 6.295037e-03 7.442907e-02 1987,2 5.973861e-01 4.688865e-07 1.430719e-01 2.595416e-01 1987,3 9.995478e-01 2.231940e-05 2.188156e-04 2.110916e-04 1987,4 9.949703e-01 3.335791e-06 2.172346e-03 2.854048e-03 1988,1 2.047822e-01 7.952178e-01 1.331397e-08 3.012846e-13 1988,2 9.998637e-01 6.817994e-06 4.259450e-05 8.689389e-05 1988,3 9.996827e-01 1.158645e-05 6.264816e-05 2.430339e-04 1988,4 9.999308e-01 1.192765e-05 1.573440e-05 4.152823e-05 1989,1 7.549508e-01 2.450472e-01 2.024052e-06 4.811993e-10 1989,2 9.920881e-01 7.910957e-03 8.953224e-07 5.292392e-10 1989,3 9.989622e-01 6.122715e-05 9.729765e-04 3.591625e-06 1989,4 9.952112e-01 4.756394e-03 3.235102e-05 8.214640e-09 1990,1 8.025813e-03 9.919742e-01 4.148329e-12 7.506986e-19 1990,2 6.388090e-02 9.361191e-01 5.332443e-08 3.087810e-12 1990,3 9.375471e-05 9.999062e-01 4.536061e-14 3.320149e-15 1990,4 7.947931e-05 9.999205e-01 1.064924e-13 5.326177e-14 1991,1 5.785052e-04 9.994215e-01 6.689156e-14 5.606857e-11 1991,2 4.791956e-06 9.999952e-01 5.018906e-15 3.632442e-17 1991,3 1.411074e-01 8.588737e-01 1.896947e-05 2.038736e-09 1991,4 6.020221e-02 4.260563e-05 9.375429e-01 2.212304e-03 1992,1 1.449101e-03 2.216462e-07 9.984883e-01 6.241682e-05 1992,2 3.628242e-06 1.039444e-13 8.635592e-01 1.364372e-01 1992,3 2.234100e-07 7.217030e-15 7.891512e-01 2.108485e-01 1992,4 5.187204e-08 2.343732e-15 2.563485e-01 7.436514e-01 1993,1 1.310536e-19 1.524020e-34 1.552034e-05 9.999845e-01 1993,2 5.719466e-20 2.103846e-35 3.496522e-05 9.999650e-01 1993,3 1.932700e-17 2.245841e-32 1.292095e-05 9.999871e-01 1993,4 3.212406e-17 3.508225e-35 1.582053e-04 9.998418e-01 1994,1 3.417393e-09 1.486352e-19 1.254912e-03 9.987451e-01 1994,2 1.348941e-04 8.197988e-14 3.024959e-03 9.968401e-01 1994,3 3.291346e-02 9.995157e-11 7.579785e-03 9.595068e-01 1994,4 9.973659e-01 1.738824e-05 8.005291e-05 2.536681e-03 > > > ########## > # meclight > data(iris) > set.seed(123) > meclight.obj <- meclight(Species ~ ., data = iris) > set.seed(123) > meclight.obj2 <- meclight(iris[,1:4], iris[,5]) > identical(all.equal(meclight.obj$Proj.matrix, meclight.obj2$Proj.matrix), TRUE) [1] TRUE > > meclight.obj$Proj.matrix <- abs(meclight.obj$Proj.matrix) # make BLAS checks happy as projection may be P or -P > print(meclight.obj) Dimension of projection: 1 est. bootstrap error rate: 0.02 est. improvement to LDA: 0 Projection matrix: Proj.dim 1 Sepal.Length 0.8293776 Sepal.Width 1.5344731 Petal.Length 2.2012117 Petal.Width 2.8104603 > > ###### > # misc > > # calc.trans, hmm.sop, errormatrix > print(trans.matrix <- calc.trans(B3$PHASEN)) 1 2 3 4 1 0.8965517 0.1034483 0.0000000 0.0000000 2 0.0000000 0.7083333 0.2916667 0.0000000 3 0.0000000 0.0000000 0.8510638 0.1489362 4 0.2592593 0.0000000 0.0000000 0.7407407 > errormatrix(B3$PHASEN, apply(pB3, 1, which.max)) predicted true 1 2 3 4 -SUM- 1 56 1 1 1 3 2 1 23 0 0 1 3 3 3 40 1 7 4 3 0 3 21 6 -SUM- 7 4 4 2 17 > print(prior.prob <- hmm.sop("2", trans.matrix, pB3)) 1 2 3 4 [1,] 0.000000e+00 9.998738e-01 1.262391e-04 0.000000e+00 [2,] 0.000000e+00 9.958164e-01 4.183624e-03 1.971983e-09 [3,] 7.497743e-11 9.734043e-01 2.659494e-02 7.592508e-07 [4,] 4.193199e-09 6.735304e-02 9.325800e-01 6.692375e-05 [5,] 1.223932e-09 8.139537e-05 9.996176e-01 3.009560e-04 [6,] 2.159248e-05 6.332822e-08 9.988826e-01 1.095762e-03 [7,] 1.980173e-10 8.069973e-13 9.999948e-01 5.195458e-06 [8,] 3.072313e-08 6.093262e-13 9.951421e-01 4.857840e-03 [9,] 3.218450e-03 1.168796e-09 9.669431e-01 2.983845e-02 [10,] 1.703901e-03 1.238285e-05 7.358224e-01 2.624613e-01 [11,] 1.278314e-02 2.477248e-06 9.534429e-01 3.377145e-02 [12,] 1.818387e-01 2.342413e-04 3.656560e-01 4.522710e-01 [13,] 5.703756e-01 1.041614e-03 1.364992e-02 4.149328e-01 [14,] 9.437096e-02 8.457509e-06 4.000277e-04 9.052206e-01 [15,] 4.942168e-01 2.750541e-05 1.677230e-07 5.057555e-01 [16,] 9.805396e-01 7.575673e-05 3.744290e-09 1.938461e-02 [17,] 9.991852e-01 7.797449e-04 2.400981e-09 3.503432e-05 [18,] 9.995208e-01 4.792090e-04 2.615433e-09 8.561325e-09 [19,] 2.171687e-01 7.828289e-01 2.323485e-06 8.676636e-12 [20,] 1.843523e-03 9.976574e-01 4.990810e-04 9.834889e-12 [21,] 7.161342e-05 9.972563e-01 2.672067e-03 4.501904e-09 [22,] 4.042788e-06 9.815070e-01 1.848895e-02 3.173337e-09 [23,] 2.572218e-07 8.217694e-01 1.782298e-01 5.666393e-07 [24,] 3.312460e-08 2.699717e-02 9.714058e-01 1.597001e-03 [25,] 4.090015e-05 4.033036e-04 9.837274e-01 1.582841e-02 [26,] 2.262438e-03 2.353289e-05 9.716227e-01 2.609135e-02 [27,] 1.300558e-03 4.265849e-05 9.497302e-01 4.892663e-02 [28,] 2.068215e-01 1.611491e-04 7.818646e-01 1.115270e-02 [29,] 1.129933e-01 1.046274e-02 8.467716e-01 2.977242e-02 [30,] 2.189454e-02 4.694632e-09 2.141267e-01 7.639787e-01 [31,] 8.435416e-01 1.685297e-04 9.746303e-02 5.882687e-02 [32,] 9.894062e-01 1.053698e-03 6.523111e-03 3.016942e-03 [33,] 9.985406e-01 1.114292e-03 2.998317e-04 4.523003e-05 [34,] 1.000000e+00 1.391967e-09 6.635119e-09 1.684362e-08 [35,] 9.997202e-01 2.797879e-04 1.375268e-11 1.041270e-10 [36,] 9.939987e-01 5.996966e-03 4.334768e-06 2.466449e-12 [37,] 8.881222e-01 1.105943e-01 1.283546e-03 4.100670e-08 [38,] 9.537363e-01 4.454383e-02 1.718110e-03 1.732130e-06 [39,] 6.063095e-01 3.599887e-01 3.366294e-02 3.890146e-05 [40,] 7.488868e-02 1.251962e-01 7.991604e-01 7.547605e-04 [41,] 3.589336e-02 2.003671e-01 7.591398e-01 4.599750e-03 [42,] 3.809680e-02 2.364242e-01 7.161118e-01 9.367128e-03 [43,] 5.510030e-02 7.564013e-02 8.540883e-01 1.517127e-02 [44,] 1.808241e-02 1.979021e-03 9.005190e-01 7.941961e-02 [45,] 4.331535e-03 1.929921e-06 9.208022e-01 7.486437e-02 [46,] 7.473412e-05 1.544949e-11 1.630568e-01 8.368684e-01 [47,] 5.227907e-04 9.782996e-15 5.948961e-04 9.988823e-01 [48,] 1.239652e-03 1.165665e-14 1.042341e-06 9.987593e-01 [49,] 8.043016e-02 3.930538e-11 1.075430e-11 9.195698e-01 [50,] 6.094793e-01 3.497667e-08 6.179693e-13 3.905207e-01 [51,] 9.909846e-01 3.934572e-04 3.974652e-11 8.621909e-03 [52,] 9.986135e-01 1.384785e-03 2.836169e-08 1.686980e-06 [53,] 9.813205e-01 1.866572e-02 1.379846e-05 7.213508e-10 [54,] 9.918407e-01 8.159339e-03 9.835178e-09 3.602583e-13 [55,] 9.434360e-01 5.656189e-02 2.144216e-06 5.734767e-14 [56,] 6.042473e-01 3.956690e-01 8.372817e-05 4.888000e-11 [57,] 1.903340e-03 9.334340e-01 6.466265e-02 3.171622e-09 [58,] 9.676849e-10 5.288122e-03 9.947119e-01 1.331808e-08 [59,] 6.610817e-17 6.219289e-07 9.999993e-01 4.552371e-08 [60,] 1.508435e-16 7.348480e-12 9.999991e-01 8.667861e-07 [61,] 2.133362e-13 1.588380e-15 9.999953e-01 4.724895e-06 [62,] 6.227845e-10 2.203675e-16 9.997986e-01 2.014122e-04 [63,] 4.497303e-07 6.991569e-13 8.572499e-01 1.427496e-01 [64,] 1.340763e-05 5.480397e-10 1.542917e-01 8.456949e-01 [65,] 2.596517e-04 5.527604e-09 5.894189e-03 9.938462e-01 [66,] 6.338262e-02 5.678018e-06 9.500569e-04 9.356616e-01 [67,] 7.377646e-01 8.269546e-04 1.351122e-04 2.612733e-01 [68,] 4.884470e-01 2.880505e-02 3.592422e-04 4.823887e-01 [69,] 1.216515e-02 5.095513e-01 3.800266e-03 4.744833e-01 [70,] 5.310542e-04 8.663388e-01 3.368601e-02 9.944416e-02 [71,] 2.630501e-08 8.817522e-02 9.094059e-01 2.418875e-03 [72,] 1.809643e-13 3.670023e-06 9.999685e-01 2.782545e-05 [73,] 3.785601e-16 9.276441e-11 9.999924e-01 7.626660e-06 [74,] 2.381363e-12 1.097148e-15 9.965076e-01 3.492420e-03 [75,] 2.717129e-10 4.917641e-17 1.915889e-01 8.084111e-01 [76,] 3.375079e-08 7.076664e-15 5.653115e-03 9.943469e-01 [77,] 1.381561e-09 1.857625e-14 9.386373e-06 9.999906e-01 [78,] 1.151451e-06 1.080900e-17 3.027984e-09 9.999988e-01 [79,] 1.233173e-04 1.547901e-14 3.139144e-13 9.998767e-01 [80,] 1.533516e-03 1.858553e-11 2.107520e-16 9.984665e-01 [81,] 3.463760e-03 7.552131e-10 4.027839e-17 9.965362e-01 [82,] 8.421413e-01 5.010771e-08 1.530179e-14 1.578587e-01 [83,] 9.990323e-01 3.482665e-05 6.096593e-12 9.328547e-04 [84,] 9.975592e-01 2.419381e-03 4.833607e-07 2.094158e-05 [85,] 9.991753e-01 8.160784e-04 8.580708e-06 6.563850e-09 [86,] 9.971324e-01 2.857440e-03 1.014851e-05 5.182188e-09 [87,] 9.977569e-01 2.159729e-03 8.337634e-05 3.096694e-08 [88,] 9.973893e-01 2.572664e-03 3.781933e-05 2.068514e-07 [89,] 9.996042e-01 3.860970e-04 9.610278e-06 6.832363e-08 [90,] 9.998632e-01 1.354331e-04 1.382837e-06 3.063911e-08 [91,] 9.997780e-01 2.216231e-04 3.492286e-07 6.019525e-09 [92,] 9.987605e-01 1.238479e-03 9.935002e-07 1.514465e-09 [93,] 9.994553e-01 5.386482e-04 6.076875e-06 3.757545e-09 [94,] 9.989997e-01 9.997942e-04 4.749013e-07 1.807321e-09 [95,] 7.926880e-01 2.072811e-01 3.088491e-05 1.471122e-09 [96,] 3.616867e-01 5.804317e-01 5.788139e-02 1.102071e-07 [97,] 2.208257e-03 8.945839e-01 1.032068e-01 1.132922e-06 [98,] 1.055627e-07 9.969804e-01 3.019512e-03 1.983099e-09 [99,] 9.276769e-13 1.735509e-02 9.826447e-01 2.183544e-07 [100,] 1.196284e-11 1.744126e-04 9.997196e-01 1.060225e-04 [101,] 1.217573e-08 1.194466e-07 9.981461e-01 1.853781e-03 [102,] 4.807424e-09 1.616463e-11 9.999060e-01 9.403963e-05 [103,] 5.632837e-12 8.577864e-14 9.999922e-01 7.770191e-06 [104,] 1.300987e-12 5.191514e-17 9.999913e-01 8.718669e-06 [105,] 9.408676e-10 6.817076e-18 9.998183e-01 1.816944e-04 [106,] 1.793113e-08 4.286989e-14 9.989284e-01 1.071599e-03 [107,] 4.232961e-06 1.054366e-12 8.459981e-01 1.539977e-01 [108,] 2.550158e-04 1.623724e-09 8.460307e-01 1.537143e-01 [109,] 1.190318e-02 2.782621e-08 8.335042e-01 1.545926e-01 [110,] 7.900763e-02 8.804676e-07 5.202647e-02 8.689650e-01 [111,] 1.094617e-01 1.631534e-06 1.850893e-04 8.903516e-01 [112,] 6.004789e-02 2.609495e-05 1.084555e-06 9.399249e-01 [113,] 8.675571e-01 1.102201e-05 2.025616e-09 1.324319e-01 [114,] 9.989874e-01 1.604137e-04 9.632511e-08 8.520808e-04 [115,] 9.993480e-01 6.869258e-06 1.323770e-04 5.127791e-04 [116,] 9.999794e-01 1.100929e-05 2.577518e-07 9.344057e-06 [117,] 9.999954e-01 4.593312e-06 9.196003e-09 1.200434e-08 [118,] 9.999998e-01 2.398964e-07 8.443956e-12 9.339220e-13 [119,] 9.999386e-01 6.137158e-05 1.151539e-13 9.956998e-18 [120,] 9.999536e-01 4.635138e-05 4.524599e-08 1.532027e-16 [121,] 9.999904e-01 9.591151e-06 4.312857e-10 1.546765e-12 [122,] 9.999952e-01 4.804015e-06 3.212593e-09 2.274653e-14 [123,] 9.999726e-01 2.739797e-05 2.092028e-09 2.663541e-12 [124,] 9.999976e-01 2.356300e-06 5.321528e-08 1.368255e-12 [125,] 9.999999e-01 8.918677e-08 2.274745e-09 9.621902e-12 [126,] 9.999995e-01 5.363704e-07 6.284393e-12 9.044094e-14 [127,] 9.999947e-01 5.298136e-06 1.775106e-09 6.135169e-15 [128,] 9.999766e-01 2.343240e-05 3.988544e-09 5.918184e-12 [129,] 9.999758e-01 2.419783e-05 8.077585e-09 5.385590e-12 [130,] 9.999994e-01 5.584081e-07 1.304135e-08 2.166288e-11 [131,] 9.999981e-01 1.863545e-06 6.488209e-11 1.071697e-11 [132,] 9.999401e-01 5.988212e-05 1.927299e-10 1.351936e-13 [133,] 9.999935e-01 6.453294e-06 6.742747e-10 1.753618e-14 [134,] 9.999039e-01 9.605095e-05 1.833953e-09 2.031512e-13 [135,] 9.999701e-01 2.991694e-05 1.511250e-09 1.111269e-13 [136,] 9.997939e-01 2.060763e-04 3.820172e-09 4.655151e-14 [137,] 9.991706e-01 8.293615e-04 6.735973e-09 2.143593e-14 [138,] 9.942042e-01 5.795769e-03 2.735187e-10 5.214877e-18 [139,] 8.291275e-01 1.708634e-01 9.191264e-06 5.841155e-14 [140,] 1.878801e-06 9.999981e-01 1.303086e-09 1.373138e-12 [141,] 4.112012e-16 1.000000e+00 8.731016e-12 9.829432e-20 [142,] 3.281149e-33 1.000000e+00 6.148263e-20 7.691065e-30 [143,] 1.415311e-36 9.999998e-01 1.581176e-07 1.192046e-25 [144,] 1.252701e-27 9.980280e-01 1.972002e-03 5.139471e-12 [145,] 1.903134e-13 8.807161e-01 1.192834e-01 4.605886e-07 [146,] 9.221426e-09 7.120297e-02 9.287819e-01 1.507764e-05 [147,] 1.220987e-07 2.588566e-03 9.871535e-01 1.025777e-02 [148,] 1.708332e-05 1.356631e-05 9.988034e-01 1.165975e-03 [149,] 3.751465e-07 4.865054e-09 9.991664e-01 8.332527e-04 [150,] 1.767874e-07 4.704910e-15 9.982708e-01 1.728980e-03 [151,] 6.830012e-08 5.154801e-16 9.977159e-01 2.284074e-03 [152,] 1.353139e-06 1.872577e-16 9.996703e-01 3.283805e-04 [153,] 7.476487e-07 4.003361e-16 9.902237e-01 9.775539e-03 [154,] 8.916454e-05 2.418756e-14 9.907703e-01 9.140568e-03 [155,] 5.194330e-03 3.413300e-11 4.085119e-01 5.862938e-01 [156,] 6.180181e-01 4.090187e-09 3.620284e-03 3.783616e-01 [157,] 9.597672e-01 6.541309e-07 1.765307e-06 4.023034e-02 > errormatrix(B3$PHASEN, apply(prior.prob, 1, which.max)) predicted true 1 2 3 4 -SUM- 1 59 0 0 0 0 2 5 19 0 0 5 3 0 1 46 0 1 4 1 0 4 22 5 -SUM- 6 1 4 0 11 > > # friedman.data > set.seed(123) > friedman.data(1, 6, 40) class x1 x2 x3 x4 x5 x6 1 1 -1.9666172 0.1533731 -0.06191171 -0.46665535 0.58461375 0.05300423 2 1 0.7013559 -1.1381369 -0.30596266 0.77996512 0.12385424 0.92226747 3 1 -0.4727914 1.2538149 -0.38047100 -0.08336907 0.21594157 2.05008469 4 1 -1.0678237 0.4264642 -0.69470698 0.25331851 0.37963948 -0.49103117 5 1 -0.2179749 -0.2950715 -0.20791728 -0.02854676 -0.50232345 -2.30916888 6 1 -1.0260044 0.8951257 -1.26539635 -0.04287046 -0.33320738 1.00573852 7 1 -0.7288912 0.8781335 2.16895597 1.36860228 -1.01857538 -0.70920076 8 1 -0.6250393 0.8215811 1.20796200 -0.22577099 -1.07179123 -0.68800862 9 1 -1.6866933 0.6886403 -1.12310858 1.51647060 0.30352864 1.02557137 10 1 0.8377870 0.5539177 -0.40288484 -1.54875280 0.44820978 -0.28477301 11 2 1.7792823 1.1488076 0.25688371 -0.05556197 -0.65194990 0.73994751 12 2 3.1813035 0.9935039 -0.24669188 0.51940720 0.23538657 1.90910357 13 2 2.8611086 0.5483970 -0.34754260 0.30115336 0.07796085 -1.44389316 14 2 3.0057642 0.2387317 -0.95161857 0.10567619 -0.96185663 0.70178434 15 2 3.3852804 -0.6279061 -0.04502772 -0.64070601 -0.07130809 -0.26219749 16 2 2.6293400 1.3606524 -0.78490447 -0.84970435 1.44455086 -1.57214416 17 2 3.6443765 -0.6002596 -1.66794194 -1.02412879 0.45150405 -1.51466765 18 2 2.7795134 2.1873330 -0.38022652 0.11764660 0.04123292 -1.60153617 19 2 3.3317820 1.5326106 0.91899661 -0.94747461 -0.42249683 -0.53090652 20 2 4.0968390 -0.2357004 -0.57534696 -0.49055744 -2.05324722 -1.46175558 21 2 3.4351815 -1.0264209 0.60796432 -0.25609219 1.13133721 0.68791677 22 2 2.6740684 -0.7104066 -1.61788271 1.84386201 -1.46064007 2.10010894 23 3 -1.2870305 2.5162194 -0.19717589 0.54319406 0.61798582 -0.78153649 24 3 0.7877388 3.5168620 1.10992029 -0.41433995 1.10984814 -0.78862197 25 3 0.7690422 3.3689645 0.08473729 -0.47624689 0.70758835 -0.50219872 26 3 0.3322026 2.7846195 0.75405379 -0.78860284 -0.36365730 1.49606067 27 3 -1.0083766 3.0652930 -0.49929202 -0.59461727 0.05974994 -1.13730362 28 3 -0.1194526 2.9659327 0.21444531 1.65090747 -0.70459646 -0.17905159 29 3 -0.2803953 5.1284519 -0.32468591 -0.05402813 -0.71721816 1.90236182 30 3 0.5629895 2.2586639 0.09458353 0.11924524 0.88465050 -0.10097489 31 3 -0.3724388 1.9040037 -0.89536336 0.24368743 -1.01559258 -1.35984070 32 3 0.9769734 3.0377884 -1.31080153 1.23247588 1.95529397 -0.66476944 33 3 -0.3745809 3.3104807 1.99721338 -0.51606383 -0.09031959 0.48545998 34 3 1.0527115 3.4365235 0.60070882 -0.99250715 0.21453883 -0.37560287 35 3 -1.0491770 2.5416347 -1.25127136 1.67569693 -0.73852770 -0.56187636 36 3 -1.2601552 1.9366739 -0.61116592 -0.44116322 -0.57438869 -0.34391723 37 3 3.2410399 4.2631852 -1.18548008 -0.72306597 -1.31701613 0.09049665 38 3 -0.4168576 2.6503496 2.19881035 -1.23627312 -0.18292539 1.59850877 39 3 0.2982276 2.1344871 1.31241298 -1.28471572 0.41898240 -0.08856511 40 3 0.6365697 2.7637204 -0.26514506 -0.57397348 0.32430434 1.08079950 > > ######## > ## plots > > # Naive Bayes, stepclass, RDA > plot(NB) > plot(SC) > plot(rB3) > > classscatter(PHASEN ~ BSP91JW + EWAJW + LSTKJW, + data = B3, method = "lda") [1] 0.3184713 > > plineplot(PHASEN ~ ., data = B3, method = "lda", + x = "EWAJW", xlab = "EWAJW") [1] 0.1719745 > > > # quadplot > quadtrafo(pB3) x y z [1,] 0.5034695947 8.598339e-01 2.485385e-04 [2,] 0.5000013231 8.600671e-01 8.242261e-03 [3,] 0.5449339986 7.546220e-01 4.563849e-02 [4,] 0.5006924717 3.029522e-01 7.815891e-01 [5,] 0.4991502377 2.889504e-01 8.138857e-01 [6,] 0.5922997372 2.329128e-01 6.569333e-01 [7,] 0.4999855141 2.886666e-01 8.164718e-01 [8,] 0.4960873706 2.892402e-01 7.615534e-01 [9,] 0.7767727666 1.520683e-01 2.187560e-01 [10,] 0.2343371933 1.086655e-01 2.732545e-01 [11,] 0.5198416446 2.464079e-01 6.790340e-01 [12,] 0.7549346866 2.297498e-02 2.984031e-02 [13,] 0.6515475178 1.881599e-02 1.119247e-02 [14,] 0.0544088824 3.152243e-03 8.804461e-03 [15,] 0.6721325416 1.119007e-03 1.732311e-04 [16,] 0.9700718066 8.034591e-04 2.125810e-04 [17,] 0.9944441083 5.862238e-03 7.779083e-05 [18,] 0.9976430912 3.566507e-03 8.378475e-06 [19,] 0.5154393854 8.377682e-01 1.738687e-03 [20,] 0.5027113617 8.605760e-01 1.025215e-03 [21,] 0.5147835080 8.367303e-01 5.116163e-03 [22,] 0.5207712344 8.060113e-01 3.398090e-02 [23,] 0.5191894997 6.477518e-01 2.614075e-01 [24,] 0.5051527850 2.827272e-01 7.572250e-01 [25,] 0.4965385871 2.548000e-01 6.839687e-01 [26,] 0.5976894701 2.075252e-01 4.851529e-01 [27,] 0.4574026980 2.713559e-01 5.313561e-01 [28,] 0.9388758044 6.648597e-02 4.662231e-02 [29,] 0.5695402948 3.035777e-01 3.999627e-01 [30,] 0.0616967380 1.510952e-02 4.273607e-02 [31,] 0.9120517724 4.775340e-02 9.529349e-02 [32,] 0.9317456177 2.325038e-02 4.503395e-02 [33,] 0.9624425203 2.009781e-02 3.479777e-02 [34,] 0.9998019847 2.965354e-06 8.357967e-06 [35,] 0.9909366154 2.658456e-03 1.644951e-03 [36,] 0.9307453857 5.231700e-02 3.466541e-02 [37,] 0.6651296215 3.914279e-01 2.116298e-01 [38,] 0.8910132257 1.588798e-01 2.767326e-02 [39,] 0.5468439725 5.150451e-01 3.193846e-01 [40,] 0.4991055188 3.103722e-01 7.329615e-01 [41,] 0.5666776958 5.676677e-01 2.332101e-01 [42,] 0.6373882964 4.400265e-01 2.149096e-01 [43,] 0.7054788396 2.232371e-01 3.077707e-01 [44,] 0.4453983515 1.750126e-01 4.569478e-01 [45,] 0.4208183455 2.033471e-01 5.743062e-01 [46,] 0.0235364988 1.318226e-02 3.728505e-02 [47,] 0.0029231569 7.946511e-04 2.247611e-03 [48,] 0.0042812812 4.381201e-04 1.239190e-03 [49,] 0.1992541726 2.425523e-06 6.376756e-06 [50,] 0.7707385488 3.373415e-03 9.537444e-03 [51,] 0.9777876666 4.158611e-03 2.026119e-03 [52,] 0.9937245937 1.034058e-02 1.777687e-04 [53,] 0.9181937517 1.258736e-01 2.129548e-02 [54,] 0.9703304880 5.138798e-02 1.228137e-06 [55,] 0.8349349044 2.855299e-01 4.645054e-04 [56,] 0.5993682001 6.930256e-01 1.152951e-03 [57,] 0.5004957613 7.666730e-01 1.391016e-01 [58,] 0.4999998661 2.901898e-01 8.143537e-01 [59,] 0.4999998762 2.887563e-01 8.163814e-01 [60,] 0.4999975290 2.886819e-01 8.164809e-01 [61,] 0.4999869080 2.888170e-01 8.162619e-01 [62,] 0.4996442605 2.928469e-01 8.086756e-01 [63,] 0.2608918967 1.512775e-01 4.144835e-01 [64,] 0.0291136842 1.852240e-02 4.488835e-02 [65,] 0.0162107622 1.038217e-02 2.319011e-02 [66,] 0.2328549919 1.240701e-01 8.071033e-02 [67,] 0.8330150693 5.019360e-02 4.344868e-02 [68,] 0.2995275846 1.354213e-01 1.811802e-01 [69,] 0.4271925521 7.076524e-01 3.973095e-02 [70,] 0.4519833094 7.363294e-01 6.245225e-02 [71,] 0.4954879469 3.104193e-01 7.746927e-01 [72,] 0.4999189440 2.886555e-01 8.163259e-01 [73,] 0.4999782140 2.886801e-01 8.164362e-01 [74,] 0.4901842977 2.830155e-01 8.004545e-01 [75,] 0.0202613901 1.171848e-02 3.305750e-02 [76,] 0.0107791339 6.313010e-03 1.747519e-02 [77,] 0.0007202467 4.180942e-04 1.172953e-03 [78,] 0.0001436641 8.107798e-05 2.291860e-04 [79,] 0.0003973712 2.612280e-05 7.365071e-05 [80,] 0.0046515081 1.662261e-04 4.675243e-04 [81,] 0.0097861517 4.606158e-06 4.458452e-06 [82,] 0.9377114691 4.109562e-05 1.651303e-05 [83,] 0.9933650417 3.691846e-04 2.694780e-04 [84,] 0.9458310764 2.799418e-02 3.198493e-02 [85,] 0.9908688227 9.006240e-03 8.723031e-03 [86,] 0.9675642582 3.014299e-02 2.847923e-02 [87,] 0.9361414526 3.691406e-02 6.436389e-02 [88,] 0.9538167144 3.044924e-02 3.640791e-02 [89,] 0.9827277300 5.874168e-03 8.752584e-03 [90,] 0.9764578110 3.860456e-03 8.134547e-03 [91,] 0.9725001156 3.759466e-03 6.083045e-03 [92,] 0.9653811070 1.264304e-02 1.069215e-02 [93,] 0.9688994145 8.013272e-03 1.178001e-02 [94,] 0.9926766420 8.135472e-03 2.115636e-03 [95,] 0.6439462938 5.845983e-01 2.875443e-02 [96,] 0.5602238638 6.141887e-01 1.940613e-01 [97,] 0.5013499892 7.533723e-01 1.558787e-01 [98,] 0.5000168139 8.628354e-01 4.469917e-03 [99,] 0.4999295072 2.928371e-01 8.104309e-01 [100,] 0.4997867942 2.952577e-01 8.062350e-01 [101,] 0.4949446279 2.860112e-01 8.069667e-01 [102,] 0.4997381818 2.886113e-01 8.159247e-01 [103,] 0.4999779121 2.887451e-01 8.163431e-01 [104,] 0.4999753680 2.887002e-01 8.163994e-01 [105,] 0.4996584457 2.882985e-01 8.153259e-01 [106,] 0.4971195510 2.870413e-01 8.109627e-01 [107,] 0.2514442961 1.410215e-01 3.981868e-01 [108,] 0.3263698385 1.875825e-01 5.255877e-01 [109,] 0.4172644321 1.595540e-01 4.500567e-01 [110,] 0.3023142095 4.133443e-03 1.135892e-02 [111,] 0.2136031516 7.924903e-04 1.960637e-03 [112,] 0.1157325549 2.459838e-03 3.466522e-03 [113,] 0.9384806041 5.149626e-04 6.235203e-05 [114,] 0.9806739897 8.022827e-03 1.924619e-02 [115,] 0.5318899261 1.715749e-01 4.852527e-01 [116,] 0.9784844763 6.491627e-04 1.607636e-03 [117,] 0.9972430676 7.253761e-04 1.954557e-03 [118,] 0.9999145641 3.421952e-06 4.586618e-06 [119,] 0.9997288691 4.608332e-04 1.204054e-06 [120,] 0.9907595921 9.913725e-04 1.830790e-03 [121,] 0.9997384943 8.017213e-05 2.327857e-05 [122,] 0.9991536971 3.327773e-04 8.393995e-04 [123,] 0.9942601053 5.874571e-04 1.083747e-03 [124,] 0.9931608155 1.723706e-03 4.825854e-03 [125,] 0.9975288842 8.012456e-04 2.264379e-03 [126,] 0.9996626232 6.219336e-05 1.645278e-04 [127,] 0.9895702275 2.930350e-03 8.177546e-03 [128,] 0.9791439074 8.246264e-04 1.845944e-03 [129,] 0.9913774631 4.828216e-04 8.567538e-04 [130,] 0.9833749559 4.735463e-04 1.327746e-03 [131,] 0.9949450359 1.099342e-04 2.715868e-04 [132,] 0.9927510187 5.370888e-04 2.575680e-04 [133,] 0.9994093281 5.836989e-05 2.824094e-05 [134,] 0.9973428259 9.696625e-04 7.106083e-04 [135,] 0.9994820760 2.382021e-04 3.945780e-05 [136,] 0.9987283536 1.656116e-03 3.197391e-04 [137,] 0.9963508272 6.204819e-03 8.148842e-05 [138,] 0.9760824205 4.142590e-02 7.920489e-07 [139,] 0.6832151029 5.464691e-01 1.751550e-03 [140,] 0.5000001576 8.660248e-01 4.414428e-09 [141,] 0.4999999999 8.660254e-01 1.731291e-11 [142,] 0.5000000000 8.660254e-01 1.219151e-19 [143,] 0.4999956406 8.660168e-01 3.135315e-07 [144,] 0.5138400213 8.391142e-01 3.790233e-03 [145,] 0.5392904632 6.656069e-01 1.850561e-01 [146,] 0.5137181161 3.042511e-01 7.601197e-01 [147,] 0.4843541936 2.881141e-01 7.233795e-01 [148,] 0.4995379374 2.888741e-01 8.020710e-01 [149,] 0.4981448090 2.872362e-01 8.115408e-01 [150,] 0.4954677716 2.856609e-01 8.079707e-01 [151,] 0.4936628620 2.849425e-01 8.059390e-01 [152,] 0.5000422313 2.875833e-01 8.134083e-01 [153,] 0.4770246354 2.713727e-01 7.675579e-01 [154,] 0.4905877480 2.672502e-01 7.558972e-01 [155,] 0.3689421911 2.184006e-02 6.177160e-02 [156,] 0.8369828595 6.383138e-04 1.801473e-03 [157,] 0.9111358452 1.078667e-04 2.895794e-04 > s3d <- quadplot(pB3, col = rainbow(4)[B3$PHASEN], + labelpch = 22:25, labelcex = 0.8, + pch = (22:25)[apply(pB3, 1, which.max)], + main = "RDA posterior assignments") > quadlines(centerlines(4), sp = s3d, lty = "dashed") > par("mar") [1] 5.1 3.1 4.1 3.1 > > > # triplot > triplot(grid = TRUE, frame = FALSE) > some.triangle <- rbind(c(0, 0.65, 0.35), c(0.53, 0.47, 0), + c(0.72, 0, 0.28))[c(1:3, 1), ] > trilines(some.triangle, col = "green", pch = 16, type = "b") > triframe(label = c("left", "top", "right"), col = "blue", + label.col = "green3") > triperplines(1/6, 1/3, 1/2) > > pred <- predict(lda(Species ~ ., data = iris), iris) > plotchar <- rep(1, 150) > plotchar[pred$class != iris$Species] <- 19 > triplot(pred$posterior, label = colnames(pred$posterior), + main = "LDA posterior assignments", center = TRUE, + pch = plotchar, col = rep(c("blue", "green3", "red"), rep(50, 3)), + grid = TRUE) > legend(x = -0.6, y = 0.7, col = c("blue", "green3", "red"), + pch = 15, legend = colnames(pred$posterior)) > par("mar") [1] 5.1 3.1 4.1 3.1 > > # partimat > partimat(Species ~ ., data = iris, method = "lda", + plot.matrix = TRUE, imageplot = FALSE) > > dev.off() null device 1 > > psSave <- readLines("testklaR.ps.save") > ps <- readLines("testklaR.ps") > setdiff(trimws(ps), trimws(psSave)) character(0) > > proc.time() user system elapsed 5.34 0.29 5.61