RobustTRegression is an R package for performing robust regression using the t-distribution. It provides tools to fit regression models that are resistant to outliers and heavy-tailed errors, improving the reliability of parameter estimates in such scenarios.
We utilize two-stage procedure under the student’s-t regression framework
as follows: we first estimate the degrees of freedom parameter (
- Profile likelihood
- Adjusted profile likelihood
- Independent Jeffrey's
- Marginalized Jeffrey's
- Marginalized Fisher
Generate synthetic data from a linear regression model where the error terms follow a Student's t-distribution with a specified degrees of freedom.
Example:
simulate_t_error_data(n = 300, p = 1, beta = rep(0,1), sigma = 1, nu = 2, seed = NULL)- Profile likelihood
- Adjusted profile likelihood
- Likelihood with sigma inverse prior, constant
$\beta$ prior and$\nu$ Independent Jeffrey's prior - Profile likelihood with
$\nu$ Jeffrey's prior - Profile likelihood with
$\nu$ Fisher prior ($\nu$ block in Fisher information)
For each of the 5
Example:
estimate_nu_profile(y, x, omega_init = 1/2)We also provide a function to conduct estimations on all 5 approaches all at once.
Users need to specify the initial value in
Example:
run_all_estimators(y, x, omega_init = 1/2)We provide functions to first compute a
- Profile likelihood
- Adjusted profile likelihood
- Independent Jeffrey's
- Marginalized Jeffrey's
- Marginalized Fisher
Users need to specify the initial value in
Additionally, users can also opt for non
- Fixed
$\nu$ (specifymethodas a positive integer) - OLS
- Huber
Example:
estimate_beta(y, x, method = "Profile", omega_init = 0.5)You can install the package directly from GitHub using remotes:
# Install remotes if not already installed
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}# Install RobustTRegression from GitHub
remotes::install_github("amanda-ng518/RobustTRegression")