Averaging two data with different domains

  • MATLAB
  • Thread starter member 428835
  • Start date
  • Tags
    Data domains
In summary, the conversation discussed the process of averaging functions with data points and the potential limitations of using linear interpolation. The suggested method included linearly interpolating the data over a new domain and averaging the interpolated values. However, there were concerns about the accuracy of averaging interpolated data.
  • #1
member 428835
Hi PF!

Suppose I have three pieces of data: x1 = 0:3:12 and x2 = 0:4:16 and x3 = 0:5:20 with corresponding functions y1 = x1.^2 and y2 = x2.^3 and y3 = x2.^4. How would you average these the "functions" with data (x1,y1) and (x2,y2) and (x3,y3)? My thoughts are:

1) linearly interpolate y1, y2, y3 over a new domain, xnew1 = 0:1:12
2) average y1, y2, y3 interpolations over xnew1
3) linearly interpolate y2 and y3 over xnew2 = 12:1:16
4) average y2,y3 interpolations over xnew2
5) let xnew3 = 16:20
6) average y3 interpolated value over xnew3 (which is just letting y3 take it's values here since no other functions are defined here).

The above is my blueprint, but before I begin, is there an easier way?
 
Physics news on Phys.org
  • #2
Doesn't make much sense to me to linearly interpolate functions which are known to not be linear.
 
  • #3
onatirec said:
Doesn't make much sense to me to linearly interpolate functions which are known to not be linear.
Hi onatirec! Looks like you're new, welcome. It's typical to give simple examples to work with the problem, so the linear interpolation is kind of missing what I'm asking. The actual data I'm working with can't be uploaded because it's huge, complicated, and we're publishing with it. But these toy examples are easily reproducible for everyone. If you have any ideas how to answer the above I'd really appreciate it.
 
  • #4
Well, my point is merely - the general principle of your blueprint makes sense, but I'd be troubled by averaging values which are not real data but interpolations. There are assumptions inherent in interpolation and one would have to take great care to be assured of the fidelity of these resulting data. Simplified as your example is, one can readily see the limitations of the approach in it.
 
  • #5
onatirec said:
Well, my point is merely - the general principle of your blueprint makes sense, but I'd be troubled by averaging values which are not real data but interpolations. There are assumptions inherent in interpolation and one would have to take great care to be assured of the fidelity of these resulting data. Simplified as your example is, one can readily see the limitations of the approach in it.
The data are pretty dense, so I think linear interpolation is sufficient. Besides, I'm averaging solely for plotting the data concisely, which linearly interpolates regardless. I include the raw data sets as auxiliary files, so the science is preserved. Just need to find a way to average unequal domains. Unless you, or anyone, has a better approach (which I'm very open to) I'm doing th above.
 

Similar threads

Replies
1
Views
1K
Replies
1
Views
2K
Replies
4
Views
1K
Replies
14
Views
3K
Replies
6
Views
3K
Back
Top