fitAlgs.qualityFunc module

Author:Dominic Hunt
fitAlgs.qualityFunc.BIC2(**kwargs)[source]

Generates a function that calculates the Bayesian Information Criterion (BIC)

\(\lambda \mathrm{log}_2(T)+ f_{\mathrm{mod}}\left(\\vec x\right)\)

Parameters:kwargs
fitAlgs.qualityFunc.BIC2norm(**kwargs)[source]
Parameters:
  • numParams (int, optional) – The number of parameters used by the model used for the fits process. Default 2
  • qualityThreshold (float, optional) – The BIC minimum fit quality criterion used for determining if a fit is valid. Default 20.0
  • number_actions (int or list of ints the length of the number of trials being fitted, optional) – The number of actions the participant can choose between for each trialstep of the task. May need to be specified for each trial if the number of action choices varies between trials. Default 2
  • randActProb (float or list of floats the length of the number of trials being fitted. Optional) – The prior probability of an action being randomly chosen. May need to be specified for each trial if the number of action choices varies between trials. Default 1/number_actions
fitAlgs.qualityFunc.BIC2normBoot(**kwargs)[source]

An attempt at looking what would happen if the samples were resampled. It was hoped that by doing this, the difference between different sample distributions would become more pronounced. This was not found to be true.

Parameters:
  • numParams (int, optional) – The number of parameters used by the model used for the fits process. Default 2
  • qualityThreshold (float, optional) – The BIC minimum fit quality criterion used for determining if a fit is valid. Default 20.0
  • number_actions (int or list of ints the length of the number of trials being fitted, optional) – The number of actions the participant can choose between for each trialstep of the task. May need to be specified for each trial if the number of action choices varies between trials. Default 2
  • randActProb (float or list of floats the length of the number of trials being fitted. Optional) – The prior probability of an action being randomly chosen. May need to be specified for each trial if the number of action choices varies between trials. Default 1/number_actions
  • numSamples (int, optional) – The number of samples that will be randomly resampled from modVals. Default 100
  • sampleLen (int, optional) – The length of the random sample. Default 1
fitAlgs.qualityFunc.WBIC2(**kwargs)[source]

Unfinished WBIC implementation

fitAlgs.qualityFunc.bayesFactor(**kwargs)[source]

\(2^{\frac{x}{2}}\)

Parameters:kwargs
fitAlgs.qualityFunc.bayesInv(**kwargs)[source]
Parameters:
  • numParams (int, optional) – The number of parameters used by the model used for the fitters process. Default 2
  • qualityThreshold (float, optional) – The BIC minimum fit quality criterion used for determining if a fit is valid. Default 20.0
  • number_actions (int or list of ints the length of the number of trials being fitted, optional) – The number of actions the participant can choose between for each trialstep of the task. May need to be specified for each trial if the number of action choices varies between trials. Default 2
  • randActProb (float or list of floats the length of the number of trials being fitted. Optional) – The prior probability of an action being randomly chosen. May need to be specified for each trial if the number of action choices varies between trials. Default 1/number_actions
fitAlgs.qualityFunc.bayesRand(**kwargs)[source]
fitAlgs.qualityFunc.logAverageProb(modVals)[source]

Generates a fit quality value based on \(\sum -2\mathrm{log}_2(\\vec x)\)

Returns:fit – The sum of the model values returned
Return type:float
fitAlgs.qualityFunc.logeprob(modVals)[source]

Generates a fit quality value based on \(f_{\mathrm{mod}}\left(\\vec x\right) = \sum -\mathrm{log}_e(\\vec x)\)

Returns:fit – The sum of the model values returned
Return type:float
fitAlgs.qualityFunc.logprob(modVals)[source]

Generates a fit quality value based on \(f_{\mathrm{mod}}\left(\\vec x\right) = \sum -2\mathrm{log}_2(\\vec x)\)

Returns:fit – The sum of the model values returned
Return type:float
fitAlgs.qualityFunc.maxprob(modVals)[source]

Generates a fit quality value based on \(\sum 1-{\\vec x}\)

Returns:fit – The sum of the model values returned
Return type:float
fitAlgs.qualityFunc.qualFuncIdent(value, **kwargs)[source]
fitAlgs.qualityFunc.r2(**kwargs)[source]
fitAlgs.qualityFunc.simpleSum(modVals)[source]

Generates a fit quality value based on \(\sum {\\vec x}\)

Returns:fit – The sum of the model values returned
Return type:float