Re: [R] suggestions argument in rbga function in genalg package

2012-04-09 Thread Frank Schwidom
On Thu, Sep 22, 2011 at 06:46:23PM +, Joseph Boyer wrote:
 Would someone be so kind as to provide example code where they use the 
 suggestions argument in  the rgba function
 In genalg? I can't get it to work.
 
 The following code works just fine:
 
 GenFit -rbga(Lower, Upper, evalFunc = evaluate)
 
 Lower and Upper are each numeric vectors with 7 elements. Evaluate is an 
 objective function.
 However, when I want to use a suggested chromosome, I get an error message. 
 My code is
 
 start - c(1,0.1,10, 100,1,100,1)
 
 suggestions - list(start)
 
 GenFit -rbga(Lower, Upper, suggestions = suggestions, evalFunc = evaluate)
 
 The error message is:
 
 Error in 1:suggestionCount : argument of length 0
 
 Thanks.

rbga( c( -1, -1), c( 1, 1), evalFunc= function( string){ sum(
string**2)**0.5}, suggestions=t( as.data.frame( c( 0, 0

Regards

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] suggestions argument in rbga function in genalg package

2011-10-03 Thread Joseph Boyer
Enrico,

The idea of looking at the code never occurred to me. That's a great idea which 
will come in useful
I'm sure.

In this particular case the using list() or as.matrix() does not solve the 
problem, but
those are both good ideas.

Thanks for the reply.

-Original Message-
From: Enrico Schumann [mailto:enricoschum...@yahoo.de] 
Sent: Friday, September 23, 2011 12:53 AM
To: Joseph Boyer
Cc: r-help@r-project.org
Subject: Re: [R] suggestions argument in rbga function in genalg package


I do not use this package, but a quick look at the code shows this.

if (!is.null(suggestions)) {
# [deleted]
suggestionCount = dim(suggestions)[1]

So 'suggestions' needs to have a dim argument (while the documentation 
speaks of an 'optional list of suggested chromosomes'). You could try

as.matrix(c(1,0.1,10, 100,1,100,1))

But I cannot tell if that solves your problem since you have not 
provided your objective function (ie, you have not provided the 
commented, minimal, self-contained, reproducible code that the footer 
of this message speaks about).


Regards,
Enrico

Am 22.09.2011 20:46, schrieb Joseph Boyer:
 Would someone be so kind as to provide example code where they use the 
 suggestions argument in  the rgba function
 In genalg? I can't get it to work.

 The following code works just fine:

 GenFit-rbga(Lower, Upper, evalFunc = evaluate)

 Lower and Upper are each numeric vectors with 7 elements. Evaluate is an 
 objective function.
 However, when I want to use a suggested chromosome, I get an error message. 
 My code is

 start- c(1,0.1,10, 100,1,100,1)

 suggestions- list(start)

 GenFit-rbga(Lower, Upper, suggestions = suggestions, evalFunc = evaluate)

 The error message is:

 Error in 1:suggestionCount : argument of length 0

 Thanks.



   [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


-- 
Enrico Schumann
Lucerne, Switzerland
http://nmof.net/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] suggestions argument in rbga function in genalg package

2011-09-22 Thread Joseph Boyer
Would someone be so kind as to provide example code where they use the 
suggestions argument in  the rgba function
In genalg? I can't get it to work.

The following code works just fine:

GenFit -rbga(Lower, Upper, evalFunc = evaluate)

Lower and Upper are each numeric vectors with 7 elements. Evaluate is an 
objective function.
However, when I want to use a suggested chromosome, I get an error message. My 
code is

start - c(1,0.1,10, 100,1,100,1)

suggestions - list(start)

GenFit -rbga(Lower, Upper, suggestions = suggestions, evalFunc = evaluate)

The error message is:

Error in 1:suggestionCount : argument of length 0

Thanks.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] suggestions argument in rbga function in genalg package

2011-09-22 Thread Enrico Schumann


I do not use this package, but a quick look at the code shows this.

if (!is.null(suggestions)) {
   # [deleted]
   suggestionCount = dim(suggestions)[1]

So 'suggestions' needs to have a dim argument (while the documentation 
speaks of an 'optional list of suggested chromosomes'). You could try


as.matrix(c(1,0.1,10, 100,1,100,1))

But I cannot tell if that solves your problem since you have not 
provided your objective function (ie, you have not provided the 
commented, minimal, self-contained, reproducible code that the footer 
of this message speaks about).



Regards,
Enrico

Am 22.09.2011 20:46, schrieb Joseph Boyer:

Would someone be so kind as to provide example code where they use the 
suggestions argument in  the rgba function
In genalg? I can't get it to work.

The following code works just fine:

GenFit-rbga(Lower, Upper, evalFunc = evaluate)

Lower and Upper are each numeric vectors with 7 elements. Evaluate is an 
objective function.
However, when I want to use a suggested chromosome, I get an error message. My 
code is

start- c(1,0.1,10, 100,1,100,1)

suggestions- list(start)

GenFit-rbga(Lower, Upper, suggestions = suggestions, evalFunc = evaluate)

The error message is:

Error in 1:suggestionCount : argument of length 0

Thanks.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
Enrico Schumann
Lucerne, Switzerland
http://nmof.net/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.