Skip to content

Fits a general-to-specific (GETS) regression on a 'tidyFit' R6 class. The function can be used with regress.

Usage

# S3 method for class 'gets'
.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)

  • max.paths (Number of paths to search)

The function provides a wrapper for gets::gets. See ?gets for more details.

Implementation

Print output is suppressed by default. Use 'print.searchinfo = TRUE' for print output.

References

Pretis F, Reade JJ, Sucarrat G (2018). Automated General-to-Specific (GETS) Regression Modeling and Indicator Saturation for Outliers and Structural Breaks. Journal of Statistical Software 86(3), 1-44.

See also

.fit.robust, .fit.glm and m methods

Author

Johann Pfitzinger

Examples

# Load data
data <- tidyfit::Factor_Industry_Returns

# Stand-alone function
fit <- m("gets", Return ~ `Mkt-RF` + HML + SMB, data)
fit
#> # A tibble: 1 × 5
#>   estimator_fct `size (MB)` grid_id  model_object settings        
#>   <chr>               <dbl> <chr>    <list>       <list>          
#> 1 gets::gets           2.85 #0010000 <tidyFit>    <tibble [1 × 1]>

# Within 'regress' function
fit <- regress(data, Return ~ ., m("gets"), .mask = c("Date", "Industry"))
coef(fit)
#> # A tibble: 5 × 4
#> # Groups:   model [1]
#>   model term   estimate model_info      
#>   <chr> <chr>     <dbl> <list>          
#> 1 gets  Mkt-RF   0.978  <tibble [1 × 3]>
#> 2 gets  HML      0.0632 <tibble [1 × 3]>
#> 3 gets  RMW      0.155  <tibble [1 × 3]>
#> 4 gets  CMA      0.113  <tibble [1 × 3]>
#> 5 gets  RF       0.955  <tibble [1 × 3]>