Package generic_fns :: Module model_selection
[hide private]
[frames] | no frames]

Module model_selection

source code

Module for selecting the best model.

Functions [hide private]
float
aic(chi2, k, n)
Akaike's Information Criteria (AIC).
source code
float
aicc(chi2, k, n)
Small sample size corrected AIC.
source code
float
bic(chi2, k, n)
Bayesian or Schwarz Information Criteria.
source code
 
select(method=None, modsel_pipe=None, pipes=None)
Model selection function.
source code
Variables [hide private]
  __package__ = 'generic_fns'

Imports: log, get_type, has_pipe, pipe_names, switch, RelaxError, RelaxPipeError, get_specific_fn


Function Details [hide private]

aic(chi2, k, n)

source code 

Akaike's Information Criteria (AIC).

The formula is:

   AIC = chi2 + 2k
Parameters:
  • chi2 (float) - The minimised chi-squared value.
  • k (int) - The number of parameters in the model.
  • n (int) - The dimension of the relaxation data set.
Returns: float
The AIC value.

aicc(chi2, k, n)

source code 

Small sample size corrected AIC.

The formula is:

                      2k(k + 1)
   AICc = chi2 + 2k + ---------
                      n - k - 1
Parameters:
  • chi2 (float) - The minimised chi-squared value.
  • k (int) - The number of parameters in the model.
  • n (int) - The dimension of the relaxation data set.
Returns: float
The AIC value.

bic(chi2, k, n)

source code 

Bayesian or Schwarz Information Criteria.

The formula is:

   BIC = chi2 + k ln n
Parameters:
  • chi2 (float) - The minimised chi-squared value.
  • k (int) - The number of parameters in the model.
  • n (int) - The dimension of the relaxation data set.
Returns: float
The AIC value.

select(method=None, modsel_pipe=None, pipes=None)

source code 

Model selection function.

Parameters:
  • method (str) - The model selection method. This can currently be one of:
    • 'AIC', Akaike's Information Criteria.
    • 'AICc', Small sample size corrected AIC.
    • 'BIC', Bayesian or Schwarz Information Criteria.
    • 'CV', Single-item-out cross-validation.

    None of the other model selection techniques are currently supported.

  • modsel_pipe (str) - The name of the new data pipe to be created by copying of the selected data pipe.
  • pipes (list of str) - A list of the data pipes to use in the model selection.