Simulate LTM model using many

ltm_sim(ns, nk, ni, vmu, mPhi, mSigs, dsig, vd, alpha)

Arguments

ns

number of times

nk

number of covariates

ni

number of series

vmu

vector mu

mPhi

phi diagonal matrix with the parameters

mSigs

sigma eta vector

dsig

general sigma

vd

threshold parameter

alpha

intercept

Value

List containing the generated y, x, beta and thresholded beta.

References

Nakajima, Jouchi, and Mike West. "Bayesian analysis of latent threshold dynamic models." Journal of Business & Economic Statistics 31.2 (2013): 151-164.

Examples

# Generates 10 series, each one with 500 observations and 2 regressors. d_sim <- ltm_sim( ns = 500, nk = 2, ni = 10, vmu = matrix(c(.5,.5), nrow = 2), mPhi = diag(2) * c(.99, .99), mSigs = c(.1,.1), dsig = .15, vd = matrix(c(.4,.4), nrow = 2), alpha = 0 ) str(d_sim)
#> List of 4 #> $ vy : num [1:10, 1:500] -0.5647 0.059 0.0604 0.3678 0.023 ... #> $ mx : num [1:10, 1:500, 1:2] -0.3045 0.3113 0.0901 0.2859 0.3448 ... #> $ mb : num [1:500, 1:2] 0.639 0.69 0.741 0.532 0.566 ... #> $ mb_zerado: num [1:500, 1:2] 0.639 0.69 0.741 0.532 0.566 ...