Averaging two data with different domains

  • Context: MATLAB 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Data domains
Click For Summary

Discussion Overview

The discussion revolves around the method of averaging functions derived from datasets with different domains. Participants explore the implications of linear interpolation for non-linear functions and the validity of averaging interpolated values versus actual data.

Discussion Character

  • Exploratory
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant proposes a method involving linear interpolation of functions y1, y2, and y3 over new domains to average the data.
  • Another participant questions the rationale behind using linear interpolation for functions that are not linear, suggesting it may not accurately represent the underlying data.
  • A different participant emphasizes the need to be cautious about averaging interpolated values, highlighting the assumptions involved in interpolation and the potential limitations of this approach.
  • One participant defends the use of linear interpolation, arguing that it is sufficient given the density of the data and that the purpose is primarily for concise plotting, while remaining open to alternative methods.

Areas of Agreement / Disagreement

Participants express differing views on the appropriateness of linear interpolation for non-linear functions and the implications of averaging interpolated values. There is no consensus on the best approach to take.

Contextual Notes

Participants note that the original data is complex and cannot be shared, which may limit the applicability of the discussed methods. The assumptions inherent in interpolation and the fidelity of resulting data are also highlighted as potential limitations.

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
Doesn't make much sense to me to linearly interpolate functions which are known to not be linear.
 
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.
 
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.
 
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
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K