similar to: Stopping precision using 'optim'

Displaying 20 results from an estimated 3000 matches similar to: "Stopping precision using 'optim'"

2009 Nov 02
2
a prolem with constrOptim
Hi, I apologize for the long message but the problem I encountered can't be stated in a few lines. I am having some problems with the function constrOptim. My goal is to maximize the likelihood of product of K multinomials, each with four catagories under linear constraints on the parameter values. I have found that the function does not work for many data configurations. #The likelihood
2008 Mar 31
2
L-BFGS-B needs finite values of 'fn'
Dear All, I am trying to solve the optimization problem below, but I am always getting the following error: Error in optim(rep(20, nvar), f, gr, method = "L-BFGS-B", lower = rep(0, : L-BFGS-B needs finite values of 'fn' Any ideas? Thanks in advance, Paul ----------------------------------------------- k <- 10000 b <- 0.3 f <- function(x) { n <- length(x)
2012 Nov 05
1
relative convergence in 'optim'
Dear list, I have a question related to the correct interpretation of the relative convergence criterion used by 'optim'. In the help of the function is it written that: "reltol:Relative convergence tolerance. The algorithm stops if it is unable to reduce the value by a factor of reltol * (abs(val) + reltol) at a step." and I was wondering if the previous criterion is
2007 Oct 13
1
R API - optim
I am trying to use the R API to call optim functions (nmmin, vmmin, lbfgsb, etc.) through a C program but I couldn't find the shared library to link under the R-2.6.0 build which is compiled under Linux (REL5). main.cpp:35: undefined reference to `Rf_initEmbeddedR(int, char**)' main.cpp:41: undefined reference to `nmmin' Thanks in advance for any help. ------------------------
2012 Jan 05
2
difference of the multinomial logistic regression results between multinom() function in R and SPSS
Dear all, I have found some difference of the results between multinom() function in R and multinomial logistic regression in SPSS software. The input data, model and parameters are below: choles <- c(94, 158, 133, 164, 162, 182, 140, 157, 146, 182); sbp <- c(105, 121, 128, 149, 132, 103, 97, 128, 114, 129); case <- c(1, 3, 3, 2, 1, 2, 3, 1, 2, 2); result <- multinom(case ~ choles
2007 Jan 03
1
optim
Hi! I'm trying to figure out how to use optim... I get some really strange results, so I guess I got something wrong. I defined the following function which should be minimized: errorFunction <- function(localShifts,globalShift,fileName,experimentalPI,lambda) { lambda <- 1/sqrt(147) # error <- abs(errHuber(localShifts,globalShift, #
2006 Apr 13
1
bus error on calling nmmin
Hi, I'm trying to get a toy program making use of nmmin to run successfully. I've gotten to the point of compiling. However, when I attempt to run my executable, I guess a bus error. I see that someone else has asked about using nmmin before <http://tolstoy.newcastle.edu.au/R/help/06/03/23944.html>, but I haven't come across any replies. Is there some documentation on how to
2012 Oct 10
1
"optim" and "nlminb"
#optim package estimate<-optim(init.par,Linn,hessian=TRUE, method=c("L-BFGS-B"),control = list(trace=1,abstol=0.001),lower=c(0,0,0,0,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf),upper=c(1,1,1,1,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf)) #nlminb package estimate<-nlminb(init.par,Linn,gr=NULL,hessian=TRUE,control =
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,
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)
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
2006 Feb 06
1
auth: out of memory
Hello :) I just couldn't login to my dovecot imap (1.0-beta2). Dovecot authenticates from mysql database. Feb 6 19:47:33 elfstone dovecot: auth-worker(default_with_listener): sql(damirh at noviforum.si): User query failed: MySQL client run out of memory Feb 6 19:47:52 elfstone dovecot: auth-worker(default_with_listener): ^GOut of memory (Needed 8164 bytes) Feb 6 19:47:52 elfstone
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
2007 Jan 19
8
kate editor for R
Like kile for LaTeX, Linux/KDE's kate editor is an excellent editor for R, with easy code submission to a running R process. Syntax highlighting is good. I have not been able to figure out two things: - how to automatically reformat a line or region of text using good indentation rules (Emacs/ESS make this so easy by just hitting Tab while the cursor is in a line, or highlighting a
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
2005 Feb 08
1
Toying with neural networks
Hello all, Ive been playing with nnet (package 'nnet') and Ive come across this problem. nnet doesnt seems to like to have more than 1000 weights. If I do: > data(iris) > names(iris)[5] <- "species" > net <- nnet(species ~ ., data=iris, size=124, maxit=10) # weights: 995 initial value 309.342009 iter 10 value 21.668435 final value 21.668435 stopped after 10
2008 Oct 03
1
Memory crash
Hello, I get a segfault when running glmmboot in my own package glmmML. Has happened many time before, but this time I get no hint of where in my C functions the error might be. I give the output below. Can this be an R bug? I suspect it has to do with repeated calls to 'vmmin' like this: for (...){ vmax = vmaxget(); vmmin(*p, b, &Fmin, bfun,
2019 May 06
2
R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments
Optim's Nelder-Mead works correctly for this example. > optim(par=10, fn=fn, method="Nelder-Mead") x=10, ret=100.02 (memory) x=11, ret=121 (calculate) x=9, ret=81 (calculate) x=8, ret=64 (calculate) x=6, ret=36 (calculate) x=4, ret=16 (calculate) x=0, ret=0 (calculate) x=-4, ret=16 (calculate) x=-4, ret=16 (memory) x=2, ret=4 (calculate) x=-2, ret=4 (calculate) x=1, ret=1
2008 Mar 07
1
parameters for lbfgsb (function for optimization)
Can anyone help me with lbfgsb (function for optimization)? It takes the following parameters: void lbfgsb (int n, int lmm, double *x, double *lower, double *upper, int *nbd, double *Fmin, optimfn fn, optimgr gr, int *fail, void *ex, double factr, double pgtol, int *fncount, int *grcount, int maxit, char *msg, int trace, int nREPORT); What do I put for parameter ex (11th parameter)? I looked at
2005 Apr 11
4
R: function code
HI sorry to be a nuisance to all!!! how can i see the code of a particular function? e.g. nnet just as an example