[R-sig-ME] Optimize multiple confounded parameters using optim()

Jeff Newmiller jdnewmil @ending from dcn@d@vi@@c@@u@
Thu May 17 18:12:15 CEST 2018

I am not sure I follow your explanation of the problem domain, but the equations look like the kind of thing that linear programming was designed to solve. There are a few options for that among the contributed packages (look in the Optimization Task View on CRAN).

On May 17, 2018 4:07:10 AM PDT, Keren Halabi <halabikeren at gmail.com> wrote:
>Dear list,
>My apologies in advance if this is not the relevant forum for the below
>I wish to define a codon site model, which is mixture model over
>dN/dS ratios.
>Thus, I want to constrain each  dN/dS ratio by its preceding ratio in
>mixture and its following ratio in the mixture. I was thinking of using
>bounds parameter of the optim() function to achieve this.
>However, I am experiencing an issue while attempting to optimize a
>with regards to multiple parameters. Specifically, due to setting the
>bounds to be dependent on one another.
>Here is a basic example: say that I want to optimize the below function
>named "test', with regards to vector v, with the following constraint:
>test <-function(v=c(0,1)) {return(v[2]-v[1])}
>Now, calling optim() with the following settings:
>res = optim(c(a,b), test, lower=c(0,a), upper=c(b,1),method="L-BFGS-B")
>Yields optimized values:
>It appears that the constraint was not satisfied, but the bounds still
>some  affect on the result. This makes me suspect that I didn't set the
>lower and upper bounds correctly when calling optim().
>Could you please let me know what I did wrong?
>Many thanks!
>	[[alternative HTML version deleted]]
>R-sig-mixed-models at r-project.org mailing list

Sent from my phone. Please excuse my brevity.

More information about the R-sig-mixed-models mailing list