Description Usage Arguments Value Author(s) References See Also Examples
View source: R/hier_basis_additive.R
Degrees of Freedom for Additive HierBasis
1 | GetDoF.addHierBasis(object)
|
object |
An object of class |
A numeric vector of degrees of freedom for the sequence of lambda values
Asad Haris (aharis@uw.edu), Ali Shojaie and Noah Simon
Haris, A., Shojaie, A. and Simon, N. (2018). Nonparametric Regression with Adaptive Smoothness via a Convex Hierarchical Penalty. Available on request by authors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(HierBasis)
require(Matrix)
set.seed(1)
# Generate the points x.
n <- 100
p <- 30
x <- matrix(rnorm(n*p), ncol = p)
# A simple model with 3 non-zero functions.
y <- rnorm(n, sd = 0.1) + sin(x[, 1]) + x[, 2] + (x[, 3])^3
mod <- AdditiveHierBasis(x, y, nbasis = 50, max.lambda = 30,
beta.mat = NULL,
nlam = 50, alpha = 0.5,
lam.min.ratio = 1e-4, m.const = 3,
max.iter = 300, tol = 1e-4)
df <- GetDoF.addHierBasis(mod)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.