Undergrad How to calculate slope for data set

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Data Set Slope
Click For Summary
To calculate the slope of a data set, the user is facing challenges due to measurement errors causing multiple identical y-values in a small domain. The current slope formula used may not be effective with excessive data points. Suggestions include fitting a curve using optimization techniques or aggregating data into bins to average values for better accuracy. The user is considering omitting some data points to simplify calculations. These approaches aim to enhance the reliability of the results for publication.
member 428835
Hi PF!

I have some data (y-value data and x-value data) which I can plot to make a curve (see attachment, the top curve). However, when trying to compute the slope of this data I have an issue (see attachment, the bottom "curve"). The formula I am using for slope is ##(y_{i+1}-y_{i-1})/(2 \Delta x)##.

To me it seems the issue is I have way too much data. Many of the y data values for some small neighborhood in the domain are the same due to measurement errors (measuring can only be so accurate). Should I simply omit all but, say, every 10th data value? Is this scientifically acceptable (results will be published)?

I can explain more if you need. Thanks!
 

Attachments

Physics news on Phys.org
It sounds like what you want to do is to fit a curve to the data. A couple of different things you could do are

1. Find a function with a few parameters that has the broad shape of the curve you drew, then use optimization techniques to estimate those parameters by something like minimizing sums of squares of errors. this is a non-linear equivalent of linear regression.

2. Aggregate data along the horizontal axis into bins and then just plot the average value for all observations in each bin.
 
  • Like
Likes member 428835
Thanks andrewkirk! I'm on it!
 

Similar threads

  • · Replies 53 ·
2
Replies
53
Views
5K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K