Choosing a Trendline Type
by Jon Peltier
Peltier Technical Services, Inc., Copyright © 2009.
Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
In Graphical Approach to a Simple Physics Problem I discussed my daughter’s physics homework. The problem was to determine the relationships between how long it takes water to drain from a hole in the bottom of a bucket, the diameter of this hole, and the initial height of water in the bucket. The data is shown in this table.

The first step is to plot the data using XY charts. The charts below show time to drain vs height for various hole sizes and time to drain vs hole size for various diameters. We will investigate various trendline formulas using these plots.


In Trendline Fitting Errors I warned about picking an appropriate type of trendline relationship. In Graphical Approach to a Simple Physics Problem I automatically looked for a power law relationship. What if I didn’t have a scientific background? How might I go about fitting trendlines to the data. Let’s just look at the highest curve in each of the charts above, and apply a few trendlines.
Obviously the lines are not linear, but let’s start with linear trendlines. The original data are shown with points connected by dotted lines, and the trendlines by solid lines.


Since there is curvature in the data, we need a higher power of the X variable. These two charts show polynomial fits of order 2. The fits come close to fitting all of the points, but the curve for height seems to be approaching a maximum at a height of 30, implying that if we double the height, the time will decrease. The curve for diameter is even stranger, with a minimum just above 4; this implies that if we widen the hole further, the water will leak out more slowly. Both of these scenarios are rather unlikely.


To carry the polynomial fitting to an extreme, let’s look at third order fits. Fortunately with only four points, we will not be able to go beyond this. In the height relationship, the poly fit predicts a slowing of the increase of time with height, then after about 20 it accelerates. The diameter relationship actually changes direction twice. To smooth this out, we’d have to make another measurement at a height of 20 or a diameter of 4, then apply a higher order fit.


This turns into an exercise of reductio ad absurdum, and fortunately Excel doesn’t get more absurd than a polynomial fit of order 6. In my previous life as a scientist/engineer, there were very few physical relationships that theoretically followed polynomial relationships. Sometimes a poly fit was acceptable when interpolated values were required, but it’s generally better to find a simpler relationship. A simpler relationship is one with fewer fitting parameters, and which follows the form of any theoretical description of the phenomenon.
A great many physical phenomena follow power law relationships. The following show power law fits to the data.


Time to drain the bucket follows the reciprocal of diameter to the second power. This fits nicely since the volume of water passing through the hole is proportional to the area of the hole, which is proportional to the diameter squared. It’s an inverse relationship, because the larger the hole, the more water can flow, and the shorter time it will take.
I’m less certain of the height relationship. The time is obviously additive as more water is added to the initial height. Also, the added water should push harder on the water beneath, forcing it out faster. An equal increment of water height will produce a decreasing increment of time. If I weren’t too lazy to dig my old calculus book out of the basement, I’d find the similar example and determine the exact form of the drainage curve.
Below is another view of the power law fits on a double logarithmic scale (on which a power law fit traces a straight line). The visual goodness of fit lets me assert that the power law fits are appropriate.


Possibly Related Posts:
- Goal Seek – Optimization Approach to a Simple Physics Problem
- Graphical Approach to a Simple Physics Problem
- SOLVER – Optimization Approach to a Simple Physics Problem
- Regression Approach to a Simple Physics Problem
- Trendline Fitting Errors
- Rolling Wheel Animation
- Polynomial Fit vs. Statistical Process Control
- Plot Two Time Series And Trendlines With Different Dates
- Excel 2007 Regression Error – Fixed in SP1
- Ballistics Animation
Posted: Tuesday, September 9th, 2008 under Statistics.
Comments: 2
Comments
Comment from Michael
Time: Tuesday, September 9, 2008, 12:24 pm
Hi Jon -
Looking at the results, I want to jump to
y = 13.508x^.5 and y = 161.77x^-2
Lots of things in nature are squared relationships.
…mrt
Comment from Jon Peltier
Time: Tuesday, September 9, 2008, 12:39 pm
Michael -
“Lots of things in nature are squared relationships.”
Very true. One major problem with polynomial fits is that using them effectively separates the data from any resemblance to a physical model. I touched on this in Graphical Approach to a Simple Physics Problem, pointing out that the relationship to hole diameter squared was probably a linear first order relationship to hole area.
In follow-up discussions I will assume powers of 2 and 0.5 and show how to optimize the pre-exponential coefficient.
















Write a comment
I welcome comments from my readers. If you have an opinion on this post, if you have a question or if there is anything to add, I want to hear from you. Whether you agree or disagree, please join the discussion.
If you want to include an image in your comment, post it on your own site or on one of the many free image sharing sites, and include a link in your comment. I'll download your image and insert the necessary html to display the image inline.
Read the PTS Blog Comment Policy.