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.
 

1. How can I average two sets of data with different domains?

In order to average two sets of data with different domains, you need to first determine if the data can be converted to a common unit of measure. If not, you can use a weighted average where each data point is multiplied by a weight based on its relative importance. Alternatively, you can use a statistical method such as interpolation or regression to estimate missing data points in one of the datasets.

2. What are some common challenges when averaging two data sets with different domains?

Some common challenges when averaging two data sets with different domains include differences in units of measure, missing data points, and variations in data collection methods. These challenges can affect the accuracy and reliability of the averaged data, so it is important to carefully consider the methods used to address them.

3. Can I simply add the two data sets and divide by two to get an average?

No, simply adding and dividing by two is not a valid method for averaging two data sets with different domains. This method assumes that the data points are equally important and can be directly compared, which may not be the case. It is important to carefully consider the characteristics of each dataset and use appropriate methods for averaging.

4. Is it necessary to have the same number of data points in each dataset when averaging?

No, it is not necessary to have the same number of data points in each dataset when averaging. However, having a similar number of data points can help improve the accuracy of the average. If one dataset has significantly more data points than the other, you may need to use a statistical method to estimate missing data points in the smaller dataset.

5. How can I determine which method is best for averaging two data sets with different domains?

The best method for averaging two data sets with different domains will depend on the specific characteristics of the datasets and the purpose of the analysis. It is important to carefully consider the units of measure, missing data points, and variations in data collection methods before choosing a method. Consulting with a statistician or using statistical software can also help determine the most appropriate method for your data.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
126
  • Precalculus Mathematics Homework Help
Replies
7
Views
883
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Classical Physics
Replies
4
Views
894
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • Programming and Computer Science
Replies
9
Views
1K
Replies
2
Views
2K
Back
Top