similar to: optim(), nlminb() and starting values

Displaying 20 results from an estimated 4000 matches similar to: "optim(), nlminb() and starting values"

2008 Feb 15
1
Conditional Autoregressive (CAR) model simulation
Hi all ! I would like to simulate spatial lattice/areal data with a conditional autoregressive (CAR) structure, for a given neighbouring matrix and for a autocorrelation "rho". Is there any package or function in R to perform it ? I found the function "CARsimu" in the hdeco library, but this is not what I'm looking for Thanks in advance Dae-Jin --
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
2011 Jun 06
1
Lasso for k-subset regression
Dear R-users I'm trying to use lasso in lars package for subset regression, I have a large matrix of size 1000x100 and my aim is to select a subset k of the 100 variables. Is there any way in lars to fix the number k (i.e. to select the best 10 variables) library(lars) aa=lars(X,Y,type="lasso",max.steps=200) plot(aa,plottype="Cp") aa$RSS which.min(aa$RSS)
2011 Dec 16
1
optim with simulated annealing SANN for combinatorial optimization
Hi all I am trying to solve a combinatorial optimization problem. Basically, I can reduce my problem into the next problem: 1.- Given a NxN grid of points, with some values in each cell 2.- Find the combination of K points on the grid such that, the maximum mean value is obtained I took the Travel SalesMan problem example in ?optim documentation. I am not sure if I have understood correctly
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
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 Jan 13
0
nlminb(Splus) vs optim(R)
Dear, R experts. I have two program codes, one is made by Splus and the other is made by transferring from Splus code. Because "nlminb" function in Splus is equivalent to "optim" in R, I expected to get exactly same result. But, sometime there is too large differece (greater than 2%) between two outputs. I looked two help files. According to those, in Splus, quasi-Newton
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
2009 May 06
2
NLMINB() produces NaN!
I am having the same problem as one Rebecca Sela(see bellow). On 21/12/2007 12:07 AM, Rebecca Sela wrote: >* 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
2010 Sep 29
1
nlminb and optim
I am using both nlminb and optim to get MLEs from a likelihood function I have developed. AFAIK, the model I has not been previously used in this way and so I am struggling a bit to unit test my code since I don't have another data set to compare this kind of estimation to. The likelihood I have is (in tex below) \begin{equation} \label{eqn:marginal} L(\beta) = \prod_{s=1}^N \int
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
I have constructed the function mml2 (below) based on the likelihood function described in the minimal latex I have pasted below for anyone who wants to look at it. This function finds parameter estimates for a basic Rasch (IRT) model. Using the function without the gradient, using either nlminb or optim returns the correct parameter estimates and, in the case of optim, the correct standard
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 nlminb, in contrast to optim, does not pass names of the
2006 Apr 20
2
nlminb( ) : one compartment open PK model
All, I have been able to successfully use the optim( ) function with "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
2000 Jan 27
2
nlminb replacement/solution?
What's the current best approach to dealing with the nlminb problem? Are there other similar constrained optimizers, or is current wisdom just to code it in C (or similar...)? best, -tony -- A.J. Rossini Research Assistant Professor of Biostatistics Biostatistics/Univ. of Washington (Th) Box 357232 206-543-1044 (3286=fax) Center for AIDS Research/HMC/UW (M/F) Box 359931
2004 Jan 20
0
nlminb function
Hello, I've got a program written in S-plus which I think is converted successfully to R with the exception of part of the opt.param function written. In S-plus it is: nlminb(start=x0, obj=negllgamma.f, scale=1, lower=c(0.01,0.0001), upper=c(10,0.9999), gamma=gamma, maxlik=maxlik, y=ldose, s=lse, max.iter = 1000, max.fcal = 1000)$par and so far with R I've got to: optim(par=x0,
2007 Jan 12
1
R2WinBugs and Compare DIC versus BIC or AIC
Dear All 1) I'm fitting spatial CAR models using R2Winbugs and although everything seems to go reasonably well (or I think so) the next message appears from WINBUGS 1.4 window: gen.inits() Command #Bugs: gen.inits cannot be executed (is greyed out) The question is if this message means that something is wrong and the results are consequently wrong, or Can I assume it as a simple warning
2007 Oct 02
3
mcv package gamm function Error in chol(XVX + S)
Hi all R users ! I'm using gamm function from Simon Wood's mgcv package, to fit a spatial regression Generalized Additive Mixed Model, as covariates I have the geographical longitude and latitude locations of indexed data. I include a random effect for each district (dist) so the code is fit <- gamm(y~s(lon,lat,bs="tp", m=2)+offset(log(exp.)), random=list(dist=~1),
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,
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
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