Trace:

# Differences

This shows you the differences between two versions of the page.

— |
alt._gof [2017/02/03 01:42] (current) rowlesmr3 created |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | ====== Alternative Goodness of Fit ====== | ||

+ | |||

+ | This is an alternative goodness of fit metric described in [1]. | ||

+ | |||

+ | Macro by: Matthew Rowles. All the actual work: Julian Henn | ||

+ | |||

+ | |||

+ | [1] [[https://doi.org/10.1107/S2053273316013206|Henn, J. 2016. "An Alternative to the Goodness of Fit." Acta Crystallographica A 72 (6): 696-703.]]. | ||

+ | |||

+ | |||

+ | <code topas> | ||

+ | ''alternative GOF value as defined in Henn, J. 2016. "An Alternative to the Goodness of Fit." Acta Crystallographica A 72 (6): 696-703. | ||

+ | macro aGoFs(val) { | ||

+ | prm !N_par = Get(number_independent_parameters); | ||

+ | xdd_sum !N_ref = Yobs-Yobs + 1; ''this is the number of datapoints | ||

+ | xdd_sum !delta_sq = (Yobs - Ycalc)^2; | ||

+ | xdd_sum !sigma_sq_1 = Yobs; | ||

+ | xdd_sum !sigma_sq_2 = SigmaYobs^2; | ||

+ | |||

+ | ''if SigmaYobs is not defined, then this makes sure you use sigma = sqrt(Yobs) | ||

+ | prm sigma_sq = If(sigma_sq_2 == 0, sigma_sq_1,sigma_sq_2); | ||

+ | |||

+ | chi2 = (N_ref/(N_ref - N_par)) (delta_sq / sigma_sq); : val | ||

+ | } | ||

+ | </code> | ||