Displaying 20 results from an estimated 5000 matches similar to: "constrainOptim"
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];
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
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))
2009 Jan 28
3
initial value in 'vmmin' is not finite
Dear r helpers
I run the following code for nested logit and got a message that
Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite
What does this mean? and how can I correct it?
Thank you
June
> yogurt = read.table("yogurtnp.csv", header=F,sep=",")> attach(yogurt)>
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
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]]
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
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
2008 Jun 17
2
constrOptim with method = "L-BFGS-B"
Hi,
i need to minimize a quadratic function with boundary condidtions and one
equality condition.
In order to do that i converted the equality constraint into 2 inequality
constaints and passed everything cia constrOptim, as the manual said:
everything included in the ... will be passed to Optim that will pass it
back to fn in case it does not need it.
My code is the following:
mat <-
2009 May 21
2
good numerical optimization to use in R?
Hi all,
Could anybody point me to a good/robust numerical optimization program
to use in R?
I am doing some MLE fitting. Thanks!
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
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>
2004 Apr 27
1
constrOptim does ineq, not eq, but who do ?
Hi everybody,
please, could you give me help ? I scanned the help archives and didn't
found hints...
I want to solve a large sparse linear system subjected to an inequality
constrains (all solutions positive) and an equality constrain (all
solutions sum to 1), thus I tried to fool constrOptim using:
x[1] + 0 + ... + 0 >= 0
...
0 + 0 + ... + x[n] >= 0
x[1] + x[2] + ... +
2011 Oct 31
2
Linear Regression with Linear Equality Constraint
Please advice on the package I should use to run a linear regression model
(weighted least squared) with linear equality constraint. I initially tried
"constrOptim" but it turned out that it only supported inequality linear
constraint. Thank you very much in advance.
Cheers,
Jon
--
View this message in context:
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
2009 Jan 28
2
t.test in a loop
Hi All,
I've been having a little trouble with creating a loop that will run a a
series of t.tests for inspection,
Below is the code i've tried, and some checks i've looked at.
I've used the get(paste()) idea as i was told previously that the use of the
eval should try and be avoided.
I've run a single syntax to check that my systax is correct and works
without any problems
2008 May 12
1
hessian in constrained optimization (constrOptim)
Dear helpers,
I am using the function "constrOptim" to estimate a model with ML with an
inequality constraint using the option method='Nelder-Mead'.
When I specify the option: hessian = TRUE I obtain the response:
Error in f(theta, ...) : unused argument(s) (hessian = TRUE)
I guess the function "constrOptim" does not allow this argument which, on
the other hand, is
2007 Sep 07
1
'initial value not feasible' in constrOptim
Dear friends.
I am using function
constrOptim(c(0.5,0.3,0.5), fit.error, fit.error.grr, ui=-1*ui,ci=-1*ci)
and I am confronted with error message "initial value not feasible"
I plug in the initial value of (0.5,0.3,0.5) to function fit.error and
fit.error.grr and have pretty reasonable result. I inequality "ui %*% theta
- ci >= 0" as suggested in the R manual and it is
2008 Mar 14
1
Optimization with constraint.
Hello.
I have some problems, when I try to model an
optimization problem with some constraints.
The original problem cannot be solved analytically, so
I have to use routines like "Simulated Annealing" or
"Sequential Quadric Programming".
But to see how all this works in R, I would like to
start with some simple problem to get to know the
basics:
The Problem:
min f(x1,x2)=