Rc(data, closest.coords, type="curve")
lpc.Rc(object)
lpc
or lpc.spline
.Rc
computes the value $R_C$, a quantity which
estimates the goodness-of-fit of a fitted principal curve. This
quantity can be interpreted similar to the coeffient of determination in
regression analysis: Values close to 1 indicate a good fit, while values
close to 0 indicate a `bad' fit (corresponding to linear PCA).In principle, function Rc
can be used for assessing
goodness-of-fit of any principal curve algorithm provided that
the coordinates (closest.coords
) of the projected data are
available (For instance, for HS principal curves fitted via
princurve
, this information is contained in component $s
,
and for LPCs this information is given in component $closest.coords
of the
spline representation). It can also be used for assessing the
goodness-of-fit of algorithms which find "principal points" (such as
iterative mean shift, or k-means); set type="points"
in
this case (see also help file to ms
).
lpc.Rc
is a wrappper around Rc
, which takes an object of
type lpc
or lpc.spline
. This function computes all missing information, so computation will take the longer the less informative the given object
is.
If the data were scaled, then the scaled data and results should also be
used as arguments in Rc
. The function lpc.Rc
looks up the option scaled
in the fitted
object, and cares for this automatically. Important: If the data
were scaled, then do NOT unscale the results by hand in order to feed
the unscaled version into Rc
, this will give a wrong result.
In terms of methodology, these functions compute $R_c$ directly through the mean reduction of absolute residual length, rather than through the area above the coverage curve.
These functions do currently not account for observation weights, i.e. $R_C$ is computed through the unweighted mean reduction in absolute residual length (even if weights have been used for the curve fitting).
Einbeck (2011). Bandwidth selection for nonparametric unsupervised learning techniques -- a unified approach via self-coverage. Journal of Pattern Recognition Research, to appear.
lpc.spline
data(calspeedflow)
lpc1 <- lpc(calspeedflow[,3:4])
lpc.Rc(lpc1)
Run the code above in your browser using DataLab