similar to: A problem about "nlminb"

Displaying 20 results from an estimated 800 matches similar to: "A problem about "nlminb""

2009 May 15
1
About the efficiency of R optimization function
Hi all! The objective function I want to minimize contains about 10 to 20 variables, maybe more in the future. I never solved such problems in R, so I had no idea about the efficiency of R's optimization functions. I know doing loop in R is quite slow, so I am not sure whether this shortage influences the speed of R's optimization functions. I would be very appreciated if anyone could
2009 Apr 08
3
MLE for bimodal distribution
Hello everyone, I'm trying to use mle from package stats4 to fit a bi/multi-modal distribution to some data, but I have some problems with it. Here's what I'm doing (for a bimodal distribution): # Build some fake binormally distributed data, the procedure fails also with real data, so the problem isn't here data = c(rnorm(1000, 3, 0.5), rnorm(500, 5, 0.3)) # Just to check
2012 Jul 04
2
About nlminb function
Hello I want to use the nlminb function but I have the objective function like characters. I can summarize the problem using the first example in the nlminb documentation. x <- rnbinom(100, mu = 10, size = 10) hdev <- function(par) -sum(dnbinom(x, mu = par[1], size = par[2], log = TRUE)) nlminb(c(9, 12), objective=hdev) With the last instructions we obtain appropriate results. If I have
2006 Jul 23
1
How to pass eval.max from lme() to nlminb?
Dear R community, I'm fitting a complex mixed-effects model that requires numerous iterations and function evaluations. I note that nlminb accepts a list of control parameters, including eval.max. Is there a way to change the default eval.max value for nlminb when it is being called from lme? Thanks for any thoughts, Andrew -- Andrew Robinson Department of Mathematics and Statistics
2010 Dec 07
1
Using nlminb for maximum likelihood estimation
I'm trying to estimate the parameters for GARCH(1,1) process. Here's my code: loglikelihood <-function(theta) { h=((r[1]-theta[1])^2) p=0 for (t in 2:length(r)) { h=c(h,theta[2]+theta[3]*((r[t-1]-theta[1])^2)+theta[4]*h[t-1]) p=c(p,dnorm(r[t],theta[1],sqrt(h[t]),log=TRUE)) } -sum(p) } Then I use nlminb to minimize the function loglikelihood: nlminb(
2007 Dec 21
1
NaN as a parameter in NLMINB optimization
I am trying to optimize a likelihood function using NLMINB. After running without a problem for quite a few iterations (enough that my intermediate output extends further than I can scroll back), it tries a vector of parameter values NaN. This has happened with multiple Monte Carlo datasets, and a few different (but very similar) likelihood functions. (They are complicated, but I can send them
2010 Jul 10
1
Not nice behaviour of nlminb (windows 32 bit, version, 2.11.1)
I won't add to the quite long discussion about the vagaries of nlminb, but will note that over a long period of software work in this optimization area I've found a number of programs and packages that do strange things when the objective is a function of a single parameter. Some methods quite explicitly throw an error when n<2. It seems nlminb does not, but that does not mean that
2009 Jun 15
3
lack of memory for logistic regression in R?
Hi all, I am getting the following error message: > mymodel = glm(response ~ . , family=binomial, data=C); Error: cannot allocate vector of size 734.2 Mb In addition: Warning messages: 1: In array(0, c(n, n), list(levs, levs)) : Reached total allocation of 1535Mb: see help(memory.size) 2: In array(0, c(n, n), list(levs, levs)) : Reached total allocation of 1535Mb: see help(memory.size) 3:
2010 Mar 24
1
vcov.nlminb
Hello all, I am trying to get the variance-covariance (VCOV) matrix of the parameter estimates produced from the nlminb minimizing function, using vcov.nlminb, but it seems to have been expunged from the MASS library. The hessian from nlminb is also producing NaNs, although the estimates seems to be right, so I can't VCOV that way either. I also tried using the vcov function after minimizing
2012 Nov 22
1
Optimizing nested function with nlminb()
I am trying to optimize custom likelyhood with nlminb() Arguments h and f are meant to be fixed. example.R: compute.hyper.log.likelyhood <- function(a, h, f) { a1 <- a[1] a2 <- a[2] l <- 0.0 for (j in 1:length(f)) { l <- l + lbeta(a1 + f[j], a2 + h - f[j]) - lbeta(a1, a2) } return(l) } compute.optimal.hyper.params <- function(start, limits, h_, f_) { result
2008 Jun 11
1
difference between nlm and nlminb
Hi, I was wondering if someone could give a brief, big picture overview of the difference between the two optimization functions nlm and nlminb. I'm not familiar with PORT routines, so I was hoping someone could give an explanation. Thanks, Angelo _________________________________________________________________ Instantly invite friends from Facebook and other social networks to join yo
2012 Nov 04
1
Struggeling with nlminb...
Hallo together, I am trying to estimate parameters by means of QMLE using the nlminb optimizer for a tree-structured GARCH model. I face two problems. First, the optimizer returns error[8] false convergence if I estimate the functions below. I have estimated the model at first with nlm without any problems, but then I needed to add some constraints so i choose nlminb.
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 =
2004 Aug 03
1
nlminb vs optim
Dear R-help group, I have to maximize a likelihood with 40 parameters and I want to compare the MLE given by "nlminb" (Splus2000, on Windows) with those given by "optim" (R, on Unix). 1) On Splus, The algorithm "nlminb" seems to converge (the parameters stabilize) , it stops after several iterations ( around 400) with the message :"FUNCTION EVALUATION LIMIT
2008 Apr 08
1
question about nlminb
Dear All, I wanted to post some more details about the query I sent to s-news last week. I have a vector with a constraint. The constraint is that the sum of the vector must add up to 1 - but not necessarily positive, i.e. x[n] <- 1 -(x[1] + ...+x[n-1]) I perform the optimisation on the vector x such that x <- c(x, 1-sum(x)) In other words, fn <- function(x){ x <- c(x, 1 -
2008 Jul 25
0
nlminb--lower bound for parameters are dependent on each others
Hello I'm trying to solve two sets of equations (each set has four equations and all of them share common parameters) with nlminb procedure. I minimize one set and use their parameters as initial values of other set, repeating this until their parameters become very close to each other. I have several parameters (say,param1, param2) and their constraints are given as inequality and depend
2010 Dec 15
1
Help about nlminb function
Hi Everyone, Can anyone help me resolve a problem that i'm having with nlminb. The problem is that it stops after just one iteration and returns the same values as "start" ones. Thank you very much for your help. Sincerely. -- Kamel Gaanoun (+33) (0)6.76.04.65.77 [[alternative HTML version deleted]]
2005 May 27
2
nlminb to optmin
Hi! I want to convert S-Plus 6.2 code to R 2.1.0. Instead of the function nlminb I use the function optmin optmin(start,fn,gr,method="L-BFGS-B", lower, upper, hess,...) But then I get the Error in optmin ...: L-BFGS-B needs finite values of fn Then I used optmin(start,fn,gr,method="BFGS", hess, ...) But then I get the Error in optmin ...: initial value in vmmin is not
2019 Feb 01
0
nlminb with constraints failing on some platforms
>>>>> Kasper Kristensen via R-devel >>>>> on Mon, 28 Jan 2019 08:56:39 +0000 writes: > I've noticed unstable behavior of nlminb on some Linux > systems. The problem can be reproduced by compiling > R-3.5.2 using gcc-8.2 and running the following snippet: > f <- function(x) sum( log(diff(x)^2+.01) + (x[1]-1)^2 ) > opt
2019 Jan 31
0
nlminb with constraints failing on some platforms
This is not about the failure on some platforms, which is an important issue. However, what is below may provide a temporary workaround until the source of the problem is uncovered. FWIW, the problem seems fairly straightforward for most optimizers at my disposal in the R-forge (developmental) version of the optimx package at https://r-forge.r-project.org/projects/optimizer/ I used the code ##