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

Luc Maisonobe commented on MATH-200:
------------------------------------

Since the contract on the two methods is related to the complete parameters 
array, only the more elaborate fix with specific logic for bound parameters is 
feasible.

I agree this is a critical error. I will try to provide a fix in the next few 
days.

Thanks for reporting this.

> AbstractEstimator: getCovariances() and guessParametersErrors() crash when 
> having bound parameters
> --------------------------------------------------------------------------------------------------
>
>                 Key: MATH-200
>                 URL: https://issues.apache.org/jira/browse/MATH-200
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 1.2
>            Reporter: Plamen Petrov
>            Assignee: Luc Maisonobe
>            Priority: Critical
>
> the two methods getCovariances() and guessParametersErrors() from 
> org.apache.commons.math.estimation.AbstractEstimator crash with 
> ArrayOutOfBounds exception when some of the parameters are bound. The reason 
> is that the Jacobian is calculated only for the unbound parameters. in the 
> code you loop through all parameters.
> line #166: final int cols = problem.*getAllParameters()*.length;
> should be replaced by:  final int cols = 
> problem.*getUnboundParameters()*.length;
> (similar changes could be done in guessParametersErrors())
> the dissadvantage of the above bug fix is that what is returned to the user 
> is an array with smaller size than the number of all parameters. 
> Alternatively, you can have some logic in the code which writes zeros for the 
> elements of the covariance matrix corresponding to the bound parameters

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to