Skip to content

Fits a Bayesian ridge regression on a 'tidyFit' R6 class. The function can be used with regress.

Usage

# S3 method for class 'bridge'
.fit(self, data = NULL)

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).

Value

A fitted tidyFit class model.

Details

Hyperparameters:

None. Cross validation not applicable.

Important method arguments (passed to m)

The function provides a wrapper for monomvn::bridge. See ?bridge 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.ridge, .fit.blasso and m methods

Author

Johann Pfitzinger

Examples

# Load data
data <- tidyfit::Factor_Industry_Returns

# Stand-alone function
fit <- m("bridge", 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::bridge        1.44 #0010000 <tidyFit>    <tibble [1 × 1]>

# Within 'regress' function
fit <- regress(data, Return ~ ., m("bridge", 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 bridge (Intercept) -0.00869  <tibble [1 × 2]>
#> 2 bridge Mkt-RF       0.969    <tibble [1 × 2]>
#> 3 bridge SMB          0.000364 <tibble [1 × 2]>
#> 4 bridge HML          0.0560   <tibble [1 × 2]>
#> 5 bridge RMW          0.155    <tibble [1 × 2]>
#> 6 bridge CMA          0.114    <tibble [1 × 2]>
#> 7 bridge RF           0.986    <tibble [1 × 2]>