Numerical differentiation of a dataset

Click For Summary

Discussion Overview

The discussion revolves around the challenges of numerically differentiating a dataset with two columns (X and Y) that appears smooth but exhibits amplified noise in the derivative. Participants explore various methods and approaches to address this issue, including data smoothing and fitting models.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes that the numerical derivative appears "utterly senseless" due to noise amplification, questioning common practices in numerical differentiation.
  • Another suggests smoothing the data before differentiation, indicating that there are many methods available for this purpose.
  • A different approach proposed involves fitting a "best fit" function to the data and differentiating that function instead.
  • One participant expresses skepticism about the presence of noise, suggesting that if the data is indeed smooth, multi-point methods for estimating numerical derivatives could be employed.
  • Concerns are raised about the applicability of certain techniques, such as FIR and IIR filtering, which may assume uniformly sampled data, while noting that fewer techniques exist for nonuniformly sampled data.
  • Wavelet transforms are mentioned as a potential method, particularly for uniformly sampled data.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to take. Multiple competing views and methods are presented, with ongoing uncertainty regarding the presence of noise and the suitability of various techniques.

Contextual Notes

Some participants highlight limitations related to the assumptions of uniform sampling in certain methods, as well as the unresolved nature of the noise issue in the dataset.

exmachina
Messages
42
Reaction score
0
I have a dataset in two columns X and Y, sorted in ascending values of X.

I'm trying to find its numerical derivative, however, the "noise" (it's very hard to see any noise in the dataset itself when plotted), but the noise gets massively amplified to the point where the numerical derivative looks utterly senseless.

How do people do this?
 
Physics news on Phys.org
Have you tried smoothing out your data first? There are an incredible number of different ways to do so, you may want to try a quick literature search.
 
You could try passing some sort of "best fit" function through the data and then simply differentiating that function.
 
The dataset already seemed quite smooth upon an observation.
 
Can you post it for us in some way? I think kj's "best fit" option would work if you can fit it reasonably well.
 
exmachina said:
the numerical derivative looks utterly senseless.

How do people do this?

If you are willing to make the judgment that a rapdily varying derivative is a senseless result then you should be able to cite some theoretical model that explains why it shouldn't be. This would include a model for any noise. The problem is then how to incorporate this model into your calculations.

If you think there is no noise in the data, then you could use the multi-point methods for estimating numerical derivatives. (For some reason, the Wikipeida only hints at such methods in the article on numerical differentiatiion and links to its Finite Difference Coefficient Article: http://en.wikipedia.org/wiki/Finite_difference_coefficients for more information. An interesting series of lectures covering numerical methods useful in physics is on the Perimeter Scholars website. I don't recall which of these lectures explains the multi-point method. http://www.perimeterscholars.org/274.html The coding is done in FORTRAN.)
 
Last edited by a moderator:
exmachina said:
I have a dataset in two columns X and Y, sorted in ascending values of X.

I'm trying to find its numerical derivative, however, the "noise" (it's very hard to see any noise in the dataset itself when plotted), but the noise gets massively amplified to the point where the numerical derivative looks utterly senseless.

How do people do this?
That's a typical problem with numerical differentiation. There is no magic bullet even for numerical quadrature / numerical integration, and numerical quadrature is easy compared to numerical differentiation.

Are those X values uniformly spaced, such as measurements taken once per hour over several days? If so, there are a number of techniques available that are far better (less noisy) than a simple forward or backward difference. Either a finite or infinite impulse response filter can be of aid. Another approach is to use wavelets.

Fewer techniques are available for nonuniformly sampled data. FIR and IIR filtering techniques pretty much assumes uniformly sampled data. Some, but not all, wavelet transforms assume uniformly sampled data.

Yet another approach is, as has been previously suggested, to fit the data to some model and analytically differentiate the resultant model.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K