Skip to contents

Simulation of Chen, Phillips & Shi (2023)'s common-bubble DGP: n_series observed series driven by one latent PSY-style bubble factor plus idiosyncratic noise, \(X_t = \Lambda f_t + e_t\), loadings \(\Lambda \sim U[0,2]\). Unlike every other sim_* function, this returns a multi-column data.frame (one column per series, exuber's standard panel input shape) rather than a single numeric vector.

Usage

sim_common(
  n_series,
  n,
  te = 0.4 * n,
  tf = 0.15 * n + te,
  c = 1,
  alpha = 0.6,
  sigma = 6.79,
  sigma_e = 0.1,
  seed = NULL
)

Arguments

n_series

A positive integer, the number of observed series.

n

A positive integer specifying the length of the simulated output series.

te

A scalar in (0, tf) specifying the observation in which the bubble originates.

tf

A scalar in (te, n) specifying the observation in which the bubble collapses.

c

A positive scalar determining the autoregressive coefficient in the explosive regime.

alpha

A positive scalar in (0, 1) determining the value of the expansion rate in the autoregressive coefficient.

sigma

A positive scalar indicating the standard deviation of the innovations.

sigma_e

A non-negative scalar, the idiosyncratic-noise standard deviation.

seed

An object specifying if and how the random number generator (rng) should be initialized. Either NULL or an integer will be used in a call to set.seed before simulation. If set, the value is saved as "seed" attribute of the returned value. The default, NULL, will not change rng state, and return .Random.seed as the "seed" attribute. Results are reproducible across the parallel and non-parallel option when the same seed is used.

Value

A data.frame with n_series numeric columns of length n, plus a "factor" attribute holding the latent bubble factor itself.

References

Chen, Y., Phillips, P.C.B. & Shi, S. (2023). "Common Bubble Detection in Large Dimensional Financial Systems." Cowles Foundation Discussion Paper.

See also

Examples

