mixARnoise_sim | R Documentation |
Simulate white noise series from a list of functions and vector of regimes. This function is used internally for simulation from MixAR models.
mixARnoise_sim(rdist, z)
rdist |
a list of functions for random number generation, see ‘Details’. |
z |
a vector of positive integers specifying the 'regimes'. |
If the length of the list rdist
is max(z)
, then
z[[i]]
is the random number generator for regime i
.
Alternatively, if rdist
is of length one, then the same
generator will be used for all regimes.
mixARnoise_sim
returns a vector, say y
, of the same
length as z
, such that y[i]
is generated by
z[[i]]
.
a numeric vector
mixAR_sim
## MixAR with 2 components: N(0,1) and t_5
set.seed = 1234
z <- sample(2, size = 5, replace = TRUE)
mixARnoise_sim(list(rnorm, function(n) rt(n, 5)), z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.