KConfid {gmmExtra} | R Documentation |
The confidence is either an interval or an ellipse.
KConfid(obj, which, type = c("K", "KJ"), alpha = 0.05, alphaJ = 0.01, n = 4, mc.cores=1)
obj |
Object of class "gmm" returned by gmm (not restricted) |
type |
Should we base the confidence interval on the K or K-J statistics. |
which |
A 2x1 vector or a scalar. The interval is computed for |
alpha, alphaJ |
The overall size and the size for the J-test when type is "KS". |
n |
The number of points to compute the confidence region is 4(n-1). It must be greater than2. |
mc.cores |
The number of cores to use in mclapply |
Interval for lenght(which)=1
or a series of points if lenght(which)>1
.
Kleibergen, F. (2005), Testing Parameters in GMM without assuming that they are identified. Econometrica, 73, 1103-1123,
data(Finance) r <- Finance[1:300, 1] rf <- Finance[1:300, "rf"] z <- as.matrix(r-rf) zm <- Finance[1:300, "rm"]-rf f1 <- zm f2 <- Finance[1:300, "hml"] - rf f3 <- Finance[1:300, "smb"] - rf ## Kconfid fails with prewhite=1 res <- gmm(z ~ f1 + f2 + f3, ~ f1 + f2 + f3, prewhite=0) ## To avoid errors especially with windows OS ## Not run: KConfid(res,2, mc.cores=4) sol <- KConfid(res,c(2,3), mc.cores=4) plot(sol, main="Confidence Region") polygon(sol,col="grey") points(res$coef[2],res$coef[3],pch=21,bg=1) text(res$coef[2],res$coef[3],expression(hat(theta)),pos=3) ## End(Not run)