powered by
Computes the score function estimate when rho(X) is assumed to lie within the span of the polynomial basis of X.
basis_poly(X, d, degree = 2, lambda = NULL)
list containing the estimated score function "rho", which takes matrix input and yields a vector of score estimates.
matrix of covariates.
integer index of covariate of interest.
maximum degree of polynomial terms.
optional scalar penalty, if "NULL" chosen via cross-validation.
set.seed(0) X <- matrix(stats::rnorm(200), ncol=4) bs <- basis_poly(X=X, d=1, degree=2) bs$rho(X)
Run the code above in your browser using DataLab