search for: thetavec

Displaying 1 result from an estimated 1 matches for "thetavec".

Did you mean: thetaref
2007 Aug 01
1
constrOptim
Hi, I'm having trouble using the constrOptim function to generate the 9-component vector argmin of the function ELfsds: ELfsds <- function(pvechat){ LG=0 for(i in 1:9){ LG=LG+log(pvechat[i]) } return(-LG) } with accompanying gradient function: gradfunc <- function(thetavec){ g=1/(9*thetavec) return(g) } The constraints on the optimization problem are: 1 - components of potentialargmin must add to 1. 2 - each potentialargmin component must be (weakly) positive and (weakly) less than 1. 3 - potentialargmin %*% c(1,2,3,4,5,6,7,8,9) = 4.5 I'm starting the optimiz...