Description Usage Arguments Author(s) See Also Examples
Estimating coefficients for penalized/non-penalized dynamic regression in the presence of autocorrelated residuals using an iterative 2-step procedure.
1 2 3 |
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 |
Hamed Haselimashhadi <hamedhaseli@gmail.com>
dregar6
,
generateAR
,
sim.dregar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | par(mfrow=c(2,2))
m=sim.dregar(n=500 , beta=1:4, phi=generateAR(2), theta=.3,
n.z.coeffs=3 , plot=TRUE) # generating data
r=dregar2(data = m$rawdata,da = 1:3,ar = 1:2,mselection = 4,
penalized = 1 )# estimating parameters using2-step adaptive-DREGAR
round(cbind(
true = c(phi=c(m$phi,0),theta=c(m$theta,0),beta=m$beta),
estimates = c(phi=r$phi,theta=r$theta,beta=r$beta)
)
,3
)
plot(r$obj)
acf(r$res, main='Residual ACF')
pacf(r$res,main='Residual PACF')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.