NiMARE icon indicating copy to clipboard operation
NiMARE copied to clipboard

Add weighting options to MKDADensity

Open tyarkoni opened this issue 5 years ago • 1 comments

Currently the MKDADensity estimator automatically weights by sample size and inference type (fixed vs. random effects). It makes sense to keep these as the defaults for consistency with the Matlab implementation, but we should probably add the ability to disable these weightings, and also to pass custom weights.

We could, e.g., add a weights initialization argument that's set to 'auto' by default (current behavior), but alternatively can be set to 'sample_size', 'inference_type', or provide the name of a metadata column in the dataset, in which case the values found there are used as weights.

tyarkoni avatar Oct 29 '20 14:10 tyarkoni

If we want to allow arbitrary weights based on fields in the metadata or coordinates attributes, should we also allow users to specify any transformations they want on those weights before they're used in the meta-analysis? E.g., when you say sample_size, maybe you might really want to use the square root of the sample size (as we automatically do for the weighted Stouffer's IBMA Estimator).

I see two ways to do this:

  1. Add some kind of function in nimare.transforms that will operate on, and add to, the DataFrame attributes. So beforehand you could say that you want sample_size_sqrt to be the square root of the mean of the sample_sizes column of the metadata attribute.
  2. Incorporate transformations into the initialization parameter. So weights, I guess, would probably be a dictionary.

tsalo avatar Dec 09 '21 16:12 tsalo