Displaying 20 results from an estimated 1000 matches similar to: "problem of "constrOptim.nl", no hessian and convergence values"
2011 Dec 21
1
constrOptim and further arguments
Dear List,
I have the code below, where I am using the constrained optimisation
package, 'constrOptim.nl' to find the values of two values, b0 and b1.
I have no problems when I enter further variable information DIRECTLY into
the functions, fn, and heq. In this instance I require fn to have -0.0075
appended to it, and in the case of heq, h[1] has -0.2.
library(alabama)
2011 Dec 29
0
problem of "constrOptim.nl", no hessian and convergence
Hi,
Use the `auglag' function in "alabama" if you want to get the Hessian at convergence. This typically tends to perform better than `constrOptim.nl'. Also, `constrOptim.nl' does not compute the Hessian. You should not specify method="L-BFGS-B". The default method "BFGS" is better in this setting.
Hope this helps,
Ravi
2011 May 18
1
Constrainted Nonlinear Optimization - lack of convergence
Hello,
I am attempting to utilize the 'alabama' package to solve a constrained
nonlinear optimization problem.
The problem has both equality and inequality constraints (heq and hin
functions are used). All constraints are smooth, i.e. I can differentiate
easily to produce heq.jac and hin.jac functions.
My initial solution is feasible; I am attempting to maximize a function,
phi. As
2013 Feb 10
3
Constrained Optimization in R (alabama)
Dear List,
I'm trying to solve this simple optimization problem in R. The parameters
are the exponents to the matrix mm. The constraints specify that each row
of the parameter matrix should sum to 1 and their product to 0. I don't
understand why the constraints are not satisfied at the solution. I must be
misinterpreting how to specify the constrains somehow.
library(alabama)
ff <-
2010 Sep 21
2
Trouble with Optimization in "Alabama" Package
Hello,
This is my first post to the help request list, so I'm going to err on the
side of giving too much information.
I'm working on writing a simulation in which agents will make repeated
production and exchange decisions with randomly chosen partners.
The idea is, all agents can produce two goods which they want to consume,
they choose a value t in [0,10] which sets their production
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
2008 Aug 19
1
how can i get hessian matrix at "constrOptim"
Hi,
i have made a code for optimizing a function using "constrOptim". i need
hessain matrix of the parameters. how could i get hessain matrix when i will
use "constrOptim"? May i get get any help from anyone?
thank you in advance.
Kanak Choudhury.
[[alternative HTML version deleted]]
2006 Feb 01
1
output hessian matrix in constrOptim
Hi,
Is there any way to get the hessian matrix from the "constrOptim" function without supplying gradient function? Thanks.
---------------------------------
Bring words and photos together (easily) with
[[alternative HTML version deleted]]
2004 Apr 02
0
Hessian in constrOptim
Dear R-users,
In the function constrOptim there is an option to get an approximation
to the hessian of the surrogate function R at MLE by declaring
hessian=TRUE in the calls to the function optim. I would like to ask
if it is advisable to get an approximate hessian for the funcrion f as
follows:
f''(theta)=R''(theta|theta_k)-B''(theta)
where
2004 Oct 05
1
constrOptim convergence
Hello, I got a question with the R function constrOptim.
>From the R help, it says that the return values of "constrOptim" are the
same as "optim". For the return value "convergence" of the function
"optim", the values should be 0, 1, 10, 51 and 52. See
http://www.maths.lth.se/help/R/.R/library/stats/html/optim.html
When I use constrOptim, I get
2003 Oct 31
1
Optimization of objective function with generic number of arguments (R-Extension with C code)
Hi All! I'm a new subscriber to this mailing list. I'm writing an R
extension with C linked code having a minimization function letting me pass
it an objective function with a GENERIC number of arguments and letting me
to optimize over a specific one among them if there are many.
#################################################
############### IPOTETICAL MAIN ###############
2008 Jan 18
1
constrOptim with method SANN
Hi Everyone,
I'm trying to minimize a function using constrOptim with
the simulated annealing method SANN.
If I understand constrOptim well, it basically passes most
of its arguments to optim while somehow enforcing the constraints.
My problem is, that since SANN does not need gradients,
when using optim with SANN, the gr argument of optim is
used to specify a function to create the next
2007 Aug 01
1
constrOptim
Hi,
I'm having trouble using the constrOptim function to generate the
9-component vector argmin of the function ELfsds:
ELfsds <- function(pvechat){
LG=0
for(i in 1:9){
LG=LG+log(pvechat[i])
}
return(-LG)
}
with accompanying gradient function:
gradfunc <- function(thetavec){
g=1/(9*thetavec)
return(g)
}
The constraints on the optimization problem are:
1 - components of
2004 Jul 14
0
Re: [R] constrOptim and function with additional parameters? (PR#7088)
I've moved this from r-help to r-bugs. If you reply, please be
careful that replies go to the right place: r-bugs if your comment is
specifically about the bug (and it contains the PR# in the subject
that will be added when this is cc'd to r-devel), r-devel if general
discussion, not both.
On Wed, 14 Jul 2004 10:01:45 -0400, "Roger D. Peng" <rpeng@jhsph.edu>
wrote :
2008 Jan 18
0
constrOptim with SANN
Hi Everyone,
I'm trying to minimize a function using constrOptim with
the simulated annealing method SANN.
If I understand constrOptim well, it basically passes most
of its arguments to optim while somehow enforcing the constraints.
My problem is, that since SANN does not need gradients,
when using optim with SANN, the gr argument of optim is
used to specify a function to create the next
2003 Oct 29
1
constrOptim doesn´t send arguments to optim!(?)
Hi,
I think that there something wrong with the 'constrOptim' max/minimization
function because she doesn?t send extra arguments to 'optim' call.
Fact: When I use optim in a f(x,theta)-like function, everything goes ok.
But using constrOptim with the same function leads to error...
Proof: Make a small change in the 'Rosenbrock Banana function' (taken from
the Examples
2004 Jul 14
0
Re: [R] constrOptim and function with additional parameters? (PR#7089)
Okay, looking at the docs, then it's not a bug, since the "..."
argument is not actually documented as "other arguments passed to f or
grad". However, that *is* how it's document in `optim', so one can
see how this might cause some confusion.
Now, it's not clear to me which other arguments need to be passed to
`optim' except perhaps `hessian'. Am
2009 Jun 03
1
Using constrOptim() function
I have a function myFunction(beta,x) where beta is a vector of coefficients
and x is a data frame (think of it as a matrix). I want to optimize the
function myFunction() by ONLY changing beta, i.e. x stays constant, with 4
constraints. I have the following code (with a separate source file for the
function):
rm(list=ls())
source('mySourceFile')
2011 Dec 20
1
constrOptim and problem with derivative
Dear List,
I am using constrOptim to solve the following
fr1 <- function(x) {
b0 <- x[1]
b1 <- x[2]
((1/(1+exp(-b0+b1))+(1/(1+exp(-b0)))+(1/(1+exp(-b0-b1)))))/3
}
As you can see, my objective function is
((1/(1+exp(-b0+b1))+(1/(1+exp(-b0)))+(1/(1+exp(-b0-b1)))))/3 and I would
like to solve for both b0 and b1.
If I were to use optim then I would derive the gradient of 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))