Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: -pchipolate- added to SSC


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: -pchipolate- added to SSC
Date   Mon, 3 Dec 2012 19:05:19 +0000

Thanks as usual to Kit Baum, a single command package -pchipolate- has
been added to SSC. Stata 10 is required. If interested, install with
-ssc-.

-pchipolate- is the latest of a highly irregular series of
user-written interpolation commands. Many versions ago, Stata added a
command -ipolate- for linear interpolation of some variable, say
-yvar-, with respect to another variable -xvar-.

There are several other interpolation methods of equal or greater use
even for the simple 1-D interpolation problem. SSC now offers
-cipolate- (cubics), -csipolate- (cubic splines), -nnipolate- (nearest
neighbour interpolation) and as of now -pchipolate- for piecewise
cubic Hermite interpolation. This method is often described informally
as "pchip". The piecewise cubics join smoothly, so that both the
interpolated function and its first derivative are continuous. In
addition, the interpolant is  shape-preserving in the sense that it
cannot overshoot locally; sections in which observed -yvar- is
increasing, decreasing or constant with -xvar- remain so after
interpolation, and local extremes (maxima, maxima) also remain so.So,
the result is smoother than linear interpolation but without the
possibility of "looping the loop" artefacts produced by classic cubic
interpolation or cubic spline interpolation.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index