Mean (with confidence bands) for signals sampled at different timepoints
조회 수: 3 (최근 30일)
이전 댓글 표시
I have ratings from multiple subjects, which I'd like to average and display with confidence bands to show cross-subject variability, more or less like in this random plot I found in some paper (where 3 separate conditions are shown):
Once I have the mean and confidence intervals at each timepoint, I figured I could then plot those either with the ciplot Exchange function, or with something like:
fill(x,y_CI, colours, 'FaceAlpha',0.2, 'LineStyle','-');
The problem is that each of my subjects' rating curve is sampled at different time points, for instance one subject might have ratings at [0.5s, 1.1s, ..], and another at [0.2s, 0.6s, ..].
I could manually define a linspace with 100ms-or-so bins and manually compute an average + CI for each. But this seems hacky, and I'm sure a more elegant & simple way exists, although I found no built-in Matlab function for it. One answer to this question suggests using defining and synchronising timetables, but this probably doesn't work in my case as the total number of ratings differs across subjects.
Any help would be greatly appreciated!
댓글 수: 11
dpb
2022년 8월 14일
"Using `synchronize` with spline gave me artefactual interpolations, with y values that go way outside of the 0-100 range."
Yes, not too surprising with a spline if the data have points of inflection; the spline will fit a quadratic through each subsequent set of points -- it will go through each point identically, but is not constrained in between -- I forget whether the method matches even first derivative at the breakpoints or not; my thinking is "not".
Would have to see what particular datasets you're looking at look like to have any specific recomendations other than the obvious(?) of using 'linear' interpolation between the existing data.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!