Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Compare an interpolation of data to the original

Subject: Compare an interpolation of data to the original

From: Susan

Date: 20 Mar, 2013 19:33:12

Message: 1 of 8

Hi all,

I have a raw dataset which I have fit an spline interpolation to. I want to compute a metric that compares the interpolation fit with the original data. Each dataset is not the same size.

Does anyone have any opinions on this? Any thoughts would be appreciated.

Kista

Subject: Compare an interpolation of data to the original

From: TideMan

Date: 20 Mar, 2013 20:15:00

Message: 2 of 8

On Thursday, March 21, 2013 8:33:12 AM UTC+13, Susan wrote:
> Hi all,
>
>
>
> I have a raw dataset which I have fit an spline interpolation to. I want to compute a metric that compares the interpolation fit with the original data. Each dataset is not the same size.
>
>
>
> Does anyone have any opinions on this? Any thoughts would be appreciated.
>
>
>
> Kista

What interpolation does is to fill in the gaps between the data points.
Unless you have additional data between those points, how are you going to assess the "interpolation fit"?
You can't.

For example, copy and paste the following into Matlab and tell me how you would determine which curve is the best interpolation fit - all are valid interpolations:
x=[1:6]';y=zeros(6,1);y(4)=1;
xi=[1:0.1:6]';
yil=interp1(x,y,xi);
yics=interp1(x,y,xi,'spline');
yipc=interp1(x,y,xi,'pchip');
clf
plot(xi,yil,xi,yics,xi,yipc)
legend('Linear','Cubic Spline','PCHIP')

Subject: Compare an interpolation of data to the original

From: Susan

Date: 20 Mar, 2013 20:27:10

Message: 3 of 8

Hi,

Thanks for your reply. Although I understand the reasoning behind doing the interpolation, I was hoping there was perhaps an apt metric which I could use as a comparison with that of the original raw spectrum. I have been looking at kurtosis, skewness etc. - although as I am dealing with frequency spectra it doesn't seem outwardly obvious to me what an apt comparative statistic would be.

I would appreciate any suggestions functions or otherwise.

Subject: Compare an interpolation of data to the original

From: anyone

Date: 20 Mar, 2013 20:52:13

Message: 4 of 8

On Wed, 20 Mar 2013 20:27:10 +0000, Susan wrote:

> Hi,
>
> Thanks for your reply. Although I understand the reasoning behind doing
> the interpolation, I was hoping there was perhaps an apt metric which I
> could use as a comparison with that of the original raw spectrum. I
> have been looking at kurtosis, skewness etc. - although as I am dealing
> with frequency spectra it doesn't seem outwardly obvious to me what an
> apt comparative statistic would be.

you don't mention -what- want from frequency spectra. nevertheless, one metric:
http://en.wikipedia.org/wiki/Coefficient_of_determination

> I would appreciate any suggestions functions or otherwise.

Otherwise: Google is your friend

Subject: Compare an interpolation of data to the original

From: anyone

Date: 20 Mar, 2013 20:57:11

Message: 5 of 8

On Wed, 20 Mar 2013 19:33:12 +0000, Susan wrote:

> Hi all,
>
> I have a raw dataset which I have fit an spline interpolation to. I
> want to compute a metric that compares the interpolation fit with the
> original data. Each dataset is not the same size.
>
> Does anyone have any opinions on this?

I like Matlab's built-in curve-fit GUI.... returns R-square, RMSE, other metrics.

> Any thoughts would be appreciated.

A view of the Sierras is especially nice, this time of year.

Subject: Compare an interpolation of data to the original

From: TideMan

Date: 20 Mar, 2013 21:01:58

Message: 6 of 8

On Thursday, March 21, 2013 9:27:10 AM UTC+13, Susan wrote:
> Hi,
>
>
>
> Thanks for your reply. Although I understand the reasoning behind doing the interpolation, I was hoping there was perhaps an apt metric which I could use as a comparison with that of the original raw spectrum. I have been looking at kurtosis, skewness etc. - although as I am dealing with frequency spectra it doesn't seem outwardly obvious to me what an apt comparative statistic would be.
>
>
>
> I would appreciate any suggestions functions or otherwise.

I would seriously question the validity of doing interpolation, then using the interpolated data to calculate the spectrum. Why would you do this? In essence, the interpolation will only contribute to the high-frequency end of the spectrum and its contribution will be pretty dubious.

Subject: Compare an interpolation of data to the original

From: TideMan

Date: 20 Mar, 2013 21:08:03

Message: 7 of 8

On Thursday, March 21, 2013 10:01:58 AM UTC+13, TideMan wrote:
> On Thursday, March 21, 2013 9:27:10 AM UTC+13, Susan wrote:
>
> > Hi,
>
> >
>
> >
>
> >
>
> > Thanks for your reply. Although I understand the reasoning behind doing the interpolation, I was hoping there was perhaps an apt metric which I could use as a comparison with that of the original raw spectrum. I have been looking at kurtosis, skewness etc. - although as I am dealing with frequency spectra it doesn't seem outwardly obvious to me what an apt comparative statistic would be.
>
> >
>
> >
>
> >
>
> > I would appreciate any suggestions functions or otherwise.
>
>
>
> I would seriously question the validity of doing interpolation, then using the interpolated data to calculate the spectrum. Why would you do this? In essence, the interpolation will only contribute to the high-frequency end of the spectrum and its contribution will be pretty dubious.

BTW, you can go the other way, i.e., use the FFT to interpolate in the time domain.
help interpft

Subject: Compare an interpolation of data to the original

From: Susan

Date: 21 Mar, 2013 10:40:18

Message: 8 of 8

Hi all,

Many thanks for your replies.

@anyone: Many thanks; I'll have a look at the coeff of determination. And as always, Google is a trusty friend but I find asking the experts directly more effective timewise!! Also, early Spring-time Scottish weather isn't very conducive to nice views, but it's nice to know that the Sierras proffer a nice vista to some!

@TideMan: Many thanks; I'll have look at interpft.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us