# NOT RUN {
ans <- opm(fn = function(x) sum(x*x), par = 1:2, method="ALL", control=list(trace=1))
coef(ans)
# }
# NOT RUN {
proj <- function(x) x/sum(x)
f <- function(x) -prod(proj(x))
ans <- opm(1:2, f)
ans
coef(ans) <- apply(coef(ans), 1, proj)
ans
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab