Skip to content
Prev 247252 / 398503 Next

setting up a genoud run

As a follow up to my original question, I got it to run by
re-specifying my function a bit like this - I made the vector of 5
predictors the argument of my function:

f1 = function(predictors) {  # predictors: p1,p2,p3,p4b,p4a
	y = 2 + 1.5*predictors[1] +
0.3*(predictors[2]+1.2+0.6*predictors[5])-1.2*predictors[3] +
0.9*predictors[4]
	return(y)
}
f1(c(1,2,4,5,6)) # checking it works

npredictors=5
genoud(f1,nvars=npredictors,max=TRUE,pop.size=1000,max.generations=100,wait.generations=10,
hard.generation.limit=TRUE,starting.values=rep(0,npredictors),
Domains=matrix(rep(c(0,1000),npredictors),ncol=2,byrow=T),boundary.enforcement=2)

It has run, but starting in Generation 13, it said:  "at least one
gradient is too large." G[3]: -inf
Also, it gives me the following parameters as the answer:  1000 1000
 0 1000 1000 (which makes sense).

I am wondering what does it mean that "one gradient is too large"?
Thanks a lot for explaining!

Dimitri



On Thu, Jan 13, 2011 at 11:10 AM, Dimitri Liakhovitski
<dimitri.liakhovitski at gmail.com> wrote: