mixARnoise_sim: Simulate white noise series from a list of functions and...

View source: R/mixARcalc.R

mixARnoise_simR Documentation

Simulate white noise series from a list of functions and vector of regimes

Description

Simulate white noise series from a list of functions and vector of regimes. This function is used internally for simulation from MixAR models.

Usage

mixARnoise_sim(rdist, z)

Arguments

rdist

a list of functions for random number generation, see ‘Details’.

z

a vector of positive integers specifying the 'regimes'.

Details

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]].

Value

a numeric vector

See Also

mixAR_sim

Examples

## 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)

GeoBosh/mixAR documentation built on May 9, 2022, 7:36 a.m.