Closed gurayerus closed 9 months ago
If I understand correctly, you are asking whether the update to s_data
is intentional. Yes, I believe so, since the function will either apply the adjustments for empirical bayes estimates of site effects (if eb
is True) or it will apply adjustments based on location/scale estimates of site effects (if eb
is False).
The ability to return s_data
just enables users to work with the "standardized" data (zero mean and unit standard deviation, after correcting site effects) if they prefer so. The object bayes_data
will be back-transformed to the mean and variance of the original data.
In neuroCombat.py the function adjust_data_final() gets "s_data" as an input. The function modifies the contents of the array: bayesdata = s_data ... bayesdata[:,batch_idxs] = numer / denom Is this done on purpose?
Note: This part of the code comes from the initial implementation by JP Fortin. However, his code does not return or uses s_data, so there is no problem. In neuroHarmonize, there is an option to return s_data in neuroHarmonizeLearn(), and if the update of the s_data is not intentional, this will cause returning an incorrect s_data value.