Description Usage Arguments Details Value Examples
Fit Conditional Density Estimation for a Sequence of HAL Models
1 2 3 4 5 6 7 8 9 10 11 |
A |
The |
W |
A |
wts |
A |
grid_type |
A |
n_bins |
This |
cv_folds |
A |
lambda_seq |
A |
smoothness_orders |
A |
... |
Additional (optional) arguments of |
Estimation of the conditional density of A|W via a cross-validated highly adaptive lasso, used to estimate the conditional hazard of failure in a given bin over the support of A.
A list
, containing density predictions for the sequence of
fitted HAL models; the index and value of the L1 regularization parameter
minimizing the density loss; and the sequence of empirical risks for the
sequence of fitted HAL models.
1 2 3 4 5 6 7 8 9 10 | # simulate data: W ~ U[-4, 4] and A|W ~ N(mu = W, sd = 0.5)
n_train <- 50
w <- runif(n_train, -4, 4)
a <- rnorm(n_train, w, 0.5)
# fit cross-validated HAL-based density estimator of A|W
haldensify_cvfit <- fit_haldensify(
A = a, W = w, n_bins = 10L, lambda_seq = exp(seq(-1, -10, length = 100)),
# the following arguments are passed to hal9001::fit_hal()
max_degree = 3, reduce_basis = 1 / sqrt(length(a))
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.