⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bdssig.m

📁 Neural Network in Finance (神经网络在金融界:赢得预言性的优势)全部原码。内容包括预测与估计
💻 M
📖 第 1 页 / 共 2 页
字号:
   2.30  2.29  2.29  2.28  2.27  2.29  2.28  2.28  2.29  2.29  2.31  2.33  2.35  2.36
   2.79  2.78  2.75  2.78  2.80  2.79  2.81  2.83  2.83  2.81  2.84  2.88  2.92  2.93
   3.16  3.15  3.09  3.07  3.13  3.17  3.14  3.18  3.20  3.24  3.22  3.24  3.32  3.36];

% n = 500, eps = 0.5 (c1 ~ 0.28)
quants(1:8, 1:14, 4, 1) = [...
  -2.88 -3.01 -3.35 -4.01 -5.05 -6.40 -7.60 -6.95 -5.99  -5.12  -4.43  -3.88 -3.43 -3.07
  -2.63 -2.78 -3.04 -3.67 -4.52 -5.92 -7.22 -6.69 -5.74  -4.93  -4.28  -3.74 -3.31 -2.95
  -2.22 -2.38 -2.62 -3.09 -3.87 -5.15 -6.55 -6.33 -5.44  -4.66  -4.03  -3.54 -3.11 -2.77
  -1.89 -2.01 -2.24 -2.64 -3.32 -4.38 -5.78 -6.00 -5.20  -4.46  -3.85  -3.35 -2.95 -2.63
   2.01  2.13  2.37  2.87  3.68  5.25  8.05 13.57 22.54  31.55  -2.28  -2.00 -1.73 -1.51
   2.46  2.64  2.92  3.55  4.55  6.61 10.41 17.88 31.94  49.71  -2.08  -1.89 -1.64 -1.43
   2.95  3.27  3.72  4.41  5.74  8.50 13.55 23.17 44.46  84.82 133.43  -1.73 -1.53 -1.33
   3.32  3.61  4.14  5.03  6.58  9.75 15.80 27.76 55.17 109.55 198.94 264.86 -1.45 -1.27];

% n = 500, eps = 1.0 (c1 ~ 0.52)
quants(1:8, 1:14, 4, 2) = [...
  -2.55 -2.52 -2.53 -2.51 -2.46 -2.46 -2.48 -2.54 -2.65 -2.80 -3.01 -3.24 -3.43 -3.47
  -2.34 -2.33 -2.30 -2.30 -2.27 -2.27 -2.30 -2.36 -2.47 -2.61 -2.78 -3.01 -3.22 -3.31
  -2.01 -2.00 -1.99 -1.96 -1.99 -2.00 -2.03 -2.07 -2.16 -2.28 -2.46 -2.66 -2.91 -3.04
  -1.72 -1.72 -1.71 -1.70 -1.73 -1.75 -1.76 -1.81 -1.88 -1.98 -2.14 -2.35 -2.59 -2.80
   1.77  1.77  1.77  1.81  1.87  1.93  2.01  2.12  2.25  2.47  2.76  3.16  3.64  4.34
   2.14  2.15  2.20  2.26  2.34  2.43  2.55  2.71  2.95  3.21  3.57  4.06  4.74  5.71
   2.58  2.62  2.64  2.76  2.89  3.04  3.23  3.47  3.79  4.15  4.58  5.23  6.31  7.75
   2.89  2.95  3.00  3.10  3.28  3.50  3.68  4.02  4.41  4.84  5.51  6.24  7.34  9.28];

