Learn R Programming

DREGAR (version 0.1.0.0)

dregar:

Estimating DREGAR coefficients

Description

Estimating coefficients for penalized/non-penalized dynamic regression in the presence of autocorrelated residuals.

Usage

dregar(data, da = 0, ar = 0, mselection = 4, normalize = FALSE, penalized = TRUE, iteration = 15)

Arguments

data

Data matrix of order (time, response, covariates)

da

A vector of lags. Autoregressive orders for response. For example 1:p for all lags from 1 to p

ar

A vector of lags. Autoregressive orders for residuals. For example 1:q for all lags from 1 to q

mselection

Model selection criteria. Choosing among 1 (CP), 2 (AIC), 3 (GCV) and 4 (BIC)

normalize

Logical flag. Setting to TRUE to normalize data prior to analysis

penalized

Logical flag. Setting to TRUE to estimate coefficients through penalized likelihood. Otherwise the algorithm applies iterative OLS.

iteration

The number of iterations

See Also

generateAR , sim.dregar

Examples

Run this code
  m=sim.dregar(n=500 ,  beta=1:4, phi=generateAR(2), theta=.3, 
               n.z.coeffs=3 , plot=TRUE) # generating data
  r=dregar(data = m$rawdata,da = 1:2,ar = 1,mselection = 4,penalized = 1)# estimating parameters
  round(cbind(
    true      = c(phi=m$phi,theta=m$theta,beta=m$beta),
    estimates = c(phi=r$phi,theta=r$theta,beta=r$beta)
  )
  ,3
  )

Run the code above in your browser using DataLab