[R-sig-eco] Finding the largest kink
Philip Dixon
pdixon at iastate.edu
Mon Dec 20 17:25:08 CET 2010
Matt,
When you ask "the question is how to pull out the number that is the
(largest) kink.", are you trying to find the largest first derivative or
the largest second derivative?
The x at which the first derivative is largest in magnitude will
identify when the population changes most rapidly.
The x at which the first derivative is most negative will identify when
the population drops the fastest.
The x at which to second derivative is the most negative will correspond
to the biggest negative kink in the population trend, i.e. biggest
change in trend.
The theory of penalized smoothing splines can be extended to predict
derivatives. The only thing to be careful about is to fit a high order
smoothing spline to the data. General recommendation is order = desired
derivative + 1 or +2. I usually use +2. If you want to estimate
second derivatives smoothly, that means fitting a quartic smoothing spline.
predict.smooth.Pspline() in the pspline package predicts derivatives
from a smooth.Pspline object.
Best wishes,
Philip Dixon
More information about the R-sig-ecology
mailing list