Comparing data sets of different sizes

AI Thread Summary
The discussion centers on the challenge of comparing two data sets with different x-value spacings and sizes. One data set contains 4175 evenly spaced x-values, while the other has 1919 non-evenly spaced x-values. The primary concern is how to modify the second data set's y-values for effective comparison without introducing inaccuracies through interpolation.Key points include the relevance of the x-array positions, as they represent wavelengths, and the y-values correspond to observed intensities. Zero-padding the smaller array is suggested, but the importance of data order raises questions. Sampling the larger x-array to match the smaller one is also considered, though it may not be effective if there are no exact wavelength matches. The discussion emphasizes the need to understand the filtering methods used during data collection, as these could influence the interpolation approach. Overall, interpolation is seen as a necessary step, albeit one that requires careful consideration to avoid distorting the data's inherent features.
cepheid
Staff Emeritus
Science Advisor
Gold Member
Messages
5,197
Reaction score
38
I have two data sets, each having its own array of x values and its own corresponding array of y values. I want to divide the y-values of two data sets. The problem I am having is that the x arrays for the two sets have totally different spacings (bin sizes). One set has 4175 data points, evenly spaced. The other set has its x values NOT evenly spaced and there are only 1919 data points in it.

What would be the best way of going about modifying the second data set so that it might be compared to the first one? I could just interpolate, but then I am worried that I am basically just adding made up data points to the y values for the second set, and that I might destroy some features in it, or add spurious ones.
 
Technology news on Phys.org
cepheid said:
I have two data sets, each having its own array of x values and its own corresponding array of y values. I want to divide the y-values of two data sets. The problem I am having is that the x arrays for the two sets have totally different spacings (bin sizes). One set has 4175 data points, evenly spaced. The other set has its x values NOT evenly spaced and there are only 1919 data points in it.

What would be the best way of going about modifying the second data set so that it might be compared to the first one? I could just interpolate, but then I am worried that I am basically just adding made up data points to the y values for the second set, and that I might destroy some features in it, or add spurious ones.

A few questions:

Are the positions in the x arrays relevant? You can perhaps zero-pad the smaller array to make it the same size of the larger one. This is a tricky question to answer because it is certainly do-able, but we'd need to know more about the data and if the order and positioning of the data points is important.

So essentially you have 4 arrays? x1, y1, x2, y2? And the y arrays are derived from the x arrays?

Can you maybe sample the larger x array and extract the number of values equal to the smaller x array? Then generate y arrays that are of equal size?
 
The positions in the x arrays are relevant. The x arrays are wavelengths. The y arrays are essentially intensities. So these are spectra. See the astronomy thread that I linked to for more details.

Yes, there are four arrays as you described. The y arrays are not derived from the x arrays. They are observed/measured intensities for each wavelength.

Sampling the larger x array may not be that useful, since the other data I have that I'm going to calibrate off these data are equally as large. Also, what if none of the wavelengths in x1 exactly match those in x2?
 
Seems to me you're stuck interpolating. When the samples are taken, how is the filtering done: how steep are the ramps of the high and low pass band filters for each frequency range used in the sample gathering? The filters are in effect acting as interpolators already. When you mention "equally" spaced, is this linear, logarithmic, ... ? How large is the range and domain of the sampled data set? Interpolation somewhat modeled after the filters might improve the results.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top