sim_psy2: Simulation of a two-bubble process

Description Usage Arguments Details Value References See Also Examples

View source: R/sim.R

Description

The following data generating process is similar to sim_psy1, with the difference that there are two episodes of mildly explosive dynamics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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
)

Arguments

n

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

te1

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

tf1

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

te2

A scalar in (tf1, n) specifying the observation in which the second bubble originates.

tf2

A scalar in (te2, n) specifying the observation in which the second 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.

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 different between the parallel and non-parallel option, even if they have the same seed.

Details

The two-bubble data generating process is given by (see also sim_psy1):

X[t]=X[t-1] 1{t in N[0]}+ δ[T] * X[t-1] 1{t in B[1] union B[2]} + (∑[k=t1f+1]^t ε[k] + X'[t1f]) 1{t in N[1]} +

(∑[l=t2f+1]^t ε[l] + X'[t2f]) 1{t in N[2]} + ε[t] 1{t in N[0] union B[1] union B[2]},

where the autoregressive coefficient δ[T] is:

δ[T] = 1 + c*T^{-a},

with c>0, α in (0,1), ε - iid(0, σ^2), N0 = [1, t1e), B1 = [te1, t1f], N0 = (t1f, t2e), N0 = [t2e, t2f], N0 = [t2f, t], where t is the last observation of the sample. The observations te1 = [T re1] and tf = [T r1f] are the origination and termination dates of the first bubble; te2 = [T re2] and tf = [T r2f] are the origination and termination dates of the second bubble. After the collapse of the first bubble, X[t] resumes a martingale path until time t2e - 1, and a second episode of exuberance begins at t2e. Exuberance lasts lasts until t2f at which point the process collapses to a value of X[t2f]. The process then continues on a martingale path until the end of the sample period t. The duration of the first bubble is assumed to be longer than that of the second bubble, i.e. t1f - t1e > t2f - t2e.

For further details you can refer to Phillips et al., (2015) p. 1055.

Value

A numeric vector of length n.

References

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.

See Also

sim_psy1, sim_blan, sim_evans

Examples

1
2
3
4
5
6
7
# 100 periods with bubble origination dates 20/60 and termination dates 40/70
sim_psy2(n = 100, seed = 123) %>%
 autoplot()

# 200 periods with bubble origination dates 40/120 and termination dates 80/140
sim_psy2(n = 200, seed = 123) %>%
  autoplot()

kvasilopoulos/exuber documentation built on Aug. 8, 2020, 7:52 a.m.