Statistic for the curvature or non-linearity of a dataset I'm trying to estimate the curvature/structural complexity of datasets, or the amount by which it is non-linear. The datasets are mostly very linear but with instances of very arbitrarily structured data (curves, v shapes, x shapes, hooks, etc.) which I would like to detect.
I can think of hacky approaches such as comparing the residual error of linear regressions to higher order polynomial fits, but nothing that seems rigorous or deals well with all the cases.
The most common statistic I've seen mentioned is the Pearson Product-Moment, but this fails on non-correlated, but linear data - vertical lines and horizontal lines for instance. 
Does anyone know an alternative I can use?
 A: I am not sure of the format of your data, but here is one interesting approach. If your data are highly non-linear, then it's likely that the meaningful structure of the data reside on a lower-dimensional manifold and do not require the full dimensionality of the input space to be well-represented (otherwise, how could you know they were not linear?)
If that assumption holds, then you could try two ways of projecting the data to a smaller space. One way would be based on an optimal embedding that arises from the natural structure of the data -- e.g. it "learns" the non-linear manifold structure of the data set. The other could be a dimensionality reduction algorithm that assumes the data is well represented by linear structure.
I suggest using the ISOMAP algorithm for the first and traditional PCA (or randomized PCA if you have a lot of data) for the second. ISOMAP tries to use the graphical structure of the observed data to provide an optimal projection into a lower dimensional space such that the distance along the data's natural manifold is preserved. PCA instead says the data is roughly linear and all we need to do is re-orient ourselves to the directions of most importance, then truncate dimensions based on how much of the total data variability we want to keep track of.
The interesting part is: assuming you've transformed your data by both of these methods, how to arrive at a summary statistic that captures the "amount" of non-linearity. A simple statistic (if your data is represented as column vectors in a feature matrix, such as the transpose of the RHS matrix from linear regression notation) is to just compute the Frobenius norm of the difference between the two embeddings:
$$NLSTAT(X) = ||X_{ISOMAP} - X_{PCA}||$$
Note that you should rotate these two projections to have coinciding basis, so you don't get spurious differences from misaligned coordinates. You may also want to account for scale effects.
Other norms could work too, and you could mix in some dependence on the selection of the number of dimensions $k$ to reduce to.
The idea here is that if ISOMAP picks a drastically different set of lower-dimensional representations of the data points than what PCA picks, this would be a clue that the data set has a lot of exploitable non-linear structure.
A: Initial answer:
I have recently found that ratios of robust measures of variation are okay at indicating local change in the trend.
My first idea is that you take a window of data, compute its inter-quartile range and then compute the 99th-1st inter-percentile range for the same and compose a ratio.  When that ratio changes it means there is a change in the spread.
I think you are looking at Entropy.  You could use a sliding window and compute either the entropy for the window or the Kullback-Liebler divergence between windows.  You would need to be sure to experiment with window sizes to get this to work properly.
Second answer:
There is a definition of curvature from calculus.  If you can apply it on a model-optimal smooth of your data, then you can get an idea of the gross curvature.  Unless you have great data I would not suggest that you try it on noisy/raw results.  
http://mathworld.wolfram.com/Curvature.html