sim_common(n_series = 5, n = 100, seed = 123)
#>     series_1  series_2  series_3 series_4  series_5
#> 1   30.47309 114.59266  47.69801 192.3043 120.37827
#> 2   29.42740 110.20056  46.01287 185.3331 115.69045
#> 3   28.77771 108.28365  45.27456 182.1333 113.76247
#> 4   31.96377 120.59551  50.20308 202.5527 126.53054
#> 5   32.13768 121.19308  50.33365 203.4819 127.08032
#> 6   32.51688 122.10233  51.12884 205.2401 128.17890
#> 7   36.07261 135.35821  56.52079 227.4260 142.25841
#> 8   36.95047 138.98468  58.00618 233.4435 145.98364
#> 9   34.49599 128.99826  53.66555 217.0407 135.55770
#> 10  33.11161 123.88296  51.71982 207.9995 130.08860
#> 11  32.06179 120.33271  50.13311 202.4612 126.34079
#> 12  34.51912 129.93392  54.09817 218.0785 136.31683
#> 13  35.30526 132.67251  55.40317 222.7630 139.29126
#> 14  36.25690 135.92791  56.54743 228.2243 142.58923
#> 15  36.33019 136.69581  57.05886 229.6828 143.49011
#> 16  35.04150 132.62642  55.21660 222.4026 138.82745
#> 17  38.86908 146.28558  60.87119 245.7151 153.54492
#> 18  40.02132 150.12675  62.63049 252.2438 157.61356
#> 19  35.94186 134.73166  56.16607 226.3721 141.52497
#> 20  37.34936 140.30804  58.54429 235.7310 147.32393
#> 21  36.36334 136.51156  56.89862 229.3714 143.41003
#> 22  34.17980 128.35651  53.49809 215.4702 134.54091
#> 23  33.85634 126.50094  52.62240 212.4492 132.68186
#> 24  31.60681 118.66892  49.46230 199.1638 124.76905
#> 25  29.96193 112.91498  47.20874 189.8108 118.66685
#> 26  28.68339 107.93404  45.06077 181.6389 113.47820
#> 27  25.33490  95.09206  39.68267 159.5229  99.63450
#> 28  26.96495 101.55363  42.13321 170.3705 106.46615
#> 29  27.41821 102.56497  42.75063 172.6144 107.84524
#> 30  25.07030  93.80988  39.18578 157.4458  98.39934
#> 31  27.71043 103.48276  43.22016 173.9962 108.69968
#> 32  28.44738 106.83670  44.40261 179.5164 112.27190
#> 33  27.77836 104.65215  43.48938 175.6008 109.69601
#> 34  29.67022 111.65382  46.39787 187.4315 117.13160
#> 35  31.23677 118.48967  49.34407 198.8001 124.39050
#> 36  33.08827 124.85819  51.94481 209.6396 131.08114
#> 37  34.67356 130.13223  54.25677 218.6774 136.65352
#> 38  35.74827 134.12433  55.94701 225.9220 140.95604
#> 39  35.66681 134.02760  55.81671 225.0961 140.60154
#> 40  37.13427 140.13593  58.41720 235.4055 146.91899
#> 41  38.73083 145.97209  60.93016 245.0319 153.16060
#> 42  39.79124 149.60614  62.40667 251.6819 157.11353
#> 43  41.82456 157.60160  65.56155 264.6240 165.20424
#> 44  41.96964 157.74937  65.63081 264.7636 165.49001
#> 45  48.93043 184.32564  76.90827 309.9654 193.50873
#> 46  54.77037 205.56258  85.53232 345.2473 215.62035
#> 47  55.86769 209.98465  87.42381 352.4111 220.24290
#> 48  58.33711 219.67367  91.48118 369.2764 230.80675
#> 49  61.27032 230.15870  95.84194 386.5931 241.44077
#> 50  66.42601 250.62976 104.39274 421.1008 263.19439
#> 51  70.75547 265.69062 110.88667 446.5906 279.12121
#> 52  75.67418 284.48236 118.62204 478.0596 298.73889
#> 53  80.15501 302.30901 125.94677 507.9771 317.50059
#> 54  85.37688 321.00797 133.77006 539.1832 337.06161
#> 55  93.58844 351.81393 146.67151 591.0828 369.55548
#> 56  36.61697 138.26383  57.68963 232.3330 145.14226
#> 57  39.99907 149.99299  62.51540 252.3067 157.48495
#> 58  36.63838 138.11310  57.25591 231.8997 145.05987
#> 59  38.02586 142.67685  59.29536 239.4852 149.69779
#> 60  38.12184 143.51610  59.87832 240.9778 150.60522
#> 61  38.67581 145.05242  60.63431 244.0793 152.40688
#> 62  39.22477 148.23053  61.82089 248.9823 155.39866
#> 63  38.18704 144.08109  60.15165 242.3832 151.47078
#> 64  37.81630 141.63239  58.84296 238.0937 148.74873
#> 65  35.51531 133.80887  55.85563 224.6205 140.50559
#> 66  33.45138 125.51212  52.40960 210.7206 131.67840
#> 67  33.98044 127.84727  53.20208 214.5630 134.20834
#> 68  34.94583 131.36522  54.93198 220.6347 137.74453
#> 69  35.22038 131.62253  54.57113 221.0149 138.16886
#> 70  36.80950 138.72419  57.76045 233.2637 145.74110
#> 71  41.09313 154.74674  64.53562 260.0376 162.67540
#> 72  40.11964 151.16607  62.92611 253.5425 158.47325
#> 73  35.34704 133.12724  55.28463 223.4223 139.67196
#> 74  37.48756 140.81669  58.85668 236.5556 147.74408
#> 75  36.17339 135.24622  56.32672 227.2373 142.08599
#> 76  34.46732 130.09787  54.01752 218.1764 136.58204
#> 77  36.90688 137.97669  57.48615 231.9282 144.78495
#> 78  36.07766 135.74681  56.68728 227.8739 142.59753
#> 79  33.67013 126.02865  52.52522 212.0563 132.44230
#> 80  33.86096 127.80025  53.12400 214.4318 133.92201
#> 81  33.61025 126.48887  52.74109 212.5212 132.79916
#> 82  33.75085 126.65704  52.65805 212.7221 132.77062
#> 83  34.25916 129.70343  53.99110 217.6207 136.00656
#> 84  33.69832 126.85133  52.85109 212.8903 133.22756
#> 85  34.99519 131.87586  54.98957 221.1485 138.27324
#> 86  34.56823 130.00959  54.27271 218.3740 136.63556
#> 87  35.44564 132.66506  55.19424 222.8081 139.21907
#> 88  37.45410 140.93402  58.79382 236.8601 148.13835
#> 89  38.62556 144.52592  60.31538 242.7727 151.75281
#> 90  37.83206 142.08166  59.26279 238.5895 148.97613
#> 91  40.21151 150.89626  62.93550 253.5796 158.54924
#> 92  42.32990 158.55593  66.10692 266.6009 166.44157
#> 93  43.27025 162.96835  67.68648 273.5958 171.11050
#> 94  43.74131 164.80338  68.80581 276.8012 173.00386
#> 95  42.46922 159.74285  66.64348 268.5360 167.86603
#> 96  45.41689 170.36554  71.04125 286.3688 179.03664
#> 97  44.02512 165.93106  69.07455 278.6447 173.97606
#> 98  48.49363 182.78768  76.13092 307.1078 191.80216
#> 99  52.02949 194.56735  81.09303 327.0415 204.41187
#> 100 51.19496 192.96756  80.35920 324.1082 202.63747