Displaying 20 results from an estimated 4000 matches similar to: "choosing constraints for function optim method="L-BFGS-B" whenthey are in terms of other parameter values"
2004 Jul 26
1
choosing constraints for function optim method="L-BFGS-B" when they are in terms of other parameter values
I have a function of several variables which I wish to minimise over four
variables, two of the upper bounds for which are defined in terms of other
variables in the model over which minimisation will take place. I cannot
work out how to code this in such a way as to avoid getting an error message
when I run the code.
If anyone can provide any assistance I will be most grateful.
Best Regards
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:
2005 Mar 22
5
Convert timeseries to transition matrix
Hi All,
Does someone have an idea of how to cleverly convert a categorical
timeseries into a transition matrix?
Ie, I have something like:
x<- c(1,1,2,1,1,2,2,2,1,2),
And I want a matrix with counts and/or probabilities:
> tr <- matrix(c(2,3,2,2),2,2)
> tr
[,1] [,2]
[1,] 2 2
[2,] 3 2
Meaning that there are two transitions from 1 to 1, two from 1 to 2, three
from 2 to 1
2005 Apr 28
1
help files and vignettes
Hi all,
I'm writing a vignette for my package, and I would like to include some of
the package help files in there as well. Is there an easy way of doing so?
I tried using R CMD Rdconv to generate latex files from .Rd files but I am
not sure how to include these into a .Rnw file (ie the vignette source). The
resulting file from Rdconv do not readily compile using latex ...
The other option I
2005 May 03
1
Rd.sty error
I had written a vignette and included a
\usepackage{Rd} command to make it possible to include
latex'ed Rd files in the vignette. However, when loading
Rd.sty texShop produces the following error:
l. 180 ...d}[1]{\ifmmode\bm{#1}\else\textbf{#1}\fi}
This is on Max OS X 3.9 and R 2.0.1
Has anyone seen this before and/or is it problematic? I'm not sure whether
the output suffers from this
2006 May 09
1
Calling R from C
Dear R-helpers,
I'm trying to transfer a loop from R code to C to improve performance using
the .Call interface. However, I ran into problems before even getting
started, and I hope (fear) I'm missing something completely obvious here.
I use the following C function (passing an integer to the C function and
printing it):
#include <R.h>
#include <Rinternals.h>
SEXP
2004 Oct 11
1
install failure Ruuid package on OS X
Dear All,
When installing the Ruuid package (from Bioconductor) from sources on my
MAC (OS X 10.3.5, R version 2.0.0) I get the following errors:
m00245:~ ivisser$ R CMD INSTALL -l /Users/ivisser/Library/R/library/
/Users/ivisser/Desktop/Ruuid
* Installing *source* package 'Ruuid' ...
loading cache ./config.cache
checking for glib-config... no
checking how to run the C preprocessor...
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
2009 Mar 25
0
constrOptim workaround for "L-BFGS-B" or Box Constraints
This is not so much a question as a contribution, but comments are welcome.
Comments:
1) thank you very much to Paul Smith in the post
https://stat.ethz.ch/pipermail/r-help/2008-March/157249.html
This is intended to build on that example with something more complex
than
a 2x2 set of constraints
2) "L-BFGS-B" does not appear to work in optimConst
Problem:
let's
2008 Mar 08
1
R cmd check error reg namespace
Hi,
When running R CMD check I'm getting a number of errors that I don't
quite follow and don't know where to start looking for an answer, any
hints appreciated.
R CMD check trunk
* checking for working latex ... OK
* using log directory '/Users/ivisser/Documents/projects/
depmixProject/depmixNew/rforge/depmix/trunk.Rcheck'
* using R version 2.6.2 (2008-02-08)
* checking
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
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 06
0
Likelihood returning inf values to optim(L-BFGS-B) other
Hello,
A couple of ideas...
Im not clear on your whole problem however...
Consider making use of the lgamma function, which returns the natural
log of the gamma function. This may help.
The gamma function gets awfully, big very fast.
Also multivariable likelihoods can be bumpy like a mountain range, with
minor peaks and valleys. It is possible that your likelihood has such a
shape. Maybe
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
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
2016 Oct 08
0
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Have you tried "optimx" package that John Nash and I wrote? The main purpose is to be able to readily compare multiple optimizers on a particular class of problems and see which one seems to do the best. It doesn't include nloptr, but most other optimizers are there.
Ravi
________________________________________
From: R-devel <r-devel-bounces at r-project.org> on behalf of
2016 Oct 08
0
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hi Spencer: See the link below about L-BFGS-B below because I had problems
with it a good while back (and I think the link description is the cause
but I can't prove it ) so eventually I moved to the Rvmmin(b) package.
It's a package but really an algorithm. Rvmmin(b) uses a variable-metric
algorithm similar to that of L-BFGS-B but without the problem below. It's
not surprisingly a
2016 Oct 10
0
optim(…?=, =?utf-8?Q?method=‘L-BFGS-B’) stops with an error message while violating the lower bound
>>>>> Spencer Graves <spencer.graves at prodsyse.com>
>>>>> on Sat, 8 Oct 2016 18:03:43 -0500 writes:
[.............]
> 2. It would be interesting to know if the
> current algorithm behind optim and optimx with
> method='L-BFGS-B' incorporates Morales and Nocedal (2011)
> 'Remark on ?Algorithm 778:
2019 May 03
0
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
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) && x==xx){
> ?????????? cat("x=", xx, ", ret=", ret, "
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