Damn. I think that the entire 'self.model_statistics()' function needs
to be rethought. The use of the 'instance', 'min_instances', and
'num_instances' keyword arguments and the 'global_data' and 'combine'
variables is very unclear, is not robust, and was not thought out. It
was the result of the gradual addition of small changes to the
function to make the OpenDX mapping and other functions work.
A number of things need to be taken into account. Firstly for
model-free analysis, the parameter set type needs to be determined
using the 'self.determine_param_set_type()' function and the correct
stats returned. If the function returns 'all' or 'diff', then the
instance=0 should return the global stats in self.relax.data.chi2,
etc. If the function returns 'mf' or 'local_tm', then the stats of
the residue corresponding to the 'instance' should be returned.
This algorithm however breaks when running the 'dx.map()' user
function when trying to map the space of the diffusion tensor
parameters. This is what caused the 'combine' variable to be added.
The reason is because all parameter values are set by the mapping code
and then the specific 'calculate()' function is executed to generate
the statistics (the chi-squared value is used in the map). This
function does a per residue calculation of the chi-squared value.
The fix could be to modify the 'self.calculate()' function to handle
the different parameter set types and make the
'self.model_statistics()' also behave dependent on the set type. This
clean but non-trivial approach is likely to cause breakages. Another
option is to sanitise the 'self.model_statistics()' function to handle
the behaviour of the 'self.calculate()' function.
The data attached to bug #5746 located at
https://gna.org/bugs/index.php?func=detailitem&item_id=5746 could be
used for debugging. To test the OpenDX code, mapping of three spaces
can be used to probe the different configurations. These include the
spheroid parameters {Diso, Da, theta}, model m5, and model tm2. The
other test would be to use AIC model selection to select between the
four types of model-free parameter set. All these tests could be
coded into the test suite. There could also be other parts of the
program which may fail due to any changes.
Unless someone feels like taking on a huge challenge, I'll work on the
fix. As I'm currently trying to add more functionality to the Molmol
code, it may take me a while to get onto this. Although I've reopened
Chris's bug report
(https://gna.org/bugs/index.php?func=detailitem&item_id=5746), I may
create a new, more general report with all this info and mark #5746 as
a duplicate of it.
Edward
On 4/11/06, Chris MacRaild <c.a.macraild@xxxxxxxxxxx> wrote:
On Tue, 2006-04-11 at 17:03 +1000, Edward d'Auvergne wrote:
I've solved the problem to bug #5746 located at
https://gna.org/bugs/?func=detailitem&item_id=5746. The issue was
simply an incorrect test in the 'self.model_statistics()' function of
the model-free specific code. The diff of the fix is:
Index: specific_fns/model_free.py
===================================================================
--- specific_fns/model_free.py (revision 2461)
+++ specific_fns/model_free.py (working copy)
@@ -2515,7 +2515,7 @@
# Sequence specific data.
# Statistics for a single residue.
- if not global_stats and not combine:
+ if not global_stats or not combine:
# Skip unselected residues.model_selection('AIC', run)
if not self.relax.data.res[self.run][instance].select:
return None, None, None
This change breaks model selection of diffusion tensors.
If the attached state file is loaded into r2464, and I do eliminate(),
model_selection('AIC', 'final') I get:
AIC model selection.
Instance 0.
Run Num_params_(k) Num_data_sets_(n) Chi2
Criterion
The model from the run None has been selected.
If I revert the above change (by hand), I get the expected behaviour:
AIC model selection.
Instance 0.
Run Num_params_(k) Num_data_sets_(n) Chi2
Criterion
sphere 35 133 380.01225
450.01225
prolate 35 126 316.95532
386.95532
The model from the run 'prolate' has been selected.
Chris
_______________________________________________
relax (http://nmr-relax.com)
This is the relax-devel mailing list
relax-devel@xxxxxxx
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel