[R] GARCH Optimization Problems

Tony455 toy45 at tradermail.info
Thu Aug 1 12:57:18 CEST 2013


Hi all,

Since am new to the forums I'd like to say hello to everyone.

My questions revolves around optimizing a simple GARCH process.

Lets assume we have a function names garchlik and takes as inputs
(parameters, data, p,q); where p and q are the ARCH and GARCH effects. 

Have tried the simple approaches such as:
optim(parameters, fn=garchlik, method = "L-BFGS-B",hessian=TRUE, control =
list(maxit = 20000, pgtol=1e-8), data=data, p=p, q=q)

However am looking into constraint optimization and the functions such that:
constrOptim, solnp among others. But am faced with a number of issues. Let
me describe what am doing and perhaps you may spot what am doing wrong.

parameters = c(mean(data), 0.005, 0.10, 0.85)
r = NROW(parameters)

Constrains are:
omega >=0
ARCH >=0
GARCH>=0
ARCH+GARC H<=1

(A = rbind(cbind(array(0, c((r-1),1)),  -diag(r-1)),
 cbind(array(0, c(1,r-p-q)), array(1,c(1,2)))))
(b = c(array(0,c(1,r-1)), array(1 - 1e-6, 1)))
lowerBounds = c(-100*abs(a0), array(1e-6, c((length(parameters)-1))))
upperBounds = c(100*abs(a0), array(1-1e-6, c((length(parameters)-1))))

Case A: constrOptim:
constrOptim(parameters,  garchlik, grad=NULL, ui=A, ci=b)

Error in constrOptim(parameters, garchlik, grad = NULL, ui = A, ci = b) : 
  initial value is not in the interior of the feasible region

Case B: 
solnp(parameters, fun=garchlik, neqfun =A, ineqLB = b, LB=lowerBounds,
UB=upperBounds, p=1,q=1,data=data)

whereas in solnp it works perfectly if neqfun and ineqLB are not used.

But both appear to fail for various reaons.

Any ideas?

Many thanks,
Tony



--
View this message in context: http://r.789695.n4.nabble.com/GARCH-Optimization-Problems-tp4672807.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list