search for: nlminb

Displaying 20 results from an estimated 262 matches for "nlminb".

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)...
2012 Sep 26
2
non-differentiable evaluation points in nlminb(), follow-up of PR#15052
This is a follow-up question for PR#15052 <http://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15052> There is another thing I would like to discuss wrt how nlminb() should proceed with NAs. The question is: What would be a successful way to deal with an evaluation point of the objective function where the gradient and the hessian are not well defined? If the gradient and the hessian both return NA values (assuming R < r60789, e.g. R 2.15.1), and also if...
2008 Dec 03
1
nlminb: names of parameter vector not passed to objective function
Dear R developers, I tried to use nlminb instead of optim for a current problem (fitting parameters of a differential equation model). The PORT algorithm converged much better than any of optim's methods and the identified parameters are plausible. However, it took me a while before spotting the reason of a technical problem that...
2013 Oct 20
5
nlminb() - how do I constrain the parameter vector properly?
Greets, I'm trying to use nlminb() to estimate the parameters of a bivariate normal sample and during one of the iterations it passes a parameter vector to the likelihood function resulting in an invalid covariance matrix that causes dmvnorm() to throw an error. Thus, it seems I need to somehow communicate to nlminb() that the fin...
2005 Dec 13
2
what does this warnings mean? and what should I do?
...1435e-01 637 -1.3160 0.18863 trust.cz1 -8.0709e-01 4.4632e-01 637 -1.8083 0.07103 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 There were 11 warnings (use warnings() to see them) > warnings() Warning messages: 1: optim or nlminb returned message false convergence (8) in: LMEopt(x = mer, value = cv) 2: optim or nlminb returned message false convergence (8) in: LMEopt(x = mer, value = cv) 3: optim or nlminb returned message false convergence (8) in: LMEopt(x = mer, value = cv) 4: optim or nlminb returned message fal...
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 Tel: +61-3-8344-9763 University of...
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 = list(trace=1,factr=1),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)) I did not get same results from above equations. Log-likelihood values are close but pa...
2011 Jan 21
3
nlminb doesn't converge and produce a warning
Hi Everybody, My problem is that nlminb doesn't converge, in minimising a logLikelihood function, with 31*6 parameters(2 weibull parameters+29 regressors repeated 6 times). I use nlminb like this : res1<-nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(-Inf, n-15)), upper=c(rep(Inf, 12), rep(0.99, 3), rep(Inf, n-15)), co...
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. (...
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, b...
2010 Dec 07
1
Using nlminb for maximum likelihood estimation
...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( c(0.001,0.001,0.001,0.001), loglikelihood, lower=c(0.000001,0,0,0)) This does not produce a good result: the iteration limit is reached and increasing it won't help. I have used "garchFit" from fGarch-package to estimate the paramete...
2006 Apr 20
2
nlminb( ) : one compartment open PK model
...;L-BFGS-B" to find reasonable parameters for a one-compartment open pharmacokinetic model. My loss function in this case was squared error, and I made no assumptions about the distribution of the plasma values. The model appeared to fit pretty well. Out of curiosity, I decided to try to use nlminb( ) applied to a likelihood function that assumes the plasma values are normally distributed on the semilog scale (ie, modeling log(conc) over time). nlminb( ) keeps telling me that it has converged, but the estimated parameters are always identical to the initial values.... I am certain that I h...
2011 Aug 16
2
Calibrating the risk free interest rate using nlminb
...ter want to minimize with respect to r difference <- function (S0, K, T, r, sigma, q, mid) { return(BS_Call(S0, strike, T, r, sigma, q)- mid_bidask)) } # which gives 460 values as it should, as T = 460 f <- function(x) difference(S0, strike, T, x, implvol, q, mid_bidask) # If I now run nlminb(start=r, f) $par [1] -0.9800001 $objective [1] -395.85 $convergence [1] 0 $iterations [1] 2 $evaluations function gradient 3 4 $message [1] "relative convergence (4)" # But the risk free interest rate should not be negative, and the objective function gives an negati...
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 https://www.invite2messenger.net/im/?source=TX...
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 the function with t...
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. my.loglike...
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 &lt...
2005 Nov 21
1
singular convergence with lmer function i lme4
...pendent on the brood sex ratio (b) including brood identity (c) as random factor. However, I get the following error message; lmer(a~b + (1|c), family=poisson, data=tab) Error in devAGQ(PQLpars, 1) : Unable to invert singular factor of downdated X'X In addition: Warning messages: 1: optim or nlminb returned message singular convergence (7) in: LMEopt(x = mer, value = cv) 2: optim or nlminb returned message singular convergence (7) in: LMEopt(x = mer, value = cv) 3: optim or nlminb returned message singular convergence (7) in: LMEopt(x = mer, value = cv) 4: optim or nlminb returned me...
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 i...
2005 Dec 14
2
suggestions for nls error: false convergence
...77,m=100,n=101,tau=10), algorithm='port', trace=TRUE, control=nls.control(maxiter=5000, minFactor=1/2048)) Running the above code I get the following error message: Convergence failure: function evaluation limit reached without convergence (9). To investigate this further I used nlminb() to get a set of starting parameters. Thus I did: func <- function( par ) { a = par[1] m = par[2] n = par[3] tau = par[4] a * (1+m*exp(-x/tau)) / (1+n*exp(-x/tau)) } est <- nlminb( c(277, 100,101, 10), objective=func, control=list(eval.max=400, iter.max=1000)) I get abs...