Back to the main page.

Bug 747 - cfg.design and design are both possible inputs in stat* functions

Status CLOSED FIXED
Reported 2011-06-08 17:31:00 +0200
Modified 2011-06-22 13:43:55 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 enhancement
Assigned to: Johanna
URL:
Tags:
Depends on:
Blocks:
See also:

Johanna - 2011-06-08 17:31:47 +0200

For statfun* and statistics* functions, 'design' is an explicit input, therefore should cfg.design be forcibly removed if isfield to avoid confusion? cfg.design often is included due to being called by higher function which did legitimately use cfg.design


Robert Oostenveld - 2011-06-09 12:17:27 +0200

indeed a good idea to rmfield design from cfg prior to passing it into the statfun. The cfg.design will always be teh original unscrambled version and should not be used. There are actually many more cfg fields that the statfun ideally should not be aware of.


Johanna - 2011-06-22 12:30:50 +0200

I fixed this by removing design from cfg at the level of statistics_wrapper, just prior to the 'statmethod' being called. Neither statistics_montecarlo or statistics_analytic seem to want a cfg.design, but instead only use 'design' input. However, statistics_crossvalidate has a weird line (72) >> assert(isfield(cfg,'design')) However, cfg.design doesn't seem to be used anywhere, instead the input 'design' is used. I have therefore also removed this line from this function.