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

Evan Ward commented on MATH-1105:
---------------------------------

{quote}
bq. First patch provides the capability.
Regarding the first patch, is it necessary to introduce a new method 
"getAcceptedObservations()"? It would be nicer to consider that the wrapper 
transparently modifies the problem (by changing the weights of some 
observations, or removing them altogether) so that, viewed from the outside, it 
would be like a fresh problem was built in the first place (with the modified 
observations).
For example, one would be able to tell that some observations were deleted by 
taking the difference between calls to "getObservationSize()" on the original 
instance and on the wrapped instance.
Does that make sense?
{quote}

Getting the number of accepted or rejected observations is the part I am a 
little unsure of. The second patch adds  "getAcceptedObservations()" to the 
Evaluation interface so that data editing is a simple wrapper.

Since the number of accepted observations can change from one Evaluation to the 
next, I couldn't just use LSP.getObservationSize(). Since the current 
optimizers aren't set up to support a changing observation size, I didn't want 
to change the dimension of the residuals or the Jacobian either. 

That left zeroing out the bad data and adding a method to Evaluation to get the 
number of accepted/rejected observations. We could rename 
Evaluation.getAcceptedObservations() to Evaluation.getObservationSize() if that 
makes it clearer that it returns the length of the residual vector when there 
is no data editing and the number of accepted observations when there is data 
editing.  E.g.

{code:java}
LeastSquaresProblem lsp = ...;
Optimum optimum = optimizer.optimize(lsp);
double acceptedRatio = optimum.getAcceptedObservations() / 
lsp.getObservationSize();
{code}

Does this answer your question? I'm not sure if I understood correctly.

> Least squares statistical data editing
> --------------------------------------
>
>                 Key: MATH-1105
>                 URL: https://issues.apache.org/jira/browse/MATH-1105
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Evan Ward
>         Attachments: 0001-Add-statistical-editing-capability.patch, 
> 0002-Integrate-data-editing-with-the-LS-framework.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to