coef.RdIt extracts the coefficients from gel or gmm objects.
Vector of coefficients
#################
n = 500
phi<-c(.2,.7)
thet <- 0
sd <- .2
x <- matrix(arima.sim(n=n,list(order=c(2,0,1),ar=phi,ma=thet,sd=sd)),ncol=1)
y <- x[7:n]
ym1 <- x[6:(n-1)]
ym2 <- x[5:(n-2)]
H <- cbind(x[4:(n-3)], x[3:(n-4)], x[2:(n-5)], x[1:(n-6)])
g <- y ~ ym1 + ym2
x <- H
t0 <- c(0,.5,.5)
res <- gel(g, x, t0)
coef(res)
#> (Intercept) ym1 ym2
#> 0.02176832 0.18892009 0.68086989
coef(res, lambda = TRUE)
#> Lam((Intercept)) Lam(h1) Lam(h2) Lam(h3)
#> 0.0007252678 0.0161828198 0.0143784507 -0.0204864392
#> Lam(h4)
#> -0.0149815837
###################
res <- gmm(g, x)
coef(res)
#> (Intercept) ym1 ym2
#> 0.02017943 0.19078355 0.67776264