% n = 500, eps = 1.5 (c1 ~ 0.71)
quants(1:8, 1:14, 4, 3) = [...
  -2.61 -2.54 -2.54 -2.54 -2.48 -2.45 -2.44 -2.41 -2.37 -2.33 -2.29 -2.29 -2.28 -2.25
  -2.37 -2.35 -2.31 -2.30 -2.26 -2.25 -2.23 -2.22 -2.19 -2.17 -2.14 -2.12 -2.10 -2.09
  -2.01 -2.02 -2.00 -1.98 -1.98 -1.96 -1.94 -1.93 -1.91 -1.89 -1.89 -1.88 -1.87 -1.85
  -1.71 -1.71 -1.71 -1.71 -1.69 -1.69 -1.69 -1.67 -1.67 -1.66 -1.65 -1.65 -1.64 -1.63
   1.74  1.72  1.73  1.74  1.74  1.74  1.76  1.76  1.79  1.82  1.85  1.89  1.94  1.98
   2.10  2.09  2.12  2.11  2.13  2.15  2.17  2.20  2.23  2.28  2.33  2.40  2.45  2.51
   2.50  2.54  2.52  2.57  2.60  2.63  2.65  2.71  2.75  2.85  2.88  2.98  3.09  3.21
   2.80  2.86  2.86  2.94  2.93  2.99  3.04  3.05  3.14  3.25  3.33  3.46  3.53  3.68];

% n = 500, eps = 2.0 (c1 ~ 0.84)
quants(1:8, 1:14, 4, 4) = [...
  -2.65 -2.65 -2.70 -2.63 -2.62 -2.63 -2.63 -2.64 -2.60 -2.55 -2.52 -2.49 -2.46 -2.46
  -2.43 -2.43 -2.45 -2.43 -2.39 -2.40 -2.40 -2.39 -2.40 -2.37 -2.34 -2.31 -2.30 -2.28
  -2.09 -2.08 -2.08 -2.09 -2.08 -2.07 -2.07 -2.06 -2.07 -2.05 -2.04 -2.02 -2.01 -1.98
  -1.76 -1.78 -1.79 -1.79 -1.79 -1.78 -1.78 -1.78 -1.78 -1.78 -1.78 -1.76 -1.74 -1.73
   1.78  1.76  1.74  1.73  1.74  1.75  1.75  1.74  1.74  1.74  1.75  1.77  1.77  1.78
   2.13  2.14  2.14  2.13  2.12  2.11  2.10  2.10  2.12  2.15  2.16  2.18  2.19  2.20
   2.58  2.57  2.58  2.58  2.55  2.57  2.57  2.56  2.60  2.63  2.66  2.69  2.71  2.75
   2.91  2.87  2.88  2.87  2.88  2.87  2.88  2.92  2.92  2.95  2.99  2.99  3.06  3.10];

% n = 750, eps = 1.0 (c1 ~ 0.52)
quants(1:8, 1:14, 5, 2) = [...
  -2.52 -2.53 -2.49 -2.48 -2.49 -2.45 -2.44 -2.47 -2.51 -2.61 -2.78 -2.96 -3.24 -3.46
  -2.32 -2.31 -2.30 -2.28 -2.29 -2.25 -2.23 -2.28 -2.32 -2.40 -2.55 -2.76 -3.03 -3.24
  -1.98 -1.97 -1.98 -1.97 -1.96 -1.94 -1.95 -1.97 -2.04 -2.11 -2.23 -2.42 -2.66 -2.91
  -1.68 -1.69 -1.69 -1.69 -1.69 -1.69 -1.70 -1.73 -1.77 -1.83 -1.96 -2.13 -2.34 -2.59
   1.72  1.74  1.76  1.79  1.80  1.87  1.91  2.01  2.13  2.29  2.49  2.74  3.13  3.70
   2.08  2.13  2.15  2.21  2.27  2.35  2.43  2.52  2.68  2.90  3.17  3.55  4.03  4.71
   2.48  2.59  2.65  2.69  2.78  2.88  3.00  3.21  3.46  3.64  4.02  4.53  5.16  6.21
   2.78  2.91  2.99  3.09  3.16  3.27  3.50  3.73  3.94  4.22  4.70  5.22  6.06  7.30];

