[ 
https://issues.apache.org/jira/browse/MATH-521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997696#comment-12997696
 ] 

Luc Maisonobe commented on MATH-521:
------------------------------------

Do you want to remove the guess method or to have default values just when the 
guess fails ? We should add tests for such failures. I think one way to make it 
fail would be for example to supply a constant sample with 0 values only for y, 
or a set of points with only one value for x and random values for y. 

I think for the frequency part, 0 is probably not a good choice and would lead 
to numerical problems. Perhaps a value like 2PI/l where l is the range in X 
would be better, it would start considering the sample covers exactly one 
period.

The javadoc is for sure not perfect but is readable in a browser, which is the 
main intend. The output is here: 
[http://commons.apache.org/math/api-2.1/org/apache/commons/math/optimization/fitting/HarmonicCoefficientsGuesser.html].

Putting this in the user guide would be a nice addition.

> Changes in "HarmonicCoefficientsGuesser"
> ----------------------------------------
>
>                 Key: MATH-521
>                 URL: https://issues.apache.org/jira/browse/MATH-521
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: api-change, documentation
>             Fix For: 3.0
>
>
> (1) The "guess" method throws "OptimizationException" when the algorithm 
> fails to determine valid values for amplitude and angular frequency.
> There are no test showing how such a situation can occur.
> Moreover, since this procedure is used to provide an initial guess to an 
> optimizer, it is better to pick any values for those parameters (e.g. zero) 
> and let the optimizer proceed from that initial point.
> (2) The class javadoc seems very thorough in explaining the algorithm, but is 
> quite unreadable in the source code, making it fairly useless for checking 
> how the code complies with the comments. I think that this explanation should 
> go in the user guide (and leave a mostly "plain text" outline of the 
> algorithm, referring to the guide for details). [Does the format of the user 
> guide allow such tricky (ASCII "art") constructs?]

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to