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
SUMMARY

This discussion focuses on averaging functions defined over different domains using linear interpolation. The user presents a method involving the interpolation of three data sets: x1 = 0:3:12, x2 = 0:4:16, and x3 = 0:5:20, with corresponding functions y1 = x1.^2, y2 = x2.^3, and y3 = x3.^4. The proposed approach includes interpolating the functions over new domains and averaging the results, although concerns are raised regarding the fidelity of interpolated data. Ultimately, the user concludes that linear interpolation is sufficient for their needs, given the density of the data.

PREREQUISITES
  • Understanding of linear interpolation techniques
  • Familiarity with function definitions and operations in MATLAB or similar environments
  • Knowledge of data averaging methods
  • Basic grasp of numerical analysis concepts
NEXT STEPS
  • Research advanced interpolation methods, such as spline interpolation
  • Explore the implications of averaging interpolated data versus raw data
  • Learn about MATLAB's interp1 function for one-dimensional interpolation
  • Investigate techniques for handling data with unequal domains in numerical analysis
USEFUL FOR

Data scientists, statisticians, and researchers working with numerical data analysis and interpolation methods will benefit from this discussion.

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