Mean (with confidence bands) for signals sampled at different timepoints

조회 수: 3 (최근 30일)
z8080
z8080 2022년 8월 11일
댓글: dpb 2022년 8월 14일
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
z8080
z8080 2022년 8월 14일
Haha, well at least this thread taught me a funny new expression in English, if nothing else :)
Don't worry about all other details, I'm just trying to get signals resampled or aligned that were originally sampled at different timepoints.
Using `synchronize` with spline gave me artefactual interpolations, with y values that go way outside of the 0-100 range. So I am now trying retime on each individual signal, to force it into a 100ms sampling rate.
dpb
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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by