Fits a linear quantile regression on a 'tidyFit' R6
class. The function can be used with regress
.
Details
Hyperparameters:
None. Cross validation not applicable.
Important method arguments (passed to m
)
tau
(the quantile(s) to be estimated)
The function provides a wrapper for quantreg::rq
. See ?rq
for more details. The argument tau
is the chosen quantile (default tau = 0.5
).
Implementation
No implementation notes
References
Koenker R (2022). quantreg: Quantile Regression. R package version 5.94, https://CRAN.R-project.org/package=quantreg.
See also
.fit.lm
, .fit.bayes
and m
methods
Examples
# Load data
data <- tidyfit::Factor_Industry_Returns
fit <- regress(data, Return ~ .,
m("quantile", tau = c(0.1, 0.5, 0.9)),
.mask = c("Date", "Industry"))
coef(fit)
#> # A tibble: 21 × 4
#> # Groups: model [1]
#> model term estimate model_info
#> <chr> <chr> <dbl> <list>
#> 1 quantile (Intercept) -3.50 <tibble [1 × 3]>
#> 2 quantile Mkt-RF 0.942 <tibble [1 × 3]>
#> 3 quantile SMB -0.00520 <tibble [1 × 3]>
#> 4 quantile HML 0.0928 <tibble [1 × 3]>
#> 5 quantile RMW 0.132 <tibble [1 × 3]>
#> 6 quantile CMA 0.00170 <tibble [1 × 3]>
#> 7 quantile RF 0.677 <tibble [1 × 3]>
#> 8 quantile (Intercept) -0.0937 <tibble [1 × 3]>
#> 9 quantile Mkt-RF 0.984 <tibble [1 × 3]>
#> 10 quantile SMB 0.0373 <tibble [1 × 3]>
#> # ℹ 11 more rows