spline_score | R Documentation |
Univariate score estimation via the smoothing spline method of Cox 1985 and Ng 1994.
spline_score(x, df = 5, tol = 0.001, nmax = NULL)
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. |
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".
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.