Fits a Bayesian Lasso regression on a 'tidyFit' R6
class. The function can be used with regress
.
Arguments
- self
a tidyFit R6 class.
- data
a data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).
Details
Hyperparameters:
None. Cross validation not applicable.
Important method arguments (passed to m
)
The function provides a wrapper for monomvn::blasso
. See ?blasso
for more details.
Implementation
Features are standardized by default with coefficients transformed to the original scale.
References
Gramacy RB, (qpgen2/quadprog) wFcfCMaubBAT (2023). monomvn: Estimation for MVN and Student-t Data with Monotone Missingness. R package version 1.9-17, https://CRAN.R-project.org/package=monomvn.
See also
.fit.lasso
, .fit.bridge
and m
methods
Examples
# Load data
data <- tidyfit::Factor_Industry_Returns
# Stand-alone function
fit <- m("blasso", Return ~ ., data, T = 100)
fit
#> # A tibble: 1 × 5
#> estimator_fct `size (MB)` grid_id model_object settings
#> <chr> <dbl> <chr> <list> <list>
#> 1 monomvn::blasso 4.11 #0010000 <tidyFit> <tibble [1 × 1]>
# Within 'regress' function
fit <- regress(data, Return ~ ., m("blasso", T = 100),
.mask = c("Date", "Industry"))
coef(fit)
#> # A tibble: 7 × 4
#> # Groups: model [1]
#> model term estimate model_info
#> <chr> <chr> <dbl> <list>
#> 1 blasso (Intercept) -0.00674 <tibble [1 × 2]>
#> 2 blasso Mkt-RF 0.969 <tibble [1 × 2]>
#> 3 blasso SMB 0.00161 <tibble [1 × 2]>
#> 4 blasso HML 0.0621 <tibble [1 × 2]>
#> 5 blasso RMW 0.153 <tibble [1 × 2]>
#> 6 blasso CMA 0.112 <tibble [1 × 2]>
#> 7 blasso RF 0.978 <tibble [1 × 2]>