Something for the math whizzes out there

Please register or login

Welcome to ScubaBoard, the world's largest scuba diving community. Registration is not required to read the forums, but we encourage you to join. Joining has its benefits and enables you to participate in the discussions.

Benefits of registering include

  • Ability to post and comment on topics and discussions.
  • A Free photo gallery to share your dive photos with the world.
  • You can make this box go away

Joining is quick and easy. Log in or Register now!

mongoose

Contributor
Messages
165
Reaction score
1
Location
Denton, TX
# of dives
200 - 499
OK, I've been toying around with this on my computer, trying to calculate an average value for a set of readings over time.

MY QUESTION: Imagining a dot-to-dot line through all the data points, and that being a "curve", if I take the area under that curve, and divide it by the amount of time (x-axis) over which I am measuring, it seems to yield the average value of all my readings over that span of time.

This seems too easy, is my algorithm flawed?

Thanks,
--'Goose
 
In most cases, figuring the area under the curve is more difficult than calculating the average of all readings, but other than that you method is fine.

Depending upon how you are doing the area under the curve, you might be either overweighting or underweighting the very first point and the very last point, but when you have many points, it becomes irrelevant.

If your sample points aren't evenly spaced in time, then your method is actually better in most cases than just doing an equally weighted average of the points.
 
Charlie99:
In most cases, figuring the area under the curve is more difficult than calculating the average of all readings, but other than that you method is fine.

Depending upon how you are doing the area under the curve, you might be either overweighting or underweighting the very first point and the very last point, but when you have many points, it becomes irrelevant.

If your sample points aren't evenly spaced in time, then your method is actually better in most cases than just doing an equally weighted average of the points.

The way I calc the area is to chop the curve into polygons (imagine a vertical line drawn from the data point down (or up) to the x-axis, then keep a running total of all those areas as I move over the readings.

My last reading assumes a value of zero 15 secs after the last reading. One thing I can't assume is that each reading will be at precisely 15 seconds. So for each data point I have to calculate the time interval since the last reading, even though it is almost invariably 15 secs.

The application is to calculate average depth from my dive computer database, where all I have are depths(y-axis) and the number of seconds into the dive(x-axis).

If anyone has the Aeris computer interface, and wants to see source code & binaries, PM me & I'll send you (USE AT YOUR OWN RISK) the program I use to see my SAC rates.

--'Goose
 
mongoose:
OK, I've been toying around with this on my computer, trying to calculate an average value for a set of readings over time.

MY QUESTION: Imagining a dot-to-dot line through all the data points, and that being a "curve", if I take the area under that curve, and divide it by the amount of time (x-axis) over which I am measuring, it seems to yield the average value of all my readings over that span of time.

This seems too easy, is my algorithm flawed?

Thanks,
--'Goose
not a math-whizz here but this is what I remember.

I think you use integration to get areas under a curve, assuming continuity and I forgot what other conditions.

What are those readings your talking about?

Also, I believe demos of Mathlab (or similar software) can do the calculations for you. Then if your premises are logical or not, will be another matter.
 
Ana:
not a math-whizz here but this is what I remember.

I think you use integration to get areas under a curve, assuming continuity and I forgot what other conditions.

What are those readings your talking about?

Also, I believe demos of Mathlab (or similar software) can do the calculations for you. Then if your premises are logical or not, will be another matter.
The problem with using Integration is that you have to start with or find an equation whos curve closely approximates the data points.

From that equation, you can then take: bounded Intregral / (upper limit - lower limit) to determine the average.
 
https://www.shearwater.com/products/teric/

Back
Top Bottom