Displaying 20 results from an estimated 20000 matches similar to: "choosing constraints for function optim method="L-BFGS-B" when they are in terms of other parameter values"
2004 Jul 26
0
choosing constraints for function optim method="L-BFGS-B" whenthey are in terms of other parameter values
Hi Tom,
I am not entirely sure what the problem, you haven't been very specific.
If you want general linear constraints on your parameters, ie linear combinations of
parameters summing to some value, constrOptim may be of help.
hth, ingmar
Ingmar Visser
Developmental Processes Research Group
Department of Psychology
University of Amsterdam
http://users.fmg.uva.nl/ivisser/
-----Original
2003 Aug 20
2
Method of L-BFGS-B of optim evaluate function outside of box constraints
Hi, R guys:
I'm using L-BFGS-B method of optim for minimization problem. My function
called besselI function which need non-negative parameter and the besselI
will overflow if the parameter is too large. So I set the constraint box
which is reasonable for my problem. But the point outside the box was
test, and I got error. My program and the error follows. This program
depends on CircStats
2008 Apr 15
1
disturbing seed dependence in optim L-BFGS-B method
The the use of optim with the L-BFGS-B method for the following simple
function gives erroneous results. Any help appreciated!
Best,
Bob Reilly
# Code:
V=function(p){
p1=p[1];p2=p[2]
y=p1*p2-.4*(p1+p2)
return(-y)}
p=c(.2,.2) # p=c(.8,.8)
max=optim(p,V,method = "L-BFGS-B",lower=c(0,0),upper=c(1,1))
max1=optim(max$par,V,method = "L-BFGS-B",lower=c(0,0),upper=c(1,1))
2007 Apr 05
2
Likelihood returning inf values to optim(L-BFGS-B) other options?
Dear R-help list,
I am working on an optimization with R by evaluating a likelihood
function that contains lots of Gamma calculations (BGNBD: Hardie Fader
Lee 2005 Management Science). Since I am forced to implement lower
bounds for the four parameters included in the model, I chose the
optim() function mith L-BFGS-B as method. But the likelihood often
returns inf-values which L-BFGS-B
2019 May 02
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
Dear all,
when using optim() for a function that uses the parent environment, I
see the following unexpected behavior:
makeFn <- function(){
??? xx <- ret <- NA
??? fn <- function(x){
?????? if(!is.na(xx) && x==xx){
?????????? cat("x=", xx, ", ret=", ret, " (memory)", fill=TRUE, sep="")
?????????? return(ret)
?????? }
?????? xx
2004 Jan 05
3
optim function : "BFGS" vs "L-BFGS-B"
Dear kind R-experts.
Does anybody have an experience to use optim function?
If yes, what is the main difference between two method "BFGS" vs
"L-BFGS-B"?
I used "BFGS" method and got what I wanted. But when I used "L-BFGS-B"
the error message said that "L-BFGS-B needs finite values of fn". So
that means
"BFGS" method can handle even if fn
2016 Oct 08
4
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hello:
The development version of Ecdat on R-Forge contains a vignette
in which optim(?, method=?L-BFGS-B?) stops with an error message while
violating the lower bound.
To see all the details, try the following:
install.packages("Ecdat", repos="http://R-Forge.R-project.org")
Then do "help(pac=Ecdat)" -> "User guides, package
2007 Feb 23
1
optim(method="L-BFGS-B") abnormal termination
Hi,
my call of optim() with the L-BFGS-B method ended with the following
error message: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH
Further tracing shows:
Line search cannot locate an adequate point after 20 function and
gradient evaluations
final value 0.086627
stopped after 7 iterations
Could someone pls tell me whether it is possible to increase the limit
of 20 evaluations? Is it even worth
2013 Oct 09
1
Version of L-BFGS-B used in optim etc
Hi.
I just noticed the paper by Morales and Nocedal
Remark on "Algorithm 778: L-BFGS-B: Fortran Subroutines for Large-Scale
Bound Constrained Optimization". TOMS 2011; 38(1): 7
http://www.ece.northwestern.edu/~morales/PSfiles/acm-remark.pdf
which describes a couple of improvements (speed and accuracy) to the
original Netlib code which AFAICT is that still used by optim()
via f2c.
2002 Jun 28
1
Problem in optim(method="L-BFGS-B") (PR#1717)
Full_Name: Jörg Polzehl
Version: 1.5.1
OS: Windows 2000
Submission from: (NULL) (193.175.148.198)
When calculating MLE's in a variance component model using constrained
optimization, i.e. optim(...,method="L-BFGS-B",...) I observed an inproper
behaviour in cases where
the likelihood function was evalueted at the constraint. Parameters and value of
the
function at the constraint
2001 Nov 08
3
Problem with optim (method L-BFGS-B)
Hello,
I've just a little problem using the function optim.
Here is the function I want to optimize :
test_function(x){(exp(-0.06751 + 0.25473*((x[1]-350)/150) +
0.04455*((x[2]-40)/20) + 0.09399*((x[3]-400)/100) -
0.17238*((x[4]-250)/50)-
0.45984*((x[5]-550)/150)-0.39508*((x[1]-350)/150)* ((x[1]-350)/150) -
0.05116*((x[2]-40)/20)* ((x[2]-40)/20) -
0.27735*((x[3]-400)/100)*((x[3]-400)/100) -
2011 May 25
1
L-BFGS-B and parscale in optim()
Hi,
When using method L-BFGS-B along with a parscale argument, should the
lower and upper bounds provided be on the scaled or unscaled values?
Thanks.
Cheers,
--
Seb
2016 Oct 08
4
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hi, Mark et al.:
Thanks, Mark.
Three comments:
1. Rvmmin was one of the methods I tried after Ravi
directed me to optimx. It returned NAs for essentially everything. See
my email of this subject stamped 4:43 PM Central time = 21:43 UTC.
2. It would be interesting to know if the current
algorithm behind optim and optimx with
2019 May 03
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
On 03/05/2019 10:31, Serguei Sokol wrote:
> On 02/05/2019 21:35, Florian Gerber wrote:
>> Dear all,
>>
>> when using optim() for a function that uses the parent environment, I
>> see the following unexpected behavior:
>>
>> makeFn <- function(){
>> ???? xx <- ret <- NA
>> ???? fn <- function(x){
>> ??????? if(!is.na(xx)
2009 Apr 15
2
issue with L-BFGS-B in optim (optim just hangs)
Dear R-Help List,
I am using optim, with method=L-BFGS-B, to maximize a likelihood inside
a large simulation exercise. This runs fine for most simulated data
sets, but for some reason, about 1 out of 100 times, optim will just hang.
Using a dumb approach to the problem (i.e. printing the parameter values
each time the function being maximized is evaluated), I tracked down
when this happens,
2006 Aug 09
1
scaling constant in optim("L-BFGS-B")
Hi all,
I am trying to find estimates for 7 parameters of a model which should fit
real data. I have a function for the negative log likelihood (NLL) of the
data. With optim(method="L-BFGS-B",lower=0) I am now minimizing the NLL to
find the best fitting parameters.
My problem is that the algorithm does not converge for certain data sets. I
have read that one should scale the fn
2007 Jul 30
1
stop criteria when "L-BFGS-B needs finite values of 'fn' " in optim
Hi all!
I'm running some simulations and I need to estimate some paramaters with
optim( ),
in some cases optim stops with the next message:
"L-BFGS-B needs finite values of 'fn' "
I would like to know how to include and "if" condition when this happen,
could it be something like:
myfun <- optim(....) # run my function
2004 Jun 23
1
How to define stopping criterium for Optim with L-BFGS-B
Hi,
I am using optim with a L-BFGS-B method to minimize a function. As I've
understood, the way to specify a tolerance for stopping optimization is
through "factr" argument.
My function, is by construction, minimal when equal to 1. I wonder if there
is any way to pass this info to "optim". If not, how "factr" argument works
(I am quite confused about the
2019 May 03
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
Yes, I think you are right. I was at first confused by the fact that after the optim() call,
> environment(fn)$xx
[1] 10
> environment(fn)$ret
[1] 100.02
so not 9.999, but this could come from x being assigned the final value without calling fn.
-pd
> On 3 May 2019, at 11:58 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
> Your results below make it look like a
2000 Sep 26
2
bounds violations, infinite loops in optim/L-BFGS-B (PR#671)
I'm having some trouble with optim(method="L-BFGS-B"),
and I'm not sure I have the ability to track down and fix
what seem to be bugs within optim().
I'm bootstrapping an original data set and fitting a model
to each bootstrapped data set. For some bootstrapped samples,
optim() sets negative parameter values (despite the fact that
I have explicitly set non-zero lower