Print: Highly Adaptive Lasso Conditional Density Estimates
# S3 method for haldensify
print(x, ...)An object of class haldensify.
Other options (not currently used).
None. Called for the side effect of printing an informative summary
of slots of objects of class haldensify.
The print method for objects of class haldensify
# simulate data: W ~ U[-4, 4] and A|W ~ N(mu = W, sd = 0.5)
set.seed(429153)
n_train <- 50
w <- runif(n_train, -4, 4)
a <- rnorm(n_train, w, 0.5)
# learn relationship A|W using HAL-based density estimation procedure
haldensify_fit <- haldensify(
A = a, W = w, n_bins = c(3, 5),
lambda_seq = exp(seq(-1, -15, length = 50L)),
max_degree = 3, reduce_basis = 0.1
)
print(haldensify_fit)
#> HAL Conditional Density Estimation
#> Number of bins over support of A: 5
#> CV-selected lambda: 0.0038
#> Summary of fitted HAL:
#> Warning: Coefficients for many lambda exist --
#> Summarizing coefficients corresponding to minimum lambda.
#> coef term
#> 1: 11.56263 (Intercept)
#> 2: -18.73900 [ I(W >= -3.663) ]
#> 3: -17.78439 [ I(W >= -2.872) ]
#> 4: 17.03175 [ I(W >= -3.596) ]
#> 5: -15.83872 [ I(W >= -0.964) ]
#> 6: 14.66159 [ I(bin_id >= 2) ]
#> 7: -14.62246 [ I(W >= -1.353) ]
#> 8: 14.20375 [ I(bin_id >= 3) ]
#> 9: -13.58029 [ I(W >= 1.35) ]
#> 10: -12.26224 [ I(W >= 1.032) ]