% n = 750, eps = 1.5 (c1 ~ 0.71)
quants(1:8, 1:14, 5, 3) = [...
  -2.57 -2.56 -2.54 -2.53 -2.50 -2.45 -2.40 -2.39 -2.36 -2.34 -2.31 -2.28 -2.26 -2.23
  -2.34 -2.32 -2.33 -2.30 -2.29 -2.27 -2.24 -2.21 -2.17 -2.16 -2.14 -2.10 -2.09 -2.07
  -2.01 -1.99 -1.98 -1.98 -1.97 -1.96 -1.95 -1.93 -1.91 -1.90 -1.87 -1.85 -1.84 -1.82
  -1.68 -1.69 -1.69 -1.69 -1.71 -1.69 -1.68 -1.67 -1.65 -1.65 -1.63 -1.61 -1.60 -1.60
   1.69  1.68  1.68  1.69  1.71  1.72  1.73  1.74  1.75  1.78  1.79  1.80  1.84  1.87
   2.02  2.03  2.03  2.06  2.07  2.11  2.12  2.17  2.19  2.23  2.25  2.28  2.32  2.39
   2.48  2.50  2.48  2.50  2.54  2.58  2.61  2.63  2.69  2.75  2.84  2.93  2.95  3.04
   2.79  2.78  2.77  2.80  2.88  2.91  2.97  3.02  3.08  3.16  3.29  3.33  3.43  3.56];

% n = 750, eps = 2.0 (c1 ~ 0.84)
quants(1:8, 1:14, 5, 4) = [...
  -2.66 -2.64 -2.61 -2.65 -2.58 -2.57 -2.55 -2.55 -2.53 -2.51 -2.51 -2.50 -2.49 -2.46
  -2.40 -2.40 -2.40 -2.40 -2.37 -2.36 -2.36 -2.36 -2.35 -2.34 -2.31 -2.30 -2.29 -2.25
  -2.03 -2.03 -2.05 -2.04 -2.03 -2.03 -2.03 -2.04 -2.04 -2.02 -2.00 -1.99 -1.97 -1.97
  -1.72 -1.72 -1.74 -1.74 -1.73 -1.73 -1.73 -1.73 -1.74 -1.72 -1.72 -1.72 -1.71 -1.70
   1.75  1.71  1.71  1.69  1.70  1.69  1.69  1.69  1.70  1.71  1.71  1.72  1.73  1.75
   2.09  2.09  2.09  2.05  2.05  2.04  2.04  2.06  2.08  2.08  2.09  2.12  2.13  2.14
   2.53  2.54  2.49  2.47  2.47  2.48  2.48  2.52  2.55  2.57  2.59  2.60  2.62  2.64
   2.86  2.81  2.77  2.78  2.75  2.73  2.77  2.80  2.88  2.88  2.91  2.95  2.97  2.99];

% n = 1000, eps = 0.5 (c1 ~ 0.28)
quants(1:8, 1:14, 6, 1) = [...
  -2.66 -2.72 -2.83 -3.17 -3.82 -4.92 -6.63 -8.03 -7.33 -6.36  -5.50  -4.79 -4.21 -3.73
  -2.44 -2.48 -2.59 -2.91 -3.51 -4.49 -6.10 -7.69 -7.15 -6.19  -5.35  -4.66 -4.10 -3.62
  -2.08 -2.11 -2.24 -2.50 -3.01 -3.90 -5.30 -7.04 -6.85 -5.97  -5.16  -4.49 -3.94 -3.49
  -1.77 -1.79 -1.92 -2.16 -2.58 -3.31 -4.59 -6.15 -6.60 -5.76  -4.99  -4.34 -3.81 -3.37
   1.87  1.95  2.10  2.36  2.83  3.81  5.53  8.69 14.19 24.40  36.34  -3.02 -2.66 -2.33
   2.26  2.37  2.54  2.88  3.46  4.69  6.81 10.86 18.53 32.76  49.56  -2.85 -2.56 -2.25
   2.72  2.86  3.12  3.54  4.31  5.75  8.59 13.50 24.27 46.74  89.25 137.59 -2.44 -2.16
   3.04  3.25  3.52  4.03  4.82  6.53  9.84 16.19 28.67 56.34 115.13 190.18 -2.25 -2.10];

