| Search Locate Previous Next | Contents |
When you use the Trend style to draw an approximate curve through a scatter of points, it uses a default flex value of 10 which actually sets the rate of die-away of the gaussian weighting used to emphasise nearby points.
chSet 'flex' 4
A value of 0 will just draw an average (all points are weighted equally). A value of 100 will effectively force the line to visit every point. You will need to experiment with particular datasets to find the value that best hides the noise and reveals the underlying pattern in the data.
Technical data
For the statistically-minded, who want to know how this actually works!
It is a Gaussian-weighted moving average. The Flexibility sets the exponent of the gaussian, so the way I calculate it is to divide the x-axis range arbitrarily into 100 parts and for each point compute a y-value by adding up all the y-values from the data, weighted by the x-distance expressed as a classic bell-curve function.
I think the more traditional approach is to use an inverse exponential weighting based on the absolute distance, but this peaks very sharply and also tends to whiplash at the ends, whereas the gaussian is more flat-topped, so the trend is effectively an average of nearby points with far-away points included but heavily discounted.
Basically, it just looks better for most reasonable timeseries!