[R] Optimization inconsistencies

Hans W Borchers hwborchers at googlemail.com
Fri May 18 10:33:49 CEST 2012


Marc Girondot <marc_grt <at> yahoo.fr> writes:
> 
> Le 18/05/12 00:14, Nathan Stephens a écrit :
> > I have a very simple maximization problem where I'm solving for the vector
> > But I get inconsistent results depending on what starting values I. I've
> > tried various packages but none seem to bee the very solver in Excel. Any
> > recommendations on what packages or functions I should try?
> > [...]

> I had similar problem to solve (x were frequencies) and optimization 
> stops before to reach the global maximum. As [...] indicate[d], I fitted
>  {x}-1 values because the last one is known by the equality constraint.
> 
> For the vector constraints, I used w <- -Inf when x goes out of the limits.

Same as before:
Would you *please* post data and code, as the posting guide requests!

The variable that is left out still has some (linear) inequalities to fullfil. 
I didn't understand how you worked that out with optim() as it only allows to
include box constraints.

Hans Werner

> Finally I used Bayesian mcmc to get the convergence and it works much 
> better.
> 
> I don't know why in this case the optim does not converge.
> 
> Hope it hepls,
> 
> Marc



More information about the R-help mailing list