i wish estimate parameters following example: but how can make deoptim optimise 2 of 3 parameters? - there direct method this? rm(list=ls()) t <- seq(0.1,20,length=100) hobs <- 20 + 8*exp(-0.05*t) hsim <- function(p,t) {p[1] + p[2]*exp(-p[3]*t)} upper <- c(30,10,1) lower <- -upper resfun <- function(p, t, hobs) { r <- hobs - hsim(p,t) return(t(r)%*%r) } deoptim(resfun, lower, upper, hobs = hobs, t = t, deoptim.control(np = 80, itermax = 200, f = 1.2, cr = 0.7, trace =false)) i found workaround cf below. there more elegant way of doing this? rm(list=ls()) t <- seq(0.1,20,length=100) hobs <- 20 + 8*exp(-0.05*t) #hkorr <- rnorm(100,0,0.2) hsim <- function(p,t) {p[1] + p[2]*exp(-p[3]*t)} upper <- c(20,10,1) lower <- c(1,1,0.001) sel = c(0,1,1) ini = c(20,na,na) # correct upper , lower selected parameters upper <- upper[which(sel==1)] lower <- lower[which(sel==1)] resfun <- function(p...