SharpBCI
A multi-threaded brain control interface (BCI) library in C#
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Pages
SharpBCI.TournamentArtifactDetector Class Reference

The TournamentArtifactDetector holds a "tournament" of some number ARArtifactDetectors (termed competitors) The majority consensus of the most well-fit models is the final determination of whether or not the data is an artifact. More...

Inheritance diagram for SharpBCI.TournamentArtifactDetector:
SharpBCI.IArtifactDetector

Public Member Functions

 TournamentArtifactDetector (uint tournamentSize, uint learningSetSize, uint nAccept, uint initialMerits)
 
double Error ()
 Inform the caller of the current confusion of this implementation The returned value should be a double greater than or equal to zero Otherwise no range is assumed, but lower values should indicate lower confusion For example, a detector that perfectly models the signal with no artifacts should have an error of zero Pragmatically, error will generally be non-zero due to presence of artifacts and noise. More...
 
bool Detect (double data)
 Update artifact detector using next. More...
 

Protected Member Functions

IArtifactDetector NewCompetitor ()
 

Detailed Description

The TournamentArtifactDetector holds a "tournament" of some number ARArtifactDetectors (termed competitors) The majority consensus of the most well-fit models is the final determination of whether or not the data is an artifact.

The detector defines a concept called "(de)merits". (De)merits are points which are added when the competitor's error is low and taken away when the competitor's error is high. If the (de)merits of a competitor is less than zero, it will be ejected from the tournament and replaced with a newly fit competitor. Thus, every once in a while, the artifact detector will potentially re-fit some number of competitors. The time interval, in the worst case, between re-fits of the model is determined by initialMerits. In this way, the TournamentArtifactDetector will converge on the best fit for the underlying process while this process is wide-sense stationary. If the underlying process changes model, the TournamentArtifactDetector will eventually converge on the best-fit for the new process.

Constructor & Destructor Documentation

SharpBCI.TournamentArtifactDetector.TournamentArtifactDetector ( uint  tournamentSize,
uint  learningSetSize,
uint  nAccept,
uint  initialMerits 
)
Parameters
tournamentSizethe number of competitors in the tournament
learningSetSizethe size of the dataset used to fit new competitors
nAccepthow many competitors should be used to determine the consensus opinion of the detector
initialMeritscompetitors which have high error will be ejected

Member Function Documentation

bool SharpBCI.TournamentArtifactDetector.Detect ( double  next)

Update artifact detector using next.

Returns
true iff next is an artifact, false otherwise

Implements SharpBCI.IArtifactDetector.

double SharpBCI.TournamentArtifactDetector.Error ( )

Inform the caller of the current confusion of this implementation The returned value should be a double greater than or equal to zero Otherwise no range is assumed, but lower values should indicate lower confusion For example, a detector that perfectly models the signal with no artifacts should have an error of zero Pragmatically, error will generally be non-zero due to presence of artifacts and noise.

Returns
the internal confusion metric of this implementation

Implements SharpBCI.IArtifactDetector.

IArtifactDetector SharpBCI.TournamentArtifactDetector.NewCompetitor ( )
protected

The documentation for this class was generated from the following file: