Simulation
Simulate fractionally-integrated (long-memory) innovations
sim_fi sim_fi(n, d = 0.2, sigma = 1, seed = NULL) Generates , with i.i.d. , through a truncated expansion of the fractional-differencing operator, for use as sim_psy1(..., e = sim_fi(...)).
Arguments
| n | Number of innovations to generate. |
| d | Long-memory (fractional differencing) parameter, in (0, 0.5) so that itself is stationary. |
| 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. It is either NULL or an integer, which is passed to
set.seed before the simulation. If you set it, the value is saved as the
"seed" attribute of the returned value. The default, NULL, leaves the state of
the rng unchanged and returns .Random.seed as the "seed" attribute. Results are
reproducible across the parallel and the non-parallel option when you use the
same seed. |
Value
A numeric vector of length n.
Details
The expansion is truncated at max(200, n) lags with a matching burn-in, which is dropped before the function returns, to limit the truncation bias in the early observations.
Examples
These examples are copied from the package's own documentation and are run by R CMD check on every release.
The printed output (after #>) and the plots were produced by running them against the current package source.
sim_fi(199, d = 0.2, seed = 1) %>%
autoplot() See also
References
Lui, Y.L., Phillips, P.C.B. & Yu, J. (2024). "Robust testing for explosive behavior with strongly dependent errors."
exuber