% n = 1000, eps = 1.0 (c1 ~ 0.52)
quants(1:8, 1:14, 6, 2) = [...
  -2.52 -2.53 -2.47 -2.45 -2.43 -2.42 -2.40 -2.40 -2.44 -2.52 -2.65 -2.87 -3.07 -3.33
  -2.28 -2.29 -2.26 -2.22 -2.20 -2.22 -2.21 -2.21 -2.25 -2.34 -2.48 -2.63 -2.86 -3.11
  -1.96 -1.96 -1.93 -1.94 -1.92 -1.90 -1.92 -1.93 -1.97 -2.06 -2.15 -2.31 -2.51 -2.77
  -1.68 -1.67 -1.66 -1.65 -1.65 -1.65 -1.65 -1.68 -1.71 -1.80 -1.88 -2.00 -2.20 -2.44
   1.68  1.70  1.72  1.75  1.78  1.82  1.88  1.95  2.04  2.12  2.28  2.50  2.79  3.19
   2.03  2.07  2.11  2.15  2.19  2.25  2.31  2.40  2.54  2.66  2.87  3.13  3.52  4.07
   2.43  2.50  2.56  2.57  2.66  2.73  2.82  3.00  3.15  3.35  3.62  3.94  4.44  5.20
   2.74  2.78  2.86  2.89  2.99  3.13  3.25  3.39  3.64  3.84  4.25  4.63  5.21  5.94];

% n = 1000, eps = 1.5 (c1 ~ 0.71)
quants(1:8, 1:14, 6, 3) = [...
  -2.53 -2.54 -2.50 -2.50 -2.47 -2.46 -2.44 -2.41 -2.38 -2.34 -2.31 -2.27 -2.26 -2.23
  -2.33 -2.34 -2.30 -2.28 -2.27 -2.24 -2.22 -2.21 -2.19 -2.17 -2.15 -2.12 -2.09 -2.07
  -2.00 -1.99 -2.01 -1.99 -1.97 -1.95 -1.94 -1.92 -1.92 -1.91 -1.89 -1.87 -1.86 -1.83
  -1.69 -1.71 -1.71 -1.71 -1.71 -1.67 -1.67 -1.66 -1.66 -1.65 -1.63 -1.63 -1.62 -1.61
   1.68  1.69  1.68  1.68  1.70  1.71  1.73  1.73  1.74  1.75  1.77  1.79  1.81  1.83
   2.01  2.02  2.03  2.04  2.06  2.08  2.12  2.16  2.16  2.19  2.22  2.25  2.27  2.31
   2.43  2.46  2.45  2.48  2.49  2.53  2.55  2.58  2.65  2.69  2.73  2.78  2.84  2.90
   2.70  2.74  2.78  2.81  2.82  2.87  2.89  2.89  2.93  3.01  3.07  3.16  3.23  3.30];

% n = 1000, eps = 2.0 (c1 ~ 0.84)
quants(1:8, 1:14, 6, 4) = [...
  -2.70 -2.65 -2.62 -2.59 -2.58 -2.57 -2.58 -2.60 -2.56 -2.53 -2.51 -2.49 -2.47 -2.46
  -2.40 -2.41 -2.39 -2.37 -2.37 -2.37 -2.35 -2.36 -2.35 -2.33 -2.30 -2.28 -2.26 -2.25
  -2.05 -2.04 -2.04 -2.05 -2.04 -2.04 -2.05 -2.04 -2.03 -2.02 -2.00 -2.00 -1.98 -1.96
  -1.73 -1.72 -1.74 -1.74 -1.73 -1.74 -1.74 -1.74 -1.73 -1.72 -1.73 -1.73 -1.71 -1.71
   1.70  1.68  1.69  1.69  1.69  1.69  1.69  1.69  1.69  1.70  1.71  1.72  1.73  1.73
   2.04  2.04  2.04  2.05  2.04  2.04  2.06  2.07  2.07  2.07  2.08  2.08  2.09  2.11
   2.45  2.47  2.45  2.47  2.46  2.47  2.51  2.51  2.50  2.52  2.52  2.55  2.57  2.58
   2.77  2.76  2.80  2.79  2.77  2.76  2.80  2.82  2.83  2.85  2.88  2.87  2.90  2.93];

