Simulating data from DREGAR model

Share:

Description

Simulating a mean zero Gaussian lagged response regression in the presence of autocorrelated residuals

Usage

1
2
3
  sim.dregar(n = 500    , beta = 1, ind = FALSE  , 
             phi = .3, theta = .5, var = 1 , n.z.coeffs=0,
             shuffle = FALSE     , plot = FALSE  )

Arguments

n

The number of data points to be simulated

beta

Regression coefficients

ind

Logical flag. If TRUE then observations are assumed to be independent. Otherwise they are generated from random AR(1) processes. In both cases, variables are assumed to be mutually independent and follow Gaussian distribution.

phi

Dynamic coefficient(s)

theta

Residuals coefficient(s)

var

Variance of the error term

n.z.coeffs

Number of zero coefficients if needed

shuffle

Logical flag. If TRUE shuffle coefficients. Otherwise data are grouped corresponded to non-zero and zero coefficients.

plot

Logical flag. Plot response

Author(s)

Hamed Haselimashhadi <hamedhaseli@gmail.com>

See Also

dregar , generateAR

Examples

1
2
3
4
  simdata=sim.dregar(n = 100 , beta = 1,
    ind = TRUE , phi = .40 , theta = -.25,
    var = 1 , plot = TRUE)
  str(simdata)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.