[R] Error: C stack usage is too close to the limit

Luis Ridao Cruz Luisr at hav.fo
Mon Sep 14 15:24:16 CEST 2009


R-help,

I 'm trying to optimize a model to data using log-likelihoods
but I encounter the following error message:

> l= c(49.4, 57.7,64.8,70.9,78.7,86.6,88.3,91.6,99,115)
> t=3:12
> fn <- function(params, l=l, t=t) {
		Linf   <-  params[1]
		k       <-  params[2]
		t0     <-  params[3]
                               sigma <-  params[4]
                                lhat   <-  params[1]*(1-exp(-params[2]*(t-params[3])))
		logL   <-  -sum(dnorm(log(l),log(lhat),sqrt(sigma),TRUE))
		return(logL)
                    }

> resop <- optim(c(120, .1, 0, 1), fn, method="L-BFGS-B",lower=c(0.0, 0.001, 0.001,0.01)
+     ,upper = rep(Inf, 4), hessian=TRUE, control=list(trace=1))

Error: C stack usage is too close to the limit

Thanks in advance.


Running R on a Windows XP machine
> version
               _                           
platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
status                                     
major          2                           
minor          8.1                         
year           2008                        
month          12                          
day            22                          
svn rev        47281                       
language       R                           
version.string R version 2.8.1 (2008-12-22)




More information about the R-help mailing list