Displaying 20 results from an estimated 11000 matches similar to: "good numerical optimization to use in R?"
2010 Sep 11
1
nonlinear programming package
Hello R users,
Can anyone recommend me any package that can be used to solve linear programming subject to nonlinear equality/inequality constraints. Rdonlp2 is now unavailable due to licensing issue.
Thanks,
Xiaoxi
[[alternative HTML version deleted]]
2009 Jul 02
2
constrained optimisation in R.
i want to estimate parameters with maximum likelihood method with contraints (contant numbers).
for example
sum(Ai)=0 and sum(Bi)=0
i have done it without the constraints but i realised that i have to use the contraints.
Without constraints(just a part-not complete):
skellamreg_LL=function(parameters,z,design)
{
n=length(z);
mu=parameters[1];
H=parameters[2];
Apar=parameters[3:10];
2009 Sep 03
3
Rdonlp2 package question
Previous versions have this question have partially bounced.
I apologize if parts of this are showing up multiple times on the
list.
Another try ...
There was at one time an R package called Rdonlp2 for solving
constrained nonlinear programming problems. Both the objective
function
and the constraints could be nonlinear in the decision variables.
The package is no longer in the CRAN list.
2008 Aug 19
1
nonlinear constrained optimization
Hi. I need some advises on how to use R to find pi (i is the index) with
the following objective function and constraint:
max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ]
s.t. (sum i)[ f(ai, bi, pi) * Di * pi] / (sum i)[ f(ai, bi, pi) * Di ] <=
constant
f and g are diffentiable.
So, I am thinking of optim with method = "BFGS"? But wonder how to include
the
2009 Feb 05
1
optimal control, maximization with several variables?
Dear all,
I would like to solve the following problem, which can be done with optimal control theory or dynamic programming:
max(x,y) a*u1+b*u2+c*f1(u2) s.t. 0<u1<x, 0<u2<f2(x,u2), x'=f3(u1,u2,x)
which can be rewritten if optimal control theory should be applied as
H=a*u1+b*u2+c*f1(u2)+lambda*(x') s.t. 0<u1<x, 0<u2<f2(x,u2)
The maximum principle
2009 Jan 28
2
constrainOptim
Dear R helpers
I have a question regarding the constrainOptim.
I'm coding the nested logit and would like to set a bound of rho to (0,1] as an extreme value distribution where rho = exp(lambda)/1+exp(lambda)
I wonder if I can do that directly in optim (say rho > 0 & <= 1) or need to use constrainOptim
I read the help but still don't know how to set ui and ci
Thanks,
June
2011 Sep 08
3
global optimisation with inequality constraints
Dear All,
I would like to minimise a nonlinear function subject to linear inequality constraints as part of an R program. I have been using the constrOptim function. I have tried all of the methods that come with Optim, but nothing finds the correct solution. If I use the correct solution as the vector of starting values, though, my program does output the correct solution and optimum - the
2009 Sep 11
1
constrOptim parameters
Dear R wizards: I am playing (and struggling) with the example in the
constrOptim function. simple example. let's say I want to constrain my
variables to be within -1 and 1. I believe I want a whole lot of
constraints where ci is -1 and ui is either -1 or 1. That is, I have 2*N
constraints. Should the following work?
N=10
x= rep(1:N)
ci= rep(-1, 2*N)
ui= c(rep(1, N), rep(-1, N))
2010 Aug 10
1
[Fwd: Re: optimization subject to constraints]
-------------- next part --------------
An embedded message was scrubbed...
From: Gildas Mazo <gildas.mazo at curie.fr>
Subject: Re: [R] optimization subject to constraints
Date: Tue, 10 Aug 2010 15:49:19 +0200
Size: 4924
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100810/78862894/attachment.eml>
2005 Nov 28
3
Looking for constrained optimisation code
_______________________________________________________________________________________
Hi,
I was just wondering if there was any available R code that could handle
general constrained optimisation problems. At the moment I'm using
nlminb and optim, both of which allow box constraints on the parameters,
but ideally I'd like to be able to specify more general constraints on
the solution
2009 Nov 04
3
Constrained Optimization
Hi All,
I'm trying to do the following constrained optimization example.
Maximize x1*(1-x1) + x2*(1-x2) + x3*(1-x3)
s.t. x1 + x2 + x3 = 1
x1 >= 0 and x1 <= 1
x2 >= 0 and x2 <= 1
x3 >= 0 and x3 <= 1
which are the constraints.
I'm expecting the answer x1=x2=x3 = 1/3.
I tried the "constrOptim" function in R and I'm running into some issues.
I first start off
2008 Jul 25
3
Maximization under constraits
I''m looking for a R function which can maximise this logliklihood function,
under the constraits a>0 e b>0
f<-function(param){
a<-param[1]
b <-param[2]
log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(pi
))*(1-pnorm(-b/(2*sqrt(a)), mean=0, sd=1)))))}
I''ve tried maxlik constrOptim e donlp2 but without success.
Thanks so
2010 Jul 26
1
Optimization problem with nonlinear constraint
Dear all,
I'm looking for a way to solve a simple optimization problem with a
nonlinear constraint. An example would be
max x s.t. y = x * T ^(x-1)
where y and T are known values.
optim() and constrOptim() do only allow for box or linear constraints,
so I did not succedd here. I also found hints to donlp2 but this does
not seem to be available anymore.
Any hints are welcome,
2009 Feb 05
2
Non-linear optimisation
Hi there,
I have a piece of Matlab code I use to optimise a trding strategy. If there
are any Matlab/R specialists out there, I would appreciate your help in
doing the exact same optimisation in R.
I suspect I would use nlm() in R but am not sure where to define my
constraints.
I have attached my Matlab code below for reference.
Many thanks.
Constraints
function [c,ceq]=TriskellConstraints(X)
2012 Sep 17
2
Constraint Optimization with constrOptim
Hi,
I am having trouble using constrOptim. My target is to do a portfolio optimization and there some constraints have to be fulfilled.
1) The weight of each share of the portfolio has to be greater than 0
2) The sum of these weights has to be 1
I am able to fulfill either the first or the second constraint but not both.
One simple way would be to fulfill the first constraint by using optim as
2007 Jun 13
1
specify constraints in maximum likelihood
Hi,I know only mle function but it seems that in mle one can only specify the bound of the unknowns forming the likelihood function. But I would like to specify something like, a = 2b or a <= 2b where 'a' and 'b' could be my parameters in the likelihood function. Any help would be really appreciated. Thank you!- adschai
[[alternative HTML version deleted]]
2005 May 20
3
constrained optimization
Hello,
I've got to compute a minimization equation under an equality constraint
(Min g(x1,x2,x3) with x1+x2=const). The Constroptim function does not
authorize an equality condition but only inequality conditions. Which
function can I use instead?
Thank you very much for your help.
Gael Robert - +33 1 42 14 27 96
******************************************************************
This
2005 May 22
3
constraints
Is there a package in R that handles general linear (in-)equality + box
constrained optimization?
If it is not there, could anyone advise me which way to go?
And/or point me to packages that solve these problems partially?
best, ingmar
--
Ingmar Visser
Department of Psychology, University of Amsterdam
Roetersstraat 15, 1018 WB Amsterdam
The Netherlands
http://users.fmg.uva.nl/ivisser/
tel:
2004 Aug 09
4
linear constraint optim with bounds/reparametrization
Hello All,
I would like to optimize a (log-)likelihood function subject to a number of
linear constraints between parameters. These constraints are equality
constraints of the form A%*%theta=c, ie (1,1) %*% 0.8,0.2)^t = 1 meaning
that these parameters should sum to one. Moreover, there are bounds on the
individual parameters, in most cases that I am considering parameters are
bound between zero
2008 Oct 09
2
Help MLE
Dear,
I'm starting on R language. I would like some help to implement a MLE
function.
I wish to obtain the variables values (alpha12, w_g12, w_u12) that maximize
the function LL = Y*ln(alpha12 + g*w_g12 + u*w_u12).
Following the code:
rm(list=ls())
ls()
library(stats4)
Model = function(alpha12,w_g12,w_u12)
{
Y = 1
u = 0.5
g = -1
Y*log(alpha12 + g*w_g12 + u*w_u12)
}
res =