The following data generating process is similar to sim_psy1
, with the difference that
there are two episodes of mildly explosive dynamics.
sim_psy2(n, te1 = 0.2 * n, tf1 = 0.2 * n + te1, te2 = 0.6 * n,
tf2 = 0.1 * n + te2, c = 1, alpha = 0.6, sigma = 6.79,
seed = NULL)
A strictly positive integer specifying the length of the simulated output series.
A scalar in (0, n) specifying the observation in which the first bubble originates.
A scalar in (te1, n) specifying the observation in which the first bubble collapses.
A scalar in (tf1, n) specifying the observation in which the second bubble originates.
A scalar in (te2, n) specifying the observation in which the second bubble collapses.
A positive scalar determining the autoregressive coefficient in the explosive regime.
A positive scalar in (0, 1) determining the value of the expansion rate in the autoregressive coefficient.
A positive scalar indicating the standard deviation of the innovations.
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 save as "seed" attribute
of the returned value. The default, NULL will note change the rng state, and
return .Random.seed as the "seed" attribute.
A numeric vector of length n
.
The data generating process is described by:
$$X_t = X_{t-1}1\{t \in N_0\}+ \delta_T X_{t-1}1\{t \in B_1 \cup B_2\} + \left(\sum_{k=\tau_{1f}+1}^t \epsilon_k + X^*_{\tau_{1f}}\right) 1\{t \in N_1\} $$
$$ + \left(\sum_{l=\tau_{2f}+1}^t \epsilon_l + X^*_{\tau_{2f}}\right) 1\{t \in N_2\} + \epsilon_t 1\{t \in N_0 \cup B_1 \cup B_2\}$$
where the autoregressive coefficient \(\delta_T\) is given:
$$\delta_T = 1 + cT^{-a}$$
with \(c>0\), \(\alpha \in (0,1)\), \(\epsilon \sim iid(0, \sigma^2)\), \(X_{\tau_{1f}} = X_{\tau_{1e}} + X^*\) and \(X_{\tau_{2f}} = X_{\tau_{2e}} + X^*\). We use the notation \(N_0 = [1, \tau_{1e})\), \(B_1 = [\tau_{1e}, \tau_{1f}]\), \(N_1 = (\tau_{1f}, \tau_{2e})\), \(B_2 = [\tau_{2e}, \tau_{2f}]\), \(N_2 = (\tau_{2f}, \tau]\), where \(\tau\) is the last observation of the sample. After the collapse of the first bubble, \(X_t\) resumes a martingale path until time \(\tau_{2e}-1\), and a second episode of exuberance begins at \(\tau_{2e}\). The expansion process lasts until \(\tau_{2f}\) and collapses to a value of \(X^*_{\tau_{2f}}\). The process then continues on a martingale path until the end of the sample period \(\tau\). The expansion duration of the first bubble is assumed to be longer than that of the second bubble, i.e. \(\tau_{1f}-\tau_{1e}>\tau_{2f}-\tau_{2e}\).
For further details the user can refer to Phillips et al., (2015) p. 1055.
Phillips, P. C. B., Shi, S., & Yu, J. (2015). Testing for Multiple Bubbles: Historical Episodes of Exuberance and Collapse in the S&P 500. International Economic Review, 5 6(4), 1043-1078.
# NOT RUN {
# 100 periods with bubble origination dates 20/60 and termination dates 40/70 respectively
sim_psy2(n = 100)
# 200 periods with bubble origination dates 40/120 and termination dates 80/140 respectively
sim_psy2(n = 200)
# }
Run the code above in your browser using DataLab