| Title: | Dynamically Weighted Modified Maximum Likelihood (DWMML) Ridge Regression |
|---|---|
| Description: | Implements the dynamically weighted modified maximum likelihood ridge (DWMMLR) regression estimator, a robust and multicollinearity-aware linear regression estimator that combines the DWMML3 weighting procedure of Sazak (2019) <doi:10.1080/00949655.2019.1571060> with ridge penalization to address both outlier sensitivity and variance inflation due to multicollinearity. The ridge parameter is selected automatically using the approach implemented in the 'ridgregextra' package (Karadag, Sazak, and Aydin, 2023) <https://CRAN.R-project.org/package=ridgregextra>, described further in Karadag, Sazak, and Aydin (2026) <doi:10.1080/02664763.2026.2655681>, which targets a variance inflation factor (VIF) close to but not below 1, removing the need for manual tuning. Returns comprehensive outputs (coefficients, fitted values, residuals, mean squared error (MSE), standard errors, R-squared, and adjusted R-squared) through a simple x/y interface. |
| Authors: | Filiz Karadag [aut, cre] (ORCID: <https://orcid.org/0000-0002-0116-7772>), Hakan Savas Sazak [aut] (ORCID: <https://orcid.org/0000-0001-6123-1214>), Olgun Aydin [aut] (ORCID: <https://orcid.org/0000-0002-7090-0931>) |
| Maintainer: | Filiz Karadag <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-06-27 09:37:36 UTC |
| Source: | https://github.com/filizkrdg/dwmmlridge |
Full regression results using the DWMML3 Ridge Regression Estimator
dwmmlR.reg(x, y)dwmmlR.reg(x, y)
x |
A numeric vector or matrix of predictor variables. |
y |
A numeric vector or matrix of response values. |
A list containing 'esttabledataframe', 'stdtabledataframe', and additional model diagnostics.
Weightedridge.reg for the underlying
weighted ridge regression implementation,
ridgereg_k for the ridge parameter
selection method used internally by Styperidge.reg.
if (requireNamespace("mctest", quietly = TRUE)) { data(Hald, package = "mctest") x <- Hald[, -1] y <- Hald[, 1] fit <- dwmmlR.reg(x, y) fit$esttabledataframe } if (requireNamespace("isdals", quietly = TRUE)) { data(bodyfat, package = "isdals") x <- bodyfat[, -1] y <- bodyfat[, 1] fit <- dwmmlR.reg(x, y) fit$esttabledataframe }if (requireNamespace("mctest", quietly = TRUE)) { data(Hald, package = "mctest") x <- Hald[, -1] y <- Hald[, 1] fit <- dwmmlR.reg(x, y) fit$esttabledataframe } if (requireNamespace("isdals", quietly = TRUE)) { data(bodyfat, package = "isdals") x <- bodyfat[, -1] y <- bodyfat[, 1] fit <- dwmmlR.reg(x, y) fit$esttabledataframe }
Fits a weighted least squares (WLS) regression model with an intercept
term. Weights can be supplied as a vector, a single-column data frame, or
a square weight matrix. If a vector or data frame is supplied, it is
internally converted to a diagonal weight matrix.
In the example below, the weight vector W is generated from a
Uniform(0, 1) distribution purely to illustrate how to call the function.
In practice, users should provide weights that reflect the structure of
their data (e.g., from variance estimates or a robust weighting scheme).
Weightedls.reg(x, y, W)Weightedls.reg(x, y, W)
x |
Explanatory variables. A data.frame or matrix with observations in rows and predictors in columns. |
y |
Dependent variable. A numeric vector, data.frame, or matrix. For a
univariate response, this should be a length- |
W |
Observation weights. Can be
If |
A list with the following components:
Numeric matrix ((p+1) x 1). Estimated regression coefficients, including the intercept in the first row.
Numeric matrix (n x 1). Residuals (y - yhat).
Numeric matrix (n x 1). Weighted residuals (W^(1/2) %*% e).
Numeric matrix (n x 1). Fitted values (X %*% beta).
Numeric matrix (n x 1). Fitted values in the weighted space (Xw %*% beta).
Numeric scalar. Mean squared error computed from weighted residuals.
Numeric scalar. Overall model F statistic based on the weighted ANOVA decomposition.
Numeric scalar. P-value associated with F.
Numeric matrix ((p+1) x (p+1)). Estimated covariance matrix of beta.
Numeric vector (length p+1). Standard errors of beta.
Numeric scalar. Weighted coefficient of determination (R-squared).
Numeric scalar. Adjusted weighted R-squared.
A data.frame. ANOVA-style table with sums of squares, degrees of freedom, mean squares, F, and p-value.
Numeric matrix (2 x (p+1)). Confidence intervals for beta; first row is lower, second row is upper.
if (requireNamespace("isdals", quietly = TRUE)) { data(bodyfat, package = "isdals") x <- bodyfat[, -1] y <- bodyfat[, 1] n <- nrow(x) W <- runif(n, min = 0, max = 1) fit <- Weightedls.reg(x, y, W) fit$beta fit$R2 fit$anovatable }if (requireNamespace("isdals", quietly = TRUE)) { data(bodyfat, package = "isdals") x <- bodyfat[, -1] y <- bodyfat[, 1] n <- nrow(x) W <- runif(n, min = 0, max = 1) fit <- Weightedls.reg(x, y, W) fit$beta fit$R2 fit$anovatable }