% n = 2500, eps = 0.5 (c1 ~ 0.28)
quants(1:8, 1:14, 7, 1) = [...
  -2.51 -2.53 -2.59 -2.74 -3.00 -3.67 -4.78 -6.51 -8.74 -8.85 -7.73  -6.77  -5.93  -5.24
  -2.31 -2.33 -2.37 -2.55 -2.77 -3.35 -4.41 -6.00 -8.28 -8.68 -7.63  -6.66  -5.84  -5.16
  -1.97 -1.99 -2.06 -2.16 -2.39 -2.89 -3.82 -5.23 -7.22 -8.41 -7.45  -6.51  -5.71  -5.05
  -1.69 -1.70 -1.74 -1.85 -2.04 -2.46 -3.21 -4.52 -6.35 -8.19 -7.29  -6.38  -5.60  -4.93
   1.73  1.75  1.79  1.94  2.18  2.66  3.53  5.18  8.20 13.75 24.50  32.59  -4.41  -3.95
   2.07  2.11  2.21  2.36  2.68  3.19  4.27  6.32 10.24 17.79 31.87  60.12  95.19  -3.85
   2.45  2.54  2.69  2.93  3.22  3.93  5.28  7.70 12.65 22.49 43.30  83.54 131.83  -3.66
   2.78  2.85  3.02  3.26  3.60  4.36  5.93  8.69 14.35 26.23 52.23 105.70 216.13 339.65];

% n = 2500, eps = 1.0 (c1 ~ 0.52)
quants(1:8, 1:14, 7, 2) = [...
  -2.58 -2.52 -2.47 -2.46 -2.42 -2.40 -2.40 -2.38 -2.42 -2.44 -2.47 -2.50 -2.61 -2.81
  -2.35 -2.27 -2.26 -2.24 -2.22 -2.20 -2.20 -2.22 -2.22 -2.22 -2.25 -2.31 -2.41 -2.63
  -1.97 -1.94 -1.91 -1.91 -1.90 -1.91 -1.90 -1.89 -1.90 -1.92 -1.97 -2.02 -2.11 -2.29
  -1.66 -1.66 -1.64 -1.63 -1.63 -1.64 -1.64 -1.63 -1.62 -1.65 -1.68 -1.74 -1.83 -1.99
   1.67  1.70  1.69  1.71  1.75  1.76  1.78  1.79  1.83  1.88  1.95  2.07  2.21  2.39
   2.02  2.06  2.08  2.10  2.12  2.16  2.18  2.20  2.24  2.31  2.39  2.53  2.72  2.97
   2.47  2.50  2.53  2.55  2.54  2.57  2.66  2.74  2.83  2.88  3.02  3.17  3.35  3.77
   2.78  2.77  2.81  2.88  2.89  2.91  3.04  3.13  3.23  3.25  3.43  3.68  3.99  4.31];

% n = 2500, eps = 1.5 (c1 ~ 0.71)
quants(1:8, 1:14, 7, 3) = [...
  -2.55 -2.54 -2.53 -2.49 -2.50 -2.45 -2.43 -2.42 -2.40 -2.40 -2.39 -2.36 -2.36 -2.32
  -2.34 -2.32 -2.31 -2.29 -2.27 -2.23 -2.21 -2.22 -2.20 -2.18 -2.16 -2.16 -2.15 -2.13
  -1.98 -1.96 -1.95 -1.94 -1.94 -1.92 -1.92 -1.92 -1.90 -1.89 -1.88 -1.88 -1.86 -1.84
  -1.65 -1.66 -1.66 -1.64 -1.64 -1.63 -1.64 -1.64 -1.63 -1.63 -1.63 -1.62 -1.61 -1.59
   1.60  1.60  1.61  1.63  1.64  1.64  1.65  1.67  1.67  1.68  1.69  1.71  1.72  1.75
   1.95  1.91  1.92  1.93  1.95  1.98  2.00  2.01  2.02  2.04  2.07  2.11  2.14  2.17
   2.36  2.34  2.34  2.34  2.32  2.35  2.36  2.38  2.38  2.42  2.47  2.54  2.58  2.63
   2.59  2.60  2.56  2.61  2.58  2.59  2.62  2.67  2.73  2.74  2.77  2.80  2.84  2.89];

% n = 2500, eps = 2.0 (c1 ~ 0.84)
quants(1:8, 1:14, 7, 4) = [...
  -2.56 -2.57 -2.55 -2.54 -2.56 -2.56 -2.54 -2.53 -2.51 -2.51 -2.50 -2.47 -2.46 -2.44
  -2.33 -2.33 -2.32 -2.30 -2.32 -2.33 -2.31 -2.29 -2.28 -2.25 -2.26 -2.26 -2.24 -2.24
  -1.96 -2.00 -2.00 -1.99 -1.98 -1.98 -1.98 -1.98 -1.96 -1.96 -1.95 -1.94 -1.92 -1.91
  -1.67 -1.70 -1.70 -1.70 -1.70 -1.70 -1.71 -1.71 -1.71 -1.69 -1.68 -1.67 -1.66 -1.65
   1.69  1.70  1.69  1.68  1.68  1.69  1.69  1.70  1.71  1.71  1.71  1.70  1.71  1.72
   2.06  2.08  2.03  2.01  2.03  2.03  2.04  2.07  2.07  2.07  2.06  2.07  2.07  2.07
   2.47  2.44  2.45  2.45  2.44  2.42  2.45  2.42  2.44  2.45  2.45  2.47  2.51  2.49
   2.72  2.71  2.76  2.74  2.74  2.69  2.70  2.71  2.70  2.72  2.76  2.81  2.78  2.79];

%%%%%%%%%%%%%%%%%%%%%%%%%% Look-up of the appropriate quantiles %%%%%%%%%%%%%%%%%%%%%%%%%%

% Determine in between which two sample sizes tabulated the current n lies:
lower =     sum(n >= ncases);
upper = 8 - sum(n <= ncases);

% Fix some special cases; for samples of less than 50, use the values for 50:
if lower == 0
   lower = 1;

% and since there are no tabulated values for n = 750, eps = 0.5, reference to the
% corresponding part of the quantile table must be avoided:
elseif eps == 0.5
   if lower == 5
      lower = 4;
   end
   if upper == 5
      upper = 6;
   end
end

% Determine the significance level in turn for each BDS statistic contained in W:
for i = 1 : length(w)

   % Find the eight quantile values each for the lower and upper sample sizes:
   lowerqus    = reshape(quants(1:8, m(i)-1, lower, eps*2), 8, 1);

   if n <= 2500
      upperqus = reshape(quants(1:8, m(i)-1, upper, eps*2), 8, 1);
         
   else % i.e. approaching standard normality:
      upperqus = norminv(siglevels([1:4 6:9]))';
      ncases   = [ncases 5000];
   end

   % Interpolate the quantile values for the actual sample size from the quantile
   % values of the surrounding sample sizes; note that this method may slightly
   % increase the size of a type I error for sample sizes which are not close to one
   % of the tabulated cases; this problem could be mitigated by a response surface
   % yet to be developed.
   if lower ~= upper
      qus = lowerqus + (upperqus - lowerqus) * (n - ncases(lower)) /...
                                                      (ncases(upper) - ncases(lower));
   else
      qus = lowerqus;
   end
      
   % Find the matching significance levels; at least one of the terms must be 1, or
   % both, so their product yields the overall one-sided significance level:
   sig(i) = siglevels(5 - sum(w(i)<=qus(1:4))) * siglevels(5 + sum(w(i)>=qus(5:8)));
end

%%%%%%%%%%%%%%%%%%%%%%%%% Otherwise use standard-normal look-up %%%%%%%%%%%%%%%%%%%%%%%%%

else
   qus = [norminv(siglevels(1:4)) norminv(1 - siglevels(6:9))]';
   for i = 1 : length(w)
      sig(i) = siglevels(5 - sum(w(i)<=qus(1:4))) * siglevels(5 + sum(w(i)>=qus(5:8)));
   end
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% REFERENCES:
%
% Kanzler, Ludwig (1998), "Very Fast and Correctly Sized Estimation of the BDS Statistic",
%    Oxford University, Department of Economics, working paper, available on
%    http://users.ox.ac.uk/~econlrk


% End of file.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -