Author: bugman Date: Sun Apr 13 20:43:13 2008 New Revision: 5651 URL: http://svn.gna.org/viewcvs/relax?rev=5651&view=rev Log: Alphabetical ordering of functions. Modified: 1.3/generic_fns/model_selection.py Modified: 1.3/generic_fns/model_selection.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/model_selection.py?rev=5651&r1=5650&r2=5651&view=diff ============================================================================== --- 1.3/generic_fns/model_selection.py (original) +++ 1.3/generic_fns/model_selection.py Sun Apr 13 20:43:13 2008 @@ -27,6 +27,55 @@ # relax module imports. from data import Data as relax_data_store from relax_errors import RelaxDiffSeqError, RelaxError, RelaxNoPipeError, RelaxNoSequenceError + + +def aic(chi2, k, n): + """Akaike's Information Criteria (AIC). + + The formula is: + + AIC = chi2 + 2k + + where: + chi2 is the minimised chi-squared value. + k is the number of parameters in the model. + """ + + return chi2 + 2.0*k + + +def aicc(chi2, k, n): + """Small sample size corrected AIC. + + The formula is: + + 2k(k + 1) + AICc = chi2 + 2k + --------- + n - k - 1 + + where: + chi2 is the minimised chi-squared value. + k is the number of parameters in the model. + n is the dimension of the relaxation data set. + """ + + return chi2 + 2.0*k + 2.0*k*(k + 1.0) / (n - k - 1.0) + + +def bic(chi2, k, n): + """Bayesian or Schwarz Information Criteria. + + The formula is: + + BIC = chi2 + k ln n + + where: + chi2 - is the minimised chi-squared value. + k - is the number of parameters in the model. + n is the dimension of the relaxation data set. + """ + + return chi2 + k * log(n) def select(method=None, modsel_run=None, runs=None): @@ -236,55 +285,6 @@ self.duplicate_data[best_model](new_run=modsel_run, old_run=best_model, instance=i, global_stats=global_stats) -def aic(chi2, k, n): - """Akaike's Information Criteria (AIC). - - The formula is: - - AIC = chi2 + 2k - - where: - chi2 is the minimised chi-squared value. - k is the number of parameters in the model. - """ - - return chi2 + 2.0*k - - -def aicc(chi2, k, n): - """Small sample size corrected AIC. - - The formula is: - - 2k(k + 1) - AICc = chi2 + 2k + --------- - n - k - 1 - - where: - chi2 is the minimised chi-squared value. - k is the number of parameters in the model. - n is the dimension of the relaxation data set. - """ - - return chi2 + 2.0*k + 2.0*k*(k + 1.0) / (n - k - 1.0) - - -def bic(chi2, k, n): - """Bayesian or Schwarz Information Criteria. - - The formula is: - - BIC = chi2 + k ln n - - where: - chi2 - is the minimised chi-squared value. - k - is the number of parameters in the model. - n is the dimension of the relaxation data set. - """ - - return chi2 + k * log(n) - - def tests(run): """Function containing tests the given run."""