Re: [R] Using constrOptim() function

2009-06-04 Thread spencerg
It looks to me like you need to add "x" to the arguments in your call to "constrOptim", something like the following: constrOptim(beta_i, myFunction, NULL, ui, ci, mu = 1e-04, control = list(), method = "Nelder-Mead",outer.iterations = 100, outer.eps = 1e-05, x=x) The first "x"

[R] Using constrOptim() function

2009-06-03 Thread Ali Mahani
I have a function myFunction(beta,x) where beta is a vector of coefficients and x is a data frame (think of it as a matrix). I want to optimize the function myFunction() by ONLY changing beta, i.e. x stays constant, with 4 constraints. I have the following code (with a separate source file for the