I could solve this problem by setting the boundary options as follows.

par1Bnd<-c(0.001,0.999)
par2Bnd<-c(-10,10)
DomainMat<-matrix(c(par1Bnd,par2Bnd), nrow = 2, ncol=2, byrow=TRUE)
result<-genoud(Qmin, nvars=2, starting.values=c(0.5,0),
Domains=DomainMat, control=list(ndeps=c(1e-7,1e-2)), boundary.enforcement=2)

To understand how to set up each option, you can refer to the links:
http://sekhon.berkeley.edu/rgenoud/genoud.html
http://sekhon.berkeley.edu/rgenoud/

In the above setting, "Domains" decides the boundary, and "starting.values"
indicates the initial values of parameters. "control" is the list of control
parameters in "optim" (For details, refer to
http://sekhon.berkeley.edu/stats/html/optim.html). "boundary.enforcement"
prevents the algorithm from going away from the boundary.


On 13 October 2010 15:01, Wonsang You [via R] <
ml-node+2993619-1186574920-137871@n4.nabble.com<ml-node%2B2993619-1186574920-137871@n4.nabble.com>
> wrote:

> I have to make correction in my error message which I introduced in my
> original message. Sorry for my mistake.
> Finally, I had the following error message after running the function
> 'genoud'.
>
> Error in optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control
> = control) :
>   non-finite finite-difference value [1]
>
> When I execute 'traceback()' to trace where the error occured, I got the
> following results. Unfortunately, I could not figure out what was the
> problem from the above information.
>
> 6: optim(foo.vals, fn = fn1, gr = gr1, method = optim.method, control =
> control)
> 5: function (foo.vals)
>    {
>        ret <- optim(foo.vals, fn = fn1, gr = gr1, method = optim.method,
>            control = control)
>        return(c(ret$value, ret$par))
>    }(c(0.220878697173384, -13.3643173824871))
> 4: .Call("rgenoud", as.function(fn1), new.env(), as.integer(nvars),
>        as.integer(pop.size), as.integer(max.generations),
> as.integer(wait.generations),
>        as.integer(nStartingValues), as.real(starting.values), as.vector(P),
>
>        as.matrix(Domains), as.integer(max), as.integer(gradient.check),
>        as.integer(boundary.enforcement), as.double(solution.tolerance),
>        as.integer(BFGS), as.integer(data.type.int),
> as.integer(provide.seeds),
>        as.integer(unif.seed), as.integer(int.seed),
> as.integer(print.level),
>        as.integer(share.type), as.integer(instance.number),
> as.integer(MemoryMatrix),
>        as.integer(debug), as.character(output.path),
> as.integer(output.type),
>        as.character(project.path), as.integer(hard.generation.limit),
>        as.function(genoud.optim.wrapper101), as.integer(lexical),
>        as.function(fnLexicalSort), as.function(fnMemoryMatrixEvaluate),
>        as.integer(UserGradient), as.function(gr1func), as.real(P9mix),
>        as.integer(BFGSburnin), as.integer(transform), PACKAGE = "rgenoud")
> 3: genoud(Qmin, nvars = 2, starting.values = InitVal, max.generations = 10,
>
>        wait.generations = 3, n = n, yper = yper, pertype = pertype) at
> wFGN.R#75
> Wonsang You
> Leibniz Institute for Neurobiology
>
>
> ------------------------------
>  View message @
> http://r.789695.n4.nabble.com/How-to-fix-error-in-the-package-rgenoud-tp2993489p2993619.html
> To unsubscribe from How to fix error in the package 'rgenoud', click here<http://r.789695.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=2993489&code=eW91QGlmbi1tYWdkZWJ1cmcuZGV8Mjk5MzQ4OXwxODQ5NDg1ODM2>.
>
>
>

	[[alternative HTML version deleted]]

