nets_stats.m 894 B

1234567891011121314151617181920212223242526
  1. %
  2. % nets_stats - calculate various timeseries stats
  3. % Steve Smith, 2013-2014
  4. %
  5. % [ts_stats] = nets_stats(ts);
  6. %
  7. % estimates mean and stddev (across subjects) for temporal stats: stddev skewness kurtosis
  8. %
  9. function [ts_stats] = nets_stats(ts);
  10. all_stats.std=[]; all_stats.skewness=[]; all_stats.kurtosis=[];
  11. for s=1:ts.Nsubjects
  12. grot=ts.ts((s-1)*ts.NtimepointsPerSubject+1:s*ts.NtimepointsPerSubject,:);
  13. all_stats.std = [all_stats.std; std(grot)];
  14. all_stats.skewness = [all_stats.skewness; skewness(grot)];
  15. all_stats.kurtosis = [all_stats.kurtosis; kurtosis(grot)];
  16. end
  17. ts_stats.std.mean = mean(all_stats.std);
  18. ts_stats.std.std = std(all_stats.std);
  19. ts_stats.skewness.mean = mean(all_stats.skewness);
  20. ts_stats.skewness.std = std(all_stats.skewness);
  21. ts_stats.kurtosis.mean = mean(all_stats.kurtosis);
  22. ts_stats.kurtosis.std = std(all_stats.kurtosis);