similar to: In the OPTIM message....

Displaying 20 results from an estimated 500 matches similar to: "In the OPTIM message...."

2005 Sep 06
1
R: optim
hi all i dont understand the error message that is produced by the optim function. can anybody help??? ie: [[1]]$message [1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH" can anyone help? ########################################################################### SK.FIT(XDATA=a,XDATAname="a",PHI1=1,v=5,vlo=2,vhi=300,phi2lo=.01) [[1]] [[1]]$par [1] -0.01377906
2012 Mar 20
2
Constraint Linear regression
Hi there, I am trying to use linear regression to solve the following equation - y <- c(0.2525, 0.3448, 0.2358, 0.3696, 0.2708, 0.1667, 0.2941, 0.2333, 0.1500, 0.3077, 0.3462, 0.1667, 0.2500, 0.3214, 0.1364) x2 <- c(0.368, 0.537, 0.379, 0.472, 0.401, 0.361, 0.644, 0.444, 0.440, 0.676, 0.679, 0.622, 0.450, 0.379, 0.620) x1 <- 1-x2 # equation lmFit <- lm(y ~ x1 + x2) lmFit Call:
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 Sep 30
1
Optim(...) estimate of stDev far too low
R-help, I'm just trying to find the ML (maximum likelihood) estimates of the mean and standard deviation of a set of observations: >xx=c(2.5,3.5,4,6,6.5,7.5) fn<-function(params,x=xx) { media<-params[1] st <-params[2] pdf=-sum(dnorm(log(xx),log(media),st,TRUE)) return(pdf) } optim(c(mu,stdev),fn,method="L-BFGS-B",lower=c(0.001, 0.001) ,upper = rep(Inf, 2),
2007 Feb 16
1
optim() and resultant hessian
R users; A question about optimization within R. I've been using both optim() and nlminb() to estimate parameters and all seems to be working fine. For context (but without getting into specifics - sorry), I'm working with a problem that is known to have correlated parameters, and parameter estimation can be difficult. I have a question on optim() - I'm using
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, #
2003 Feb 01
1
Trouble with optim
I am having trouble with optim. It claims to have converged to a minimum, yet it has in the course of the optimization visited many points which are closer to optimal. I would be grateful for any explanation of this behaviour. I'm trying to estimate the parameters in the model X ~ Binomial(1,p) * NegBin(mu,theta). So I define a log likelihood function, and invoke optim thus: o <- optim
2002 Jul 30
1
Optim() returns wrong maximum
Dear R-devel During the last half a year I have several times encountered the following problem with optim() when using method= "L-BFGS-B". The function return a value which is clearly not the maximum (seen from printing the value each time the function is called). Some output is shown below. A few things I have observed (as I remember it): a. The problem seems to occur when the
2010 Nov 03
3
optim works on command-line but not inside a function
Dear all, I am trying to optimize a logistic function using optim, inside the following functions: #Estimating a and b from thetas and outcomes by ML IRT.estimate.abFromThetaX <- function(t, X, inits, lw=c(-Inf,-Inf), up=rep(Inf,2)){ optRes <- optim(inits, method="L-BFGS-B", fn=IRT.llZetaLambdaCorrNan, gr=IRT.gradZL, lower=lw, upper=up, t=t, X=X)
2009 Sep 24
1
Maximum likelihood estimation of parameters make no biological sense
R-help, I'm trying to estimate some parameters using the Maximum Likehood method. The model describes fish growth using a sigmoidal-type of curve: fn_w <- function(params) { Winf <- params[1] k <- params[2] t0 <- params[3] b <- params[4] sigma <- params[5] what <- Winf * (1-exp(- k *(tt - t0)))^b
2004 Aug 11
0
always NaN after some running in R, but all fine in S-plus
Hello, S-plus and R helpers,(sorry for cross-post) I wrote some simple C code for one likelihood to be optimized (using optim(MASS)). I use same function, same data, same starting points and same DLL in R and S-plus for comparison. (I compiled it with 'Rcmd SHLIB likelihood.c' and the header files of it include only R.h and math.h). While it works quite fine in S-plus, it forever returns
2013 May 29
0
"Unable to optimize" error returned in factanal using R-3.0.1, Windows 64 bit, and OpenBLAS
Hello, I have been trying for weeks to compile a 64-bit Rblas. I started with ATLAS where I have had success in the past, but 64 bit was not behaving, and as each compilation takes between 9 and 12 hours, "test, check, and revise" was not going to be really viable. I therefore switched to OpenBLas (OPBL). I was successful in compiling R-3.0.1 and an OPBL-based BLAS for Windows 64bit
2010 Nov 09
0
convergence message & SE calculation when using optim( )
Hi R-users, I am trying to estimate function parameters using optim(). My count observations follows a Poisson like distribution. The problem is that I wanna express the lambda coefficient, in the passion likelihood function, as a linear function of other covariates (and thus of other coefficients). The codes that I am using (except data frame) are the following (FYI the parameters need to be
2009 Feb 04
0
Problem using option packeg with new R version (PR#13498)
Hello, I'm facing a problem, using "optim" packeg. I've written a program and run it using the latest R version 2.8.1,but there was an error message as following: R version 2.7.2 (2008-08-25) # same result when I use R version 2.8.1,Copyright (C) 2008 The R Foundation for Statistical ComputingISBN 3-900051-07-0R is free software and comes with ABSOLUTELY NO WARRANTY.You are
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
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)
2006 Jun 06
2
How to create list of objects?
Hi I am doing several mle and want to store them in a list (or whatever is the right construct) to be able to analyse them later. at the moment I am doing: f <- list() f$IP <- mle(...) f$NE <- mle(...) but when I say: > summary(f) I get: Length Class Mode IP 0 mle list NE 0 mle list I don't get the output I would have, i.e. the one from >
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
2000 Jul 28
1
optim gets stuck
Dear all I'm having some trouble with a bound-constrained optimization using optim(...,method="L-BFGS-B"). Usually, everything works fine, but for some simulations, the algorithm just gets stuck. When I let my function (+gradient) evaluation print out the function value, I see that L-BFGS-B keeps calling the function with arguments giving the same function value (up to at least
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 =