smooth.median Function (GPL)
Syntax
smooth.median(<algebra>, <function>)
or
smooth.median.<kernel>(<algebra, <function>)
<algebra>. Graph algebra, such as x*y
.
Refer to Brief Overview of GPL Algebra for an introduction to graph algebra.
<kernel>. A kernel function for the smoother. This specifies how data are weighted by the smoother, depending on how close the data are to the current point. If no kernel is specified, Epanechnikov is used.
<function>. One or more valid functions. These are
optional. If no proportion
function is specified,
1 is used for the proportion.
Description
Calculates the smoothed median of y in a 2-D (x*y) frame and z in a 3-D (x*y*z) frame. To force a straight line (a constant value), use the uniform kernel function.
Examples
ELEMENT: line(position(smooth.median.uniform(salbegin*salary)))
Kernel Functions
uniform. All data receive equal weights.
epanechnikov. Data near the current point receive higher weights than extreme data receive. This function weights extreme points more than the triweight, biweight, and tricube kernels but less than the Gaussian and Cauchy kernels.
biweight. Data far from the current point receive more weight than the triweight kernel allows but less weight than the Epanechnikov kernel permits.
tricube. Data close to the current point receive higher weights than both the Epanechnikov and biweight kernels allow.
triweight. Data close to the current point receive higher weights than any other kernel allows. Extreme cases get very little weight.
gaussian. Weights follow a normal distribution, resulting in higher weighting of extreme cases than the Epanechnikov, biweight, tricube, and triweight kernels.
cauchy. Extreme values receive more weight than the other kernels, with the exception of the uniform kernel, allow.