Learn R Programming

DREGAR (version 0.1.0.0)

sim.dregar: Simulating data from DREGAR model

Description

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

Usage

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

See Also

dregar , generateAR

Examples

Run this code
  simdata=sim.dregar(n = 100 , beta = 1,
    ind = TRUE , phi = .40 , theta = -.25,
    var = 1 , plot = TRUE)
  str(simdata)

Run the code above in your browser using DataLab