# sim_blan: Simulation of a Blanchard (1979) bubble process In kvasilopoulos/exuber: Econometric Analysis of Explosive Time Series

## Description

Simulation of a Blanchard (1979) rational bubble process.

## Usage

 `1` ```sim_blan(n, pi = 0.7, sigma = 0.03, r = 0.05, b0 = 0.1, seed = NULL) ```

## Arguments

 `n` A positive integer specifying the length of the simulated output series. `pi` A positive value in (0, 1) which governs the probability of the bubble continuing to grow. `sigma` A positive scalar indicating the standard deviation of the innovations. `r` A positive scalar that determines the growth rate of the bubble process. `b0` The initial value of the bubble. `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

Blanchard's bubble process has two regimes, which occur with probability π and 1-π. In the first regime, the bubble grows exponentially, whereas in the second regime, the bubble collapses to a white noise.

With probability π:

B[t+1]=(1+r)/π*B[t]+ε[t+1],

With probability 1 - π:

B[t+1] = ε[t+1],

where `r` is a positive constant and ε - iid(0, σ^2).

## Value

A numeric vector of length `n`.

## References

Blanchard, O. J. (1979). Speculative bubbles, crashes and rational expectations. Economics letters, 3(4), 387-389.

`sim_psy1`, `sim_psy2`, `sim_evans`
 ```1 2``` ```sim_blan(n = 100, seed = 123) %>% autoplot() ```