Hi, I am a bit stuck on specifying ui and ci. I have read Lange's book ((1999) Numerical Analysis for Statisticians) to his approach and unfortunately his descriptions were not helpful for me. Here is what I have: ui <- rbind(c(0, -1, 0), c(0, 0, -1)) ci <- c(0, -1, -1)) theta <- c(0.5, 0.5, 0.1) My goal is to feed these into constrOptim such that there is no constraint on theta[1] and that theta[2] and theta[3] are both constrained to fall between 0.0 and 1.0. Perhaps my values for ui and ci are incorrect for these constraints. I have already solved the problem in another statistics package so I know the actual solution to the coefficients. But our ultimate goal is to do additional work in R. But so far, I have been unable to recreate our solution in R. Thank you, Stu [[alternative HTML version deleted]]
Allan Engelhardt
2009-Jun-17 17:11 UTC
[R] Specifying ui and ci such that ui %*% theta - ci >= 0
My understanding is that optim(method="L-BFGS-B") does box constraints and constrOptim linear constraints. You want box. On 17/06/09 17:51, Stu @ AGS wrote:> Hi, > [...] > > > My goal is to feed these into constrOptim such that there is > no constraint on theta[1] and that theta[2] and theta[3] are both > constrained to fall between 0.0 and 1.0. > > > > Perhaps my values for ui and ci are incorrect for these > constraints. > >[[alternative HTML version deleted]]