Fitting random subset of pixels: incorrect handling of residuals

Bug #1152409 reported by Jerome Fung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HoloPy
Fix Committed
High
Tom Dimiduk

Bug Description

When I try to fit a model to a random subset of a hologram, chi-squared (as written to stdio by nmpfit and logged by the fit) does not appear to be calculated correctly.

The easiest way to reproduce this is to tweak test_fit.py:test_fit_random_subset and run the test with the nosetests --nocapture flag. The nmpfit chi-squared decreases as you increase the value of the use_random_fraction kwarg. Further experimentation with trying to fit a calculated hologram found chi-squared scaling as (1 - use_random_fraction). This is consistent with chi-squared being calculated by comparing the original target hologram to a model hologram where scattering is calculated at some fraction of the pixels and the remainder are set to 1.

Jerome Fung (fung)
Changed in holopy:
importance: Undecided → High
Tom Dimiduk (tdimiduk)
Changed in holopy:
assignee: nobody → Tom Dimiduk (tdimiduk)
Revision history for this message
Tom Dimiduk (tdimiduk) wrote :

I think this should be fixed now. Can you check it?

Changed in holopy:
status: New → Fix Committed
Revision history for this message
Jerome Fung (fung) wrote :

Rsquared still not quite right. Will generate test case.

Changed in holopy:
status: Fix Committed → In Progress
Revision history for this message
Jerome Fung (fung) wrote :

Minimal test case attached, demonstrating that rsq remains surprisingly low.

Tom Dimiduk (tdimiduk)
Changed in holopy:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.