Description Usage Arguments Value Examples
Estimates the trace of the (unknown) hat-matrix by stochastic estimation in a matrix-free manner.
1 | estimate_trace(m, q, lambda, X, pen_type = "curve", l = NULL, n_random = 5)
|
m |
Vector of non-negative integers. Each entry gives the number of inner knots for the respective covariate. |
q |
Vector of positive integers. Each entry gives the spline degree for the respective covariate. |
lambda |
Positive number as weight for the penalty term. |
X |
Matrix containing the covariates as columns and the units as rows. |
pen_type |
Utilized penalization method. Either |
l |
Positive integer vector of length |
n_random |
Positive integer for the number of random vectors in the trace estimate. Defaults to |
An estimate of the trace of the hat-matrix.
1 2 3 | data <- generate_test_data(100, 2)
X <- data$X_train
estimate_trace(m = c(7,7), q = c(2,2), lambda = 0.1, X = X)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.