Description Usage Arguments Details Value Note Examples
Cross-validated HAL Conditional Density Estimation
1 2 3 4 5 6 7 8 9 10 11 12 |
A |
The |
W |
A |
wts |
A |
grid_type |
A |
n_bins |
This |
cv_folds |
A |
lambda_seq |
A |
smoothness_orders |
A |
hal_basis_list |
A |
... |
Additional (optional) arguments of |
Estimation of the conditional density A|W through using the highly adaptive lasso to estimate the conditional hazard of failure in a given bin over the support of A. Cross-validation is used to select the optimal value of the penalization parameters, based on minimization of the weighted log-likelihood loss for a density.
Object of class haldensify
, containing a fitted
hal9001
object; a vector of break points used in binning A
over its support W
; sizes of the bins used in each fit; the tuning
parameters selected by cross-validation; the full sequence (in lambda) of
HAL models for the CV-selected number of bins and binning strategy; and
the range of A
.
Parallel evaluation of the cross-validation procedure to select tuning
parameters for density estimation may be invoked via the framework exposed
in the future ecosystem. Specifically, set plan
for future_mapply
to be used internally.
1 2 3 4 5 6 7 8 9 10 11 | # 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 = 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.