spline_score {drape} | R Documentation |
Univariate score estimation via the smoothing spline method of Cox 1985 and Ng 1994.
Description
Univariate score estimation via the smoothing spline method of Cox 1985 and Ng 1994.
Usage
spline_score(x, df = 5, tol = 0.001, nmax = NULL)
Arguments
x |
vector of datapoints |
df |
vector of smoothing parameters for the non-parametric score estimator, corresponding to the effective degrees of freedom for a smoothing spline. |
tol |
numeric tolerance, minimum distance between neighbouring points, to avoid singularities. |
nmax |
if specified, overrides tol as maximal number of unique points. |
Value
score function "rho" and derivative "drho", which take vector input and yield a vector of score estimates corresponding to each df (in a list if there are multiple df values). Also output the vector "df".
Examples
# Single bandwidth
x <- stats::rlogis(100)
spl <- spline_score(x, df=6)
spl$rho(x)
spl$drho(x)
# Multiple bandwidths simultaneously
x <- stats::rt(n=100, df=4)
spl <- spline_score(x, df=c(2,5,10))
spl$rho(x)
[Package drape version 0.0.1